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 10.4.p3 ] [ 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 ]

Diff markup

Differences between /examples/advanced/xray_TESdetector/src/G4EmStandardPhysics_SpacePhysics.cc (Version 11.3.0) and /examples/advanced/xray_TESdetector/src/G4EmStandardPhysics_SpacePhysics.cc (Version 8.3)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 //--------------------------------------------    
 28 //                                                
 29 // Author: P.Dondero (paolo.dondero@cern.ch)      
 30 //                                                
 31 //....oooOO0OOooo........oooOO0OOooo........oo    
 32 //....oooOO0OOooo........oooOO0OOooo........oo    
 33                                                   
 34                                                   
 35 #include "G4EmStandardPhysics_SpacePhysics.hh"    
 36                                                   
 37 #include "G4SystemOfUnits.hh"                     
 38 #include "G4ParticleDefinition.hh"                
 39 #include "G4LossTableManager.hh"                  
 40 #include "G4EmParameters.hh"                      
 41 #include "G4EmBuilder.hh"                         
 42                                                   
 43 #include "G4ComptonScattering.hh"                 
 44 #include "G4GammaConversion.hh"                   
 45 #include "G4PhotoElectricEffect.hh"               
 46 #include "G4RayleighScattering.hh"                
 47 #include "G4PEEffectFluoModel.hh"                 
 48 #include "G4KleinNishinaModel.hh"                 
 49 #include "G4BetheHeitler5DModel.hh"               
 50 #include "G4LivermorePhotoElectricModel.hh"       
 51 #include "G4LivermorePolarizedRayleighModel.hh    
 52 #include "G4PhotoElectricAngularGeneratorPolar    
 53 #include "G4LowEPComptonModel.hh"                 
 54 #include "G4LowEPPolarizedComptonModel.hh"        
 55                                                   
 56 #include "G4eMultipleScattering.hh"               
 57 #include "G4hMultipleScattering.hh"               
 58 #include "G4MscStepLimitType.hh"                  
 59 #include "G4UrbanMscModel.hh"                     
 60 #include "G4GoudsmitSaundersonMscModel.hh"        
 61 #include "G4DummyModel.hh"                        
 62 #include "G4WentzelVIModel.hh"                    
 63 #include "G4CoulombScattering.hh"                 
 64 #include "G4eCoulombScatteringModel.hh"           
 65                                                   
 66 #include "G4eIonisation.hh"                       
 67 #include "G4eBremsstrahlung.hh"                   
 68 #include "G4Generator2BS.hh"                      
 69 #include "G4Generator2BN.hh"                      
 70 #include "G4SeltzerBergerModel.hh"                
 71 #include "G4ePairProduction.hh"                   
 72 #include "G4LivermoreIonisationModel.hh"          
 73 #include "G4PenelopeIonisationModel.hh"           
 74 #include "G4UniversalFluctuation.hh"              
 75 #include "G4UrbanFluctuation.hh"                  
 76                                                   
 77 #include "G4eplusAnnihilation.hh"                 
 78                                                   
 79 #include "G4hIonisation.hh"                       
 80 #include "G4ionIonisation.hh"                     
 81 #include "G4IonParametrisedLossModel.hh"          
 82 #include "G4NuclearStopping.hh"                   
 83                                                   
 84 #include "G4Gamma.hh"                             
 85 #include "G4Electron.hh"                          
 86 #include "G4Positron.hh"                          
 87 #include "G4GenericIon.hh"                        
 88                                                   
 89 #include "G4PhysicsListHelper.hh"                 
 90 #include "G4BuilderType.hh"                       
 91 #include "G4EmModelActivator.hh"                  
 92 #include "G4GammaGeneralProcess.hh"               
 93                                                   
 94 // factory                                        
 95 #include "G4PhysicsConstructorFactory.hh"         
 96 //                                                
 97 //....oooOO0OOooo........oooOO0OOooo........oo    
 98                                                   
 99 G4EmStandardPhysics_SpacePhysics::G4EmStandard    
100   : G4VPhysicsConstructor("G4EmStandard_SpaceP    
101 {                                                 
102   G4cout << "---> Using G4EmStandard_SpacePhys    
103   G4EmParameters* param = G4EmParameters::Inst    
104   param->SetDefaults();                           
105   param->SetVerbose(ver);                         
106   param->SetMinEnergy(100*CLHEP::eV);             
107   param->SetLowestElectronEnergy(50*CLHEP::eV)    
108   param->SetNumberOfBinsPerDecade(20);            
109   param->ActivateAngularGeneratorForIonisation    
110   param->SetStepFunction(0.2, 10*CLHEP::um);      
111   param->SetStepFunctionMuHad(0.05, 0.01*CLHEP    
112   param->SetStepFunctionLightIons(0.1, 20*CLHE    
113   param->SetStepFunctionIons(0.1, 1*CLHEP::um)    
114   param->SetUseMottCorrection(true); // use Mo    
115   param->SetMscStepLimitType(fUseSafetyPlus);     
116   param->SetMscSkin(3);              // error-    
117   param->SetMscRangeFactor(0.08);    // error-    
118   param->SetMuHadLateralDisplacement(true);       
119   param->SetFluo(true);                           
120   param->SetUseICRU90Data(true);                  
121   param->SetMaxNIELEnergy(1*CLHEP::MeV);          
122   SetPhysicsType(bElectromagnetic);               
123 }                                                 
124                                                   
125 //....oooOO0OOooo........oooOO0OOooo........oo    
126                                                   
127 void G4EmStandardPhysics_SpacePhysics::Constru    
128 {                                                 
129   // minimal set of particles for EM physics      
130   G4EmBuilder::ConstructMinimalEmSet();           
131 }                                                 
132                                                   
133 //....oooOO0OOooo........oooOO0OOooo........oo    
134                                                   
135 void G4EmStandardPhysics_SpacePhysics::Constru    
136 {                                                 
137   if(fVerbose > 1)                                
138   {                                               
139     G4cout << "### " << GetPhysicsName() << "     
140   }                                               
141   G4EmBuilder::PrepareEMPhysics();                
142                                                   
143   auto *ph = G4PhysicsListHelper::GetPhysicsLi    
144   auto *param = G4EmParameters::Instance();       
145                                                   
146   // processes used by several particles          
147   auto *hmsc = new G4hMultipleScattering("ionm    
148                                                   
149   // nuclear stopping is enabled if the energy    
150   G4double nielEnergyLimit = param->MaxNIELEne    
151   G4NuclearStopping* pnuc = nullptr;              
152   if(nielEnergyLimit > 0.0)                       
153   {                                               
154     pnuc = new G4NuclearStopping();               
155     pnuc->SetMaxKinEnergy(nielEnergyLimit);       
156   }                                               
157                                                   
158   // high energy limit for e+- scattering mode    
159   G4double highEnergyLimit = param->MscEnergyL    
160                                                   
161   // Add gamma EM Processes                       
162   G4ParticleDefinition *particle = G4Gamma::Ga    
163   G4bool polar = param->EnablePolarisation();     
164                                                   
165   // Photoelectric                                
166   auto *pe = new G4PhotoElectricEffect();         
167   auto *peModel = new G4LivermorePhotoElectric    
168   pe->SetEmModel(peModel);                        
169   if(polar)                                       
170   {                                               
171     peModel->SetAngularDistribution(new G4Phot    
172   }                                               
173                                                   
174   // Compton scattering                           
175   auto *cs = new G4ComptonScattering;             
176   cs->SetEmModel(new G4KleinNishinaModel());      
177   G4VEmModel* cModel = nullptr;                   
178   if(polar)                                       
179   {                                               
180     cModel = new G4LowEPPolarizedComptonModel(    
181   }                                               
182   else                                            
183   {                                               
184     cModel = new G4LowEPComptonModel();           
185   }                                               
186   cModel->SetHighEnergyLimit(20*CLHEP::MeV);      
187   cs->AddEmModel(0, cModel);                      
188                                                   
189   // Gamma conversion                             
190   auto *gc = new G4GammaConversion();             
191   auto *conv = new G4BetheHeitler5DModel();       
192   gc->SetEmModel(conv);                           
193                                                   
194   // default Rayleigh scattering is Livermore     
195   G4RayleighScattering* rl = new G4RayleighSca    
196   if(polar)                                       
197   {                                               
198     rl->SetEmModel(new G4LivermorePolarizedRay    
199   }                                               
200                                                   
201   if(param->GeneralProcessActive())               
202   {                                               
203     auto *sp = new G4GammaGeneralProcess();       
204     sp->AddEmProcess(pe);                         
205     sp->AddEmProcess(cs);                         
206     sp->AddEmProcess(gc);                         
207     sp->AddEmProcess(rl);                         
208     G4LossTableManager::Instance()->SetGammaGe    
209     ph->RegisterProcess(sp, particle);            
210   }                                               
211   else                                            
212   {                                               
213     ph->RegisterProcess(pe, particle);            
214     ph->RegisterProcess(cs, particle);            
215     ph->RegisterProcess(gc, particle);            
216     ph->RegisterProcess(rl, particle);            
217   }                                               
218                                                   
219   // e-                                           
220   particle = G4Electron::Electron();              
221                                                   
222   // multiple scattering                          
223   auto *msc = new G4eMultipleScattering();        
224   // e-/e+ msc gs with Mott-correction            
225   // (Mott-correction is set through G4EmParam    
226   auto *msc1 = new G4GoudsmitSaundersonMscMode    
227   auto *msc2 = new G4WentzelVIModel();            
228   msc1->SetHighEnergyLimit(highEnergyLimit);      
229   msc2->SetLowEnergyLimit(highEnergyLimit);       
230   msc->SetEmModel(msc1);                          
231   msc->SetEmModel(msc2);                          
232                                                   
233   auto *ssm = new G4eCoulombScatteringModel();    
234   G4CoulombScattering* ss = new G4CoulombScatt    
235   ss->SetEmModel(ssm);                            
236   ss->SetMinKinEnergy(highEnergyLimit);           
237   ssm->SetLowEnergyLimit(highEnergyLimit);        
238   ssm->SetActivationLowEnergyLimit(highEnergyL    
239                                                   
240   // ionisation                                   
241   auto *eioni = new G4eIonisation();              
242   G4VEmModel* theIoniLiv = new G4LivermoreIoni    
243   eioni->SetFluctModel(new G4UrbanFluctuation(    
244   theIoniLiv->SetHighEnergyLimit(0.1*CLHEP::Me    
245   eioni->AddEmModel(0, theIoniLiv, new G4Unive    
246                                                   
247   // bremsstrahlung                               
248   auto *brem = new G4eBremsstrahlung();           
249   auto *br1 = new G4SeltzerBergerModel();         
250   auto *br2 = new G4eBremsstrahlungRelModel();    
251   br1->SetAngularDistribution(new G4Generator2    
252   br2->SetAngularDistribution(new G4Generator2    
253   brem->SetEmModel(br1);                          
254   brem->SetEmModel(br2);                          
255   br1->SetHighEnergyLimit(CLHEP::GeV);            
256                                                   
257   auto *ee = new G4ePairProduction();             
258                                                   
259   // register processes                           
260   ph->RegisterProcess(msc, particle);             
261   ph->RegisterProcess(eioni, particle);           
262   ph->RegisterProcess(brem, particle);            
263   ph->RegisterProcess(ee, particle);              
264   ph->RegisterProcess(ss, particle);              
265                                                   
266   // e+                                           
267   particle = G4Positron::Positron();              
268                                                   
269   // multiple scattering                          
270   msc = new G4eMultipleScattering();              
271   // e-/e+ msc gs with Mott-correction            
272   // (Mott-correction is set through G4EmParam    
273   msc1 = new G4GoudsmitSaundersonMscModel();      
274   msc2 = new G4WentzelVIModel();                  
275   msc1->SetHighEnergyLimit(highEnergyLimit);      
276   msc2->SetLowEnergyLimit(highEnergyLimit);       
277   msc->SetEmModel(msc1);                          
278   msc->SetEmModel(msc2);                          
279                                                   
280   ssm = new G4eCoulombScatteringModel();          
281   ss = new G4CoulombScattering();                 
282   ss->SetEmModel(ssm);                            
283   ss->SetMinKinEnergy(highEnergyLimit);           
284   ssm->SetLowEnergyLimit(highEnergyLimit);        
285   ssm->SetActivationLowEnergyLimit(highEnergyL    
286                                                   
287   // ionisation                                   
288   eioni = new G4eIonisation();                    
289   eioni->SetFluctModel(new G4UrbanFluctuation(    
290   auto *pen = new G4PenelopeIonisationModel();    
291   pen->SetHighEnergyLimit(0.1*CLHEP::MeV);        
292   eioni->AddEmModel(0, pen, new G4UniversalFlu    
293                                                   
294   // bremsstrahlung                               
295   brem = new G4eBremsstrahlung();                 
296   br1 = new G4SeltzerBergerModel();               
297   br2 = new G4eBremsstrahlungRelModel();          
298   br1->SetAngularDistribution(new G4Generator2    
299   br2->SetAngularDistribution(new G4Generator2    
300   brem->SetEmModel(br1);                          
301   brem->SetEmModel(br2);                          
302   br1->SetHighEnergyLimit(CLHEP::GeV);            
303                                                   
304   // register processes                           
305   ph->RegisterProcess(msc, particle);             
306   ph->RegisterProcess(eioni, particle);           
307   ph->RegisterProcess(brem, particle);            
308   ph->RegisterProcess(ee, particle);              
309   ph->RegisterProcess(new G4eplusAnnihilation(    
310   ph->RegisterProcess(ss, particle);              
311                                                   
312   // generic ion                                  
313   particle = G4GenericIon::GenericIon();          
314   auto *ionIoni = new G4ionIonisation();          
315   ionIoni->SetEmModel(new G4IonParametrisedLos    
316   ph->RegisterProcess(hmsc, particle);            
317   ph->RegisterProcess(ionIoni, particle);         
318   if(nullptr != pnuc) { ph->RegisterProcess(pn    
319                                                   
320   // muons, hadrons, ions                         
321   G4EmBuilder::ConstructCharged(hmsc, pnuc);      
322                                                   
323   // extra configuration                          
324   G4EmModelActivator mact(GetPhysicsName());      
325 }                                                 
326                                                   
327 //....oooOO0OOooo........oooOO0OOooo........oo    
328