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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/TestEm12/src/PhysicsList.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm12/src/PhysicsList.cc (Version 4.1.p1)


  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/TestEm12/src/Physics    
 27 /// \brief Implementation of the PhysicsList c    
 28 //                                                
 29 //                                                
 30 //....oooOO0OOooo........oooOO0OOooo........oo    
 31 //....oooOO0OOooo........oooOO0OOooo........oo    
 32                                                   
 33 #include "PhysicsList.hh"                         
 34                                                   
 35 #include "PhysListEmStandard.hh"                  
 36 #include "PhysListEmStandardSSM.hh"               
 37 #include "PhysicsListMessenger.hh"                
 38                                                   
 39 #include "G4EmDNAPhysics.hh"                      
 40 #include "G4EmDNAPhysics_option1.hh"              
 41 #include "G4EmDNAPhysics_option2.hh"              
 42 #include "G4EmDNAPhysics_option3.hh"              
 43 #include "G4EmDNAPhysics_option4.hh"              
 44 #include "G4EmDNAPhysics_option5.hh"              
 45 #include "G4EmDNAPhysics_option6.hh"              
 46 #include "G4EmDNAPhysics_option7.hh"              
 47 #include "G4EmLivermorePhysics.hh"                
 48 #include "G4EmLowEPPhysics.hh"                    
 49 #include "G4EmPenelopePhysics.hh"                 
 50 #include "G4EmStandardPhysics.hh"                 
 51 #include "G4EmStandardPhysicsGS.hh"               
 52 #include "G4EmStandardPhysicsSS.hh"               
 53 #include "G4EmStandardPhysicsWVI.hh"              
 54 #include "G4EmStandardPhysics_option1.hh"         
 55 #include "G4EmStandardPhysics_option2.hh"         
 56 #include "G4EmStandardPhysics_option3.hh"         
 57 #include "G4EmStandardPhysics_option4.hh"         
 58 #include "G4LossTableManager.hh"                  
 59 #include "G4SystemOfUnits.hh"                     
 60 #include "G4UnitsTable.hh"                        
 61                                                   
 62 // particles                                      
 63                                                   
 64 #include "G4BaryonConstructor.hh"                 
 65 #include "G4BosonConstructor.hh"                  
 66 #include "G4DNAGenericIonsManager.hh"             
 67 #include "G4IonConstructor.hh"                    
 68 #include "G4LeptonConstructor.hh"                 
 69 #include "G4MesonConstructor.hh"                  
 70 #include "G4ShortLivedConstructor.hh"             
 71                                                   
 72 G4ThreadLocal StepMax* PhysicsList::fStepMaxPr    
 73                                                   
 74 //....oooOO0OOooo........oooOO0OOooo........oo    
 75                                                   
 76 PhysicsList::PhysicsList()                        
 77 {                                                 
 78   fMessenger = new PhysicsListMessenger(this);    
 79                                                   
 80   SetVerboseLevel(1);                             
 81                                                   
 82   // EM physics                                   
 83   fEmPhysicsList = new PhysListEmStandard(fEmN    
 84                                                   
 85   // Em options                                   
 86   //                                              
 87   G4EmParameters::Instance()->SetBuildCSDARang    
 88                                                   
 89   SetDefaultCutValue(1. * mm);                    
 90 }                                                 
 91                                                   
 92 //....oooOO0OOooo........oooOO0OOooo........oo    
 93                                                   
 94 PhysicsList::~PhysicsList()                       
 95 {                                                 
 96   delete fMessenger;                              
 97   delete fEmPhysicsList;                          
 98 }                                                 
 99                                                   
100 //....oooOO0OOooo........oooOO0OOooo........oo    
101                                                   
102 void PhysicsList::ConstructParticle()             
103 {                                                 
104   G4BosonConstructor pBosonConstructor;           
105   pBosonConstructor.ConstructParticle();          
106                                                   
107   G4LeptonConstructor pLeptonConstructor;         
108   pLeptonConstructor.ConstructParticle();         
109                                                   
110   G4MesonConstructor pMesonConstructor;           
111   pMesonConstructor.ConstructParticle();          
112                                                   
113   G4BaryonConstructor pBaryonConstructor;         
114   pBaryonConstructor.ConstructParticle();         
115                                                   
116   G4IonConstructor pIonConstructor;               
117   pIonConstructor.ConstructParticle();            
118                                                   
119   G4ShortLivedConstructor pShortLivedConstruct    
120   pShortLivedConstructor.ConstructParticle();     
121                                                   
122   // DNA                                          
123   G4DNAGenericIonsManager* genericIonsManager;    
124   genericIonsManager = G4DNAGenericIonsManager    
125   genericIonsManager->GetIon("alpha++");          
126   genericIonsManager->GetIon("alpha+");           
127   genericIonsManager->GetIon("helium");           
128   genericIonsManager->GetIon("hydrogen");         
129 }                                                 
130                                                   
131 //....oooOO0OOooo........oooOO0OOooo........oo    
132                                                   
133 #include "G4ProcessManager.hh"                    
134                                                   
135 void PhysicsList::ConstructProcess()              
136 {                                                 
137   // transportation                               
138   //                                              
139   AddTransportation();                            
140                                                   
141   // electromagnetic physics list                 
142   //                                              
143   fEmPhysicsList->ConstructProcess();             
144                                                   
145   // decay process                                
146   //                                              
147   AddDecay();                                     
148                                                   
149   // step limitation (as a full process)          
150   //                                              
151   AddStepMax();                                   
152 }                                                 
153                                                   
154 //....oooOO0OOooo........oooOO0OOooo........oo    
155                                                   
156 void PhysicsList::AddPhysicsList(const G4Strin    
157 {                                                 
158   if (verboseLevel > -1) {                        
159     G4cout << "PhysicsList::AddPhysicsList: <"    
160   }                                               
161                                                   
162   if (name == fEmName) return;                    
163                                                   
164   if (name == "local") {                          
165     fEmName = name;                               
166     delete fEmPhysicsList;                        
167     fEmPhysicsList = new PhysListEmStandard(na    
168   }                                               
169   else if (name == "emstandard_opt0") {           
170     fEmName = name;                               
171     delete fEmPhysicsList;                        
172     fEmPhysicsList = new G4EmStandardPhysics()    
173   }                                               
174   else if (name == "emstandard_opt1") {           
175     fEmName = name;                               
176     delete fEmPhysicsList;                        
177     fEmPhysicsList = new G4EmStandardPhysics_o    
178   }                                               
179   else if (name == "emstandard_opt2") {           
180     fEmName = name;                               
181     delete fEmPhysicsList;                        
182     fEmPhysicsList = new G4EmStandardPhysics_o    
183   }                                               
184   else if (name == "emstandard_opt3") {           
185     fEmName = name;                               
186     delete fEmPhysicsList;                        
187     fEmPhysicsList = new G4EmStandardPhysics_o    
188   }                                               
189   else if (name == "emstandard_opt4") {           
190     fEmName = name;                               
191     delete fEmPhysicsList;                        
192     fEmPhysicsList = new G4EmStandardPhysics_o    
193   }                                               
194   else if (name == "emstandardSS") {              
195     fEmName = name;                               
196     delete fEmPhysicsList;                        
197     fEmPhysicsList = new G4EmStandardPhysicsSS    
198   }                                               
199   else if (name == "standardSSM") {               
200     fEmName = name;                               
201     delete fEmPhysicsList;                        
202     fEmPhysicsList = new PhysListEmStandardSSM    
203   }                                               
204   else if (name == "emstandardWVI") {             
205     fEmName = name;                               
206     delete fEmPhysicsList;                        
207     fEmPhysicsList = new G4EmStandardPhysicsWV    
208   }                                               
209   else if (name == "standardGS") {                
210     fEmName = name;                               
211     delete fEmPhysicsList;                        
212     fEmPhysicsList = new G4EmStandardPhysicsGS    
213   }                                               
214   else if (name == "emlivermore") {               
215     fEmName = name;                               
216     delete fEmPhysicsList;                        
217     fEmPhysicsList = new G4EmLivermorePhysics(    
218   }                                               
219   else if (name == "empenelope") {                
220     fEmName = name;                               
221     delete fEmPhysicsList;                        
222     fEmPhysicsList = new G4EmPenelopePhysics()    
223   }                                               
224   else if (name == "emlowenergy") {               
225     fEmName = name;                               
226     delete fEmPhysicsList;                        
227     fEmPhysicsList = new G4EmLowEPPhysics();      
228   }                                               
229   else if (name == "dna") {                       
230     fEmName = name;                               
231     delete fEmPhysicsList;                        
232     fEmPhysicsList = new G4EmDNAPhysics();        
233   }                                               
234   else if (name == "dna_opt1") {                  
235     fEmName = name;                               
236     delete fEmPhysicsList;                        
237     fEmPhysicsList = new G4EmDNAPhysics_option    
238   }                                               
239   else if (name == "dna_opt2") {                  
240     fEmName = name;                               
241     delete fEmPhysicsList;                        
242     fEmPhysicsList = new G4EmDNAPhysics_option    
243   }                                               
244   else if (name == "dna_opt3") {                  
245     fEmName = name;                               
246     delete fEmPhysicsList;                        
247     fEmPhysicsList = new G4EmDNAPhysics_option    
248   }                                               
249   else if (name == "dna_opt4") {                  
250     fEmName = name;                               
251     delete fEmPhysicsList;                        
252     fEmPhysicsList = new G4EmDNAPhysics_option    
253   }                                               
254   else if (name == "dna_opt5") {                  
255     fEmName = name;                               
256     delete fEmPhysicsList;                        
257     fEmPhysicsList = new G4EmDNAPhysics_option    
258   }                                               
259   else if (name == "dna_opt6") {                  
260     fEmName = name;                               
261     delete fEmPhysicsList;                        
262     fEmPhysicsList = new G4EmDNAPhysics_option    
263   }                                               
264   else if (name == "dna_opt7") {                  
265     fEmName = name;                               
266     delete fEmPhysicsList;                        
267     fEmPhysicsList = new G4EmDNAPhysics_option    
268   }                                               
269   else {                                          
270     G4cout << "PhysicsList::AddPhysicsList: <"    
271            << " is not defined" << G4endl;        
272   }                                               
273   G4EmParameters::Instance()->SetBuildCSDARang    
274 }                                                 
275                                                   
276 //....oooOO0OOooo........oooOO0OOooo........oo    
277                                                   
278 #include "G4Decay.hh"                             
279                                                   
280 void PhysicsList::AddDecay()                      
281 {                                                 
282   // decay process                                
283   //                                              
284   G4Decay* fDecayProcess = new G4Decay();         
285                                                   
286   auto particleIterator = GetParticleIterator(    
287   particleIterator->reset();                      
288   while ((*particleIterator)()) {                 
289     G4ParticleDefinition* particle = particleI    
290     G4ProcessManager* pmanager = particle->Get    
291                                                   
292     if (fDecayProcess->IsApplicable(*particle)    
293       pmanager->AddProcess(fDecayProcess);        
294                                                   
295       // set ordering for PostStepDoIt and AtR    
296       pmanager->SetProcessOrdering(fDecayProce    
297       pmanager->SetProcessOrdering(fDecayProce    
298     }                                             
299   }                                               
300 }                                                 
301                                                   
302 //....oooOO0OOooo........oooOO0OOooo........oo    
303                                                   
304 #include "StepMax.hh"                             
305                                                   
306 void PhysicsList::AddStepMax()                    
307 {                                                 
308   // Step limitation seen as a process            
309   fStepMaxProcess = new StepMax();                
310                                                   
311   auto particleIterator = GetParticleIterator(    
312   particleIterator->reset();                      
313   while ((*particleIterator)()) {                 
314     G4ParticleDefinition* particle = particleI    
315     G4ProcessManager* pmanager = particle->Get    
316                                                   
317     if (fStepMaxProcess->IsApplicable(*particl    
318       pmanager->AddDiscreteProcess(fStepMaxPro    
319     }                                             
320   }                                               
321 }                                                 
322                                                   
323 //....oooOO0OOooo........oooOO0OOooo........oo    
324