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[ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 
 27 #include "eRositaPhysicsList.hh"
 28 
 29 #include "globals.hh"
 30 #include "G4ios.hh"
 31 #include "G4ParticleDefinition.hh"
 32 #include "G4ParticleTypes.hh"
 33 #include "G4PhysicsListHelper.hh"
 34 #include "G4ProductionCutsTable.hh"
 35 #include "G4StepLimiter.hh"
 36 #include "G4SystemOfUnits.hh"
 37 #include "G4VPhysicsConstructor.hh"
 38 
 39 // Physics List
 40 #include "G4DecayPhysics.hh"
 41 #include "G4EmLivermorePhysics.hh"
 42 #include "G4EmPenelopePhysics.hh"
 43 #include "G4EmStandardPhysics.hh"
 44 
 45 // Process
 46 #include "G4ComptonScattering.hh"
 47 #include "G4eBremsstrahlung.hh"
 48 #include "G4eIonisation.hh"
 49 #include "G4eMultipleScattering.hh"
 50 #include "G4eplusAnnihilation.hh"
 51 #include "G4GammaConversion.hh"
 52 #include "G4hImpactIonisation.hh"
 53 #include "G4hIonisation.hh"
 54 #include "G4hMultipleScattering.hh"
 55 #include "G4ionIonisation.hh"
 56 #include "G4PhotoElectricEffect.hh"
 57 #include "G4RayleighScattering.hh"
 58 
 59 // Model
 60 #include "G4LivermoreBremsstrahlungModel.hh"
 61 #include "G4LivermoreComptonModel.hh"
 62 #include "G4LivermoreGammaConversionModel.hh"
 63 #include "G4LivermoreIonisationModel.hh"
 64 #include "G4LivermorePhotoElectricModel.hh"
 65 #include "G4LivermoreRayleighModel.hh"
 66 #include "G4PenelopeAnnihilationModel.hh"
 67 #include "G4UniversalFluctuation.hh"
 68 
 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 70 
 71 eRositaPhysicsList::eRositaPhysicsList()
 72 {
 73     SetVerboseLevel(1);
 74 
 75     constexpr auto DEFAULT_CUT_VALUE{0.001 * mm};
 76     SetDefaultCutValue(DEFAULT_CUT_VALUE);
 77 
 78     G4cout << "============================================================================================="
 79               << G4endl
 80               << "Geant4 eRosita example, based on a simplified version of eROSITA simulation."
 81               << G4endl
 82               << "Further details can be found in:"
 83               << G4endl
 84               << " M. G. Pia et al.,"
 85               << G4endl
 86               << "  'PIXE Simulation With Geant4',"
 87               << G4endl
 88               << "  IEEE Trans. Nucl. Sci., vol. 56, no. 6, pp. 3614-3649, 2009"
 89               << G4endl
 90               << " N. Meidinger et al.,"
 91               << G4endl
 92               << "  'Development of the focal plane PNCCD camera system for the X-ray space telescope eROSITA',"
 93               << G4endl
 94               << "  NIM A 624, 321-329, 2010"
 95               << G4endl
 96               << "============================================================================================="
 97               << G4endl;
 98 
 99     G4cout << G4endl;
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
103 
104 eRositaPhysicsList::~eRositaPhysicsList()
105 {
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 
110 void eRositaPhysicsList::ConstructBosons()
111 {
112     // geantino (pseudo-particle)
113     // G4Geantino::GeantinoDefinition();
114 
115     // charged geantino (pseudo-particle)
116     // G4ChargedGeantino::ChargedGeantinoDefinition();
117 
118     // photon (gamma)
119     G4Gamma::GammaDefinition();
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123 
124 void eRositaPhysicsList::ConstructLeptons()
125 {
126     // leptons
127 
128     // e+ / e-
129     G4Electron::ElectronDefinition();
130     G4Positron::PositronDefinition();
131 
132     // mu+ / mu-
133     // G4MuonPlus::MuonPlusDefinition();
134     // G4MuonMinus::MuonMinusDefinition();
135 
136     // nu_e
137     // G4NeutrinoE::NeutrinoEDefinition();
138     // G4AntiNeutrinoE::AntiNeutrinoEDefinition();
139 
140     // nu_mu
141     // G4NeutrinoMu::NeutrinoMuDefinition();
142     // G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
147 void eRositaPhysicsList::ConstructMesons()
148 {
149     // light mesons
150 
151     // pion
152     // G4PionPlus::PionPlusDefinition();
153     // G4PionMinus::PionMinusDefinition();
154     // G4PionZero::PionZeroDefinition();
155 
156     // eta
157     // G4Eta::EtaDefinition();
158     // G4EtaPrime::EtaPrimeDefinition();
159 
160     // kaon
161     // G4KaonPlus::KaonPlusDefinition();
162     // G4KaonMinus::KaonMinusDefinition();
163     // G4KaonZero::KaonZeroDefinition();
164     // G4AntiKaonZero::AntiKaonZeroDefinition();
165     // G4KaonZeroLong::KaonZeroLongDefinition();
166     // G4KaonZeroShort::KaonZeroShortDefinition();
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
170 
171 void eRositaPhysicsList::ConstructBaryons()
172 {
173     // baryons
174 
175     // proton
176     G4Proton::ProtonDefinition();
177     G4AntiProton::AntiProtonDefinition();
178 
179     // neutron
180     // G4Neutron::NeutronDefinition();
181     // G4AntiNeutron::AntiNeutronDefinition();
182 }
183 
184 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
185 
186 void eRositaPhysicsList::ConstructParticle()
187 {
188     ConstructBosons();
189     ConstructLeptons();
190     ConstructMesons();
191     ConstructBaryons();
192 }
193 
194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
195 
196 void eRositaPhysicsList::ConstructEM()
197 {
198     auto *helper = G4PhysicsListHelper::GetPhysicsListHelper();
199 
200     auto particleIterator = GetParticleIterator();
201     particleIterator->reset();
202 
203     while ((*particleIterator)()) {
204         auto *particle = particleIterator->value();
205         auto particleName = particle->GetParticleName();
206 
207         if (particleName == "gamma") { // photon
208             // photoelectric effect
209             auto *photoelectricEffect = new G4PhotoElectricEffect();
210             // photoelectricEffect->ActivateAuger(true);
211             // photoelectricEffect->SetCutForLowEnSecElectrons(0.250 * keV);
212             // photoelectricEffect->SetCutForLowEnSecPhotons(0.250 * keV);
213             photoelectricEffect->SetEmModel(new G4LivermorePhotoElectricModel()); // Set the model (Livermore)
214             helper->RegisterProcess(photoelectricEffect, particle);
215 
216             // Compton scattering
217             auto *comptonScattering = new G4ComptonScattering();
218             comptonScattering->SetEmModel(new G4LivermoreComptonModel()); // Set the model (Livermore)
219             helper->RegisterProcess(comptonScattering, particle);
220 
221             // gamma conversion
222             auto *gammaConversion = new G4GammaConversion();
223             gammaConversion->SetEmModel(new G4LivermoreGammaConversionModel()); // Set the model (Livermore)
224             helper->RegisterProcess(gammaConversion, particle);
225 
226             // Rayleigh scattering
227             auto *rayleighScattering = new G4RayleighScattering();
228             rayleighScattering->SetEmModel(new G4LivermoreRayleighModel()); // Set the model (Livermore)
229             helper->RegisterProcess(rayleighScattering, particle);
230         } else if (particleName == "e-") { // electron
231             // multiple scattering
232             helper->RegisterProcess(new G4eMultipleScattering(), particle);
233 
234             // ionization
235             auto *ionization = new G4eIonisation();
236             ionization->SetEmModel(new G4LivermoreIonisationModel()); // Set the model (Livermore)
237             ionization->SetFluctModel(new G4UniversalFluctuation());
238             helper->RegisterProcess(ionization, particle);
239 
240             // Bremsstrahlung
241             auto *bremsstrahlung = new G4eBremsstrahlung();
242             bremsstrahlung->SetEmModel(new G4LivermoreBremsstrahlungModel()); // Set the model (Livermore)
243             helper->RegisterProcess(bremsstrahlung, particle);
244         } else if (particleName == "e+") { // positron
245             // multiple scattering
246             helper->RegisterProcess(new G4eMultipleScattering(), particle);
247 
248             // ionization
249             helper->RegisterProcess(new G4eIonisation(), particle);
250 
251             // Bremsstrahlung
252             auto *bremsstrahlung = new G4eBremsstrahlung();
253             bremsstrahlung->SetEmModel(new G4LivermoreBremsstrahlungModel()); // Set the model (Livermore)
254             helper->RegisterProcess(bremsstrahlung, particle);
255 
256             // annihilation
257             auto *annihilation = new G4eplusAnnihilation();
258             annihilation->SetEmModel(new G4PenelopeAnnihilationModel()); // Set the model (Penelope)
259             helper->RegisterProcess(annihilation, particle);
260         // } else if( particleName == "mu+" || particleName == "mu-") {
261             // // muon
262             // helper->RegisterProcess(new G4MuMultipleScattering, particle);
263             // helper->RegisterProcess(new G4MuIonisation, particle);
264             // helper->RegisterProcess(new G4MuBremsstrahlung, particle);
265             // helper->RegisterProcess(new G4MuPairProduction, particle);
266         } else if (particleName == "proton" || particleName == "pi-" || particleName == "pi+") {
267             helper->RegisterProcess(new G4hMultipleScattering(), particle);
268             helper->RegisterProcess(new G4hIonisation(), particle);
269 /*
270             // proton
271             // auto *ionization = new G4hImpactIonisation();
272             // ionization->SetPixeCrossSectionK("ecpssr");
273             // ionization->SetPixeCrossSectionL("ecpssr");
274             // ionization->SetPixeCrossSectionM("ecpssr");
275             // ionization->SetPixeProjectileMinEnergy(1.* keV);
276             // ionization->SetPixeProjectileMaxEnergy(200. * MeV);
277             // ionization->SetCutForSecondaryPhotons(250. * eV);
278             // ionization->SetCutForAugerElectrons(250. * eV);
279 
280             auto *ionization = new G4hIonisation();
281             auto *multipleScattering = new G4hMultipleScattering();
282 
283             processManager->AddProcess(multipleScattering, -1, 1, 1);
284             processManager->AddProcess(ionization, -1, 2, 2);
285 */
286         } else if (particleName == "alpha" || particleName == "He3" || particleName == "pi-" || particleName == "pi+" || particleName == "GenericIon") {
287             // pion, alpha, ion (should never occur in the current example)
288             helper->RegisterProcess(new G4hMultipleScattering, particle);
289             helper->RegisterProcess(new G4ionIonisation, particle);
290         } else if ((!particle->IsShortLived()) && (particle->GetPDGCharge() != 0.0) && (particle->GetParticleName() != "chargedgeantino")) {
291             // every other charged particle, except geantino
292             helper->RegisterProcess(new G4hMultipleScattering, particle);
293             helper->RegisterProcess(new G4hIonisation, particle);
294         }
295     }
296 }
297 
298 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
299 
300 void eRositaPhysicsList::ConstructGeneral()
301 {
302     auto *helper = G4PhysicsListHelper::GetPhysicsListHelper();
303 
304     // Add decay process
305     auto *decay = new G4Decay();
306 
307     auto particleIterator = GetParticleIterator();
308     particleIterator->reset();
309 
310     while ((*particleIterator)()) {
311         auto *particle = particleIterator->value();
312 
313         if (decay->IsApplicable(*particle)) {
314             if (verboseLevel > 1) {
315                 G4cout << "### Decays for " << particle->GetParticleName() << G4endl;
316             }
317             helper->RegisterProcess(decay, particle);
318 /*
319             // Set ordering for PostStepDoIt and AtRestDoIt
320             processManager->SetProcessOrdering(decay, idxPostStep);
321             processManager->SetProcessOrdering(decay, idxAtRest);
322 */
323         }
324     }
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
328 
329 void eRositaPhysicsList::ConstructProcess()
330 {
331     AddTransportation();
332     ConstructEM();
333     ConstructGeneral();
334     // AddStepMax();
335 }
336 
337 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
338 
339 void eRositaPhysicsList::SetCuts()
340 {
341     // Set the default cut value for all particle types
342     SetCutsWithDefault();
343 
344     // Set the secondary production cut lower than 990. eV. Very important for processes at low energies.        
345     constexpr auto ENERGY_LOW_LIMIT{250. * eV};
346     constexpr auto ENERGY_HIGH_LIMIT{100. * GeV};
347     
348     G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(ENERGY_LOW_LIMIT, ENERGY_HIGH_LIMIT);
349 
350     if (verboseLevel > 0) {
351         DumpCutValuesTable();
352     }
353 }
354 
355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
356 
357 /*
358 #include "G4StepLimiter.hh"
359 #include "G4UserSpecialCuts.hh"
360 
361 void eRositaPhysicsList::AddStepMax()
362 {
363     auto *helper = G4PhysicsListHelper::GetPhysicsListHelper();
364 
365     // Step limitation seen as a process
366     // auto *stepLimiter = new G4StepLimiter();
367     // // auto *userCuts = new G4UserSpecialCuts();
368 
369     particleIterator->reset();
370 
371     while ((*particleIterator)()){
372         auto *particle = particleIterator->value();
373         // auto *processManager = particle->GetProcessManager();
374 
375         if (particle->GetPDGCharge() != 0.0) {
376             helper->RegisterProcess(stepLimiter, particle);
377             // helper->RegisterProcess(userCuts, particle);
378         }
379     }
380 }
381 */
382