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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 ]

Diff markup

Differences between /examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm15/src/PhysicsList.cc (Version 6.2)


  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 /// \file electromagnetic/TestEm15/src/Physics    
 27 /// \brief Implementation of the PhysicsList c    
 28 //                                                
 29 //                                                
 30 //                                                
 31 //....oooOO0OOooo........oooOO0OOooo........oo    
 32 //....oooOO0OOooo........oooOO0OOooo........oo    
 33                                                   
 34 #include "PhysicsList.hh"                         
 35                                                   
 36 #include "PhysListEmStandard.hh"                  
 37 #include "PhysicsListMessenger.hh"                
 38                                                   
 39 #include "G4EmStandardPhysicsGS.hh"               
 40 #include "G4EmStandardPhysicsSS.hh"               
 41 #include "G4EmStandardPhysicsWVI.hh"              
 42 #include "G4EmStandardPhysics_option3.hh"         
 43 #include "G4EmStandardPhysics_option4.hh"         
 44 #include "G4LossTableManager.hh"                  
 45 #include "G4SystemOfUnits.hh"                     
 46 #include "G4UnitsTable.hh"                        
 47                                                   
 48 // Bosons                                         
 49 #include "G4ChargedGeantino.hh"                   
 50 #include "G4Gamma.hh"                             
 51 #include "G4Geantino.hh"                          
 52 #include "G4OpticalPhoton.hh"                     
 53                                                   
 54 // leptons                                        
 55 #include "G4AntiNeutrinoE.hh"                     
 56 #include "G4AntiNeutrinoMu.hh"                    
 57 #include "G4Electron.hh"                          
 58 #include "G4MuonMinus.hh"                         
 59 #include "G4MuonPlus.hh"                          
 60 #include "G4NeutrinoE.hh"                         
 61 #include "G4NeutrinoMu.hh"                        
 62 #include "G4Positron.hh"                          
 63                                                   
 64 // Mesons                                         
 65 #include "G4AntiKaonZero.hh"                      
 66 #include "G4Eta.hh"                               
 67 #include "G4EtaPrime.hh"                          
 68 #include "G4KaonMinus.hh"                         
 69 #include "G4KaonPlus.hh"                          
 70 #include "G4KaonZero.hh"                          
 71 #include "G4KaonZeroLong.hh"                      
 72 #include "G4KaonZeroShort.hh"                     
 73 #include "G4PionMinus.hh"                         
 74 #include "G4PionPlus.hh"                          
 75 #include "G4PionZero.hh"                          
 76                                                   
 77 // Baryons                                        
 78 #include "G4AntiNeutron.hh"                       
 79 #include "G4AntiProton.hh"                        
 80 #include "G4Neutron.hh"                           
 81 #include "G4Proton.hh"                            
 82                                                   
 83 // Nuclei                                         
 84 #include "StepMax.hh"                             
 85                                                   
 86 #include "G4Alpha.hh"                             
 87 #include "G4Deuteron.hh"                          
 88 #include "G4GenericIon.hh"                        
 89 #include "G4ProcessManager.hh"                    
 90 #include "G4Triton.hh"                            
 91                                                   
 92 //....oooOO0OOooo........oooOO0OOooo........oo    
 93                                                   
 94 PhysicsList::PhysicsList() : G4VModularPhysics    
 95 {                                                 
 96   G4LossTableManager::Instance();                 
 97   SetDefaultCutValue(1 * mm);                     
 98                                                   
 99   fMessenger = new PhysicsListMessenger(this);    
100                                                   
101   SetVerboseLevel(1);                             
102                                                   
103   // EM physics                                   
104   fEmName = G4String("local");                    
105   fEmPhysicsList = new PhysListEmStandard(fEmN    
106 }                                                 
107                                                   
108 //....oooOO0OOooo........oooOO0OOooo........oo    
109                                                   
110 PhysicsList::~PhysicsList()                       
111 {                                                 
112   delete fMessenger;                              
113 }                                                 
114                                                   
115 //....oooOO0OOooo........oooOO0OOooo........oo    
116                                                   
117 void PhysicsList::ConstructParticle()             
118 {                                                 
119   // pseudo-particles                             
120   G4Geantino::GeantinoDefinition();               
121   G4ChargedGeantino::ChargedGeantinoDefinition    
122                                                   
123   // gamma                                        
124   G4Gamma::GammaDefinition();                     
125                                                   
126   // optical photon                               
127   G4OpticalPhoton::OpticalPhotonDefinition();     
128                                                   
129   // leptons                                      
130   G4Electron::ElectronDefinition();               
131   G4Positron::PositronDefinition();               
132   G4MuonPlus::MuonPlusDefinition();               
133   G4MuonMinus::MuonMinusDefinition();             
134                                                   
135   G4NeutrinoE::NeutrinoEDefinition();             
136   G4AntiNeutrinoE::AntiNeutrinoEDefinition();     
137   G4NeutrinoMu::NeutrinoMuDefinition();           
138   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition()    
139                                                   
140   // mesons                                       
141   G4PionPlus::PionPlusDefinition();               
142   G4PionMinus::PionMinusDefinition();             
143   G4PionZero::PionZeroDefinition();               
144   G4Eta::EtaDefinition();                         
145   G4EtaPrime::EtaPrimeDefinition();               
146   G4KaonPlus::KaonPlusDefinition();               
147   G4KaonMinus::KaonMinusDefinition();             
148   G4KaonZero::KaonZeroDefinition();               
149   G4AntiKaonZero::AntiKaonZeroDefinition();       
150   G4KaonZeroLong::KaonZeroLongDefinition();       
151   G4KaonZeroShort::KaonZeroShortDefinition();     
152                                                   
153   // barions                                      
154   G4Proton::ProtonDefinition();                   
155   G4AntiProton::AntiProtonDefinition();           
156   G4Neutron::NeutronDefinition();                 
157   G4AntiNeutron::AntiNeutronDefinition();         
158                                                   
159   // ions                                         
160   G4Deuteron::DeuteronDefinition();               
161   G4Triton::TritonDefinition();                   
162   G4Alpha::AlphaDefinition();                     
163   G4GenericIon::GenericIonDefinition();           
164 }                                                 
165                                                   
166 //....oooOO0OOooo........oooOO0OOooo........oo    
167                                                   
168 void PhysicsList::ConstructProcess()              
169 {                                                 
170   // Transportation                               
171   //                                              
172   AddTransportation();                            
173                                                   
174   // Electromagnetic physics list                 
175   //                                              
176   fEmPhysicsList->ConstructProcess();             
177                                                   
178   // Em options                                   
179   //                                              
180   G4EmParameters* param = G4EmParameters::Inst    
181   param->SetIntegral(false);                      
182   param->SetStepFunction(1., 1 * mm);             
183   param->SetLossFluctuations(false);              
184                                                   
185   // step limitation (as a full process)          
186   //                                              
187   AddStepMax();                                   
188 }                                                 
189                                                   
190 //....oooOO0OOooo........oooOO0OOooo........oo    
191                                                   
192 void PhysicsList::AddPhysicsList(const G4Strin    
193 {                                                 
194   if (verboseLevel > 0) {                         
195     G4cout << "PhysicsList::AddPhysicsList: <"    
196   }                                               
197                                                   
198   if (name == fEmName) return;                    
199                                                   
200   if (name == "local") {                          
201     fEmName = name;                               
202     delete fEmPhysicsList;                        
203     fEmPhysicsList = new PhysListEmStandard(na    
204   }                                               
205   else if (name == "emstandard_opt3") {           
206     fEmName = name;                               
207     delete fEmPhysicsList;                        
208     fEmPhysicsList = new G4EmStandardPhysics_o    
209   }                                               
210   else if (name == "emstandard_opt4") {           
211     fEmName = name;                               
212     delete fEmPhysicsList;                        
213     fEmPhysicsList = new G4EmStandardPhysics_o    
214   }                                               
215   else if (name == "emstandardSS") {              
216     fEmName = name;                               
217     delete fEmPhysicsList;                        
218     fEmPhysicsList = new G4EmStandardPhysicsSS    
219   }                                               
220   else if (name == "emstandardWVI") {             
221     fEmName = name;                               
222     delete fEmPhysicsList;                        
223     fEmPhysicsList = new G4EmStandardPhysicsWV    
224   }                                               
225   else if (name == "emstandardGS") {              
226     fEmName = name;                               
227     delete fEmPhysicsList;                        
228     fEmPhysicsList = new G4EmStandardPhysicsGS    
229   }                                               
230   else {                                          
231     G4cout << "PhysicsList::AddPhysicsList: <"    
232            << " is not defined" << G4endl;        
233   }                                               
234 }                                                 
235                                                   
236 //....oooOO0OOooo........oooOO0OOooo........oo    
237                                                   
238 void PhysicsList::AddStepMax()                    
239 {                                                 
240   // Step limitation seen as a process            
241   StepMax* stepMaxProcess = new StepMax();        
242                                                   
243   auto particleIterator = GetParticleIterator(    
244   particleIterator->reset();                      
245   while ((*particleIterator)()) {                 
246     G4ParticleDefinition* particle = particleI    
247     G4ProcessManager* pmanager = particle->Get    
248                                                   
249     if (stepMaxProcess->IsApplicable(*particle    
250       pmanager->AddDiscreteProcess(stepMaxProc    
251     }                                             
252   }                                               
253 }                                                 
254                                                   
255 //....oooOO0OOooo........oooOO0OOooo........oo    
256