Hi all:
I am trying to simulate an X-Ray tube, the target of the tube is made of Ag. An SDD detector is placed outside the Be window of the X-ray tube.I use 10000 50keV electrons hit the Ag target, but the energy spectrum of the tube is not right.
The simple model is as follow.
The physicList is listed in the bellow.
void PhysicsList::ConstructParticle()
{
ConstructBosons();
ConstructLeptons();
ConstructBarions();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PhysicsList::ConstructBosons()
{
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PhysicsList::ConstructBarions()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4GenericIon::GenericIonDefinition();
}
void PhysicsList::ConstructProcess()
{
AddTransportation();
ConstructEM();
// ConstructGeneral();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void PhysicsList::ConstructEM()
{
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
// ****************************************************************
// Identical to G4EmStandardPhysics but added G4StepLimiter process
// ****************************************************************
auto particleIterator = GetParticleIterator();
particleIterator->reset();
while ((*particleIterator)()) {
G4ParticleDefinition* particle = particleIterator->value();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
ph->RegisterProcess(new G4PhotoElectricEffect(), particle);
ph->RegisterProcess(new G4ComptonScattering(), particle);
ph->RegisterProcess(new G4GammaConversion(), particle);
ph->RegisterProcess(new G4RayleighScattering(), particle);
// ph->RegisterProcess(new G4GeneralGammaProcess(), particle);
}
else if (particleName == "e-") {
ph->RegisterProcess(new G4eMultipleScattering(), particle);
ph->RegisterProcess(new G4eIonisation(), particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
}
else if (particleName == "e+") {
ph->RegisterProcess(new G4eMultipleScattering(), particle);
ph->RegisterProcess(new G4eIonisation(), particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
}
else if (particleName == "mu+" ||
particleName == "mu-") {
G4MuMultipleScattering* msc = new G4MuMultipleScattering();
msc->AddEmModel(0, new G4WentzelVIModel());
ph->RegisterProcess(msc, particle);
ph->RegisterProcess(new G4MuIonisation(), particle);
ph->RegisterProcess(new G4MuBremsstrahlung(), particle);
ph->RegisterProcess(new G4MuPairProduction(), particle);
ph->RegisterProcess(new G4CoulombScattering(), particle);
}
else if (particleName == "alpha" ||
particleName == "He3") {
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4ionIonisation(), particle);
}
else if (particleName == "GenericIon") {
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4ionIonisation(), particle);
}
else if (particleName == "proton") {
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4hIonisation(), particle);
ph->RegisterProcess(new G4hBremsstrahlung(), particle);
ph->RegisterProcess(new G4hPairProduction(), particle);
ph->RegisterProcess(new G4StepLimiter(), particle);
}
}
//===========================================================================//
// la deséxcitation des atomes:: pour avoir les rayonnements caractéris-
// tiques dans le spectre des rayons x
//===========================================================================//
G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
de->SetFluo(true);
de->SetAuger(true);
de->SetPIXE(true);
G4LossTableManager::Instance()->SetAtomDeexcitation(de);
}
I run the simulation in the single thread mode.Am I doing this right?
auto* runManager = G4RunManagerFactory::CreateRunManager();
G4int nThreads = 1;
runManager->SetNumberOfThreads(nThreads);
The energy spectrum of the tube(energy deposited inside the detector) is as followed.
void XrayFluoSteppingAction::UserSteppingAction(const G4Step* aStep)
{
if (aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume() == pTest)
{
particleName = aStep->GetTrack()->GetParticleDefinition()->GetParticleName();
fEvent->AddEnergy(aStep->GetTotalEnergyDeposit());
}
void XrayFluoEventAction::EndOfEventAction(const G4Event* evt)
{
auto analysisManager = G4AnalysisManager::Instance();
if(energyD)
analysisManager->FillH1(0, energyD / keV);
}