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


  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/TestEm7/src/PhysicsL    
 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 "PhysListEmStandardNR.hh"                
 37 #include "PhysicsListMessenger.hh"                
 38 #include "StepMax.hh"                             
 39                                                   
 40 #include "G4BetheBlochIonGasModel.hh"             
 41 #include "G4BraggIonGasModel.hh"                  
 42 #include "G4Decay.hh"                             
 43 #include "G4DecayPhysics.hh"                      
 44 #include "G4EmConfigurator.hh"                    
 45 #include "G4EmLivermorePhysics.hh"                
 46 #include "G4EmLowEPPhysics.hh"                    
 47 #include "G4EmPenelopePhysics.hh"                 
 48 #include "G4EmStandardPhysics.hh"                 
 49 #include "G4EmStandardPhysicsGS.hh"               
 50 #include "G4EmStandardPhysicsSS.hh"               
 51 #include "G4EmStandardPhysicsWVI.hh"              
 52 #include "G4EmStandardPhysics_option1.hh"         
 53 #include "G4EmStandardPhysics_option2.hh"         
 54 #include "G4EmStandardPhysics_option3.hh"         
 55 #include "G4EmStandardPhysics_option4.hh"         
 56 #include "G4HadronDElasticPhysics.hh"             
 57 #include "G4HadronElasticPhysics.hh"              
 58 #include "G4HadronHElasticPhysics.hh"             
 59 #include "G4HadronInelasticQBBC.hh"               
 60 #include "G4IonFluctuations.hh"                   
 61 #include "G4IonParametrisedLossModel.hh"          
 62 #include "G4IonPhysics.hh"                        
 63 #include "G4LossTableManager.hh"                  
 64 #include "G4PhysicalConstants.hh"                 
 65 #include "G4ProcessManager.hh"                    
 66 #include "G4SystemOfUnits.hh"                     
 67 #include "G4UnitsTable.hh"                        
 68 #include "G4UniversalFluctuation.hh"              
 69                                                   
 70 //....oooOO0OOooo........oooOO0OOooo........oo    
 71                                                   
 72 PhysicsList::PhysicsList() : G4VModularPhysics    
 73 {                                                 
 74   fHelIsRegisted = false;                         
 75   fBicIsRegisted = false;                         
 76   fBiciIsRegisted = false;                        
 77                                                   
 78   // protected member of the base class           
 79   verboseLevel = 1;                               
 80                                                   
 81   fMessenger = new PhysicsListMessenger(this);    
 82                                                   
 83   // EM physics                                   
 84   fEmName = G4String("emstandard_opt0");          
 85   fEmPhysicsList = new G4EmStandardPhysics(ver    
 86                                                   
 87   // Deacy physics and all particles              
 88   fDecPhysicsList = new G4DecayPhysics(verbose    
 89 }                                                 
 90                                                   
 91 //....oooOO0OOooo........oooOO0OOooo........oo    
 92                                                   
 93 PhysicsList::~PhysicsList()                       
 94 {                                                 
 95   delete fMessenger;                              
 96   delete fEmPhysicsList;                          
 97   delete fDecPhysicsList;                         
 98   for (size_t i = 0; i < fHadronPhys.size(); i    
 99     delete fHadronPhys[i];                        
100   }                                               
101 }                                                 
102                                                   
103 //....oooOO0OOooo........oooOO0OOooo........oo    
104                                                   
105 void PhysicsList::ConstructParticle()             
106 {                                                 
107   fDecPhysicsList->ConstructParticle();           
108 }                                                 
109                                                   
110 //....oooOO0OOooo........oooOO0OOooo........oo    
111                                                   
112 void PhysicsList::ConstructProcess()              
113 {                                                 
114   // transportation                               
115   //                                              
116   AddTransportation();                            
117                                                   
118   // electromagnetic physics list                 
119   //                                              
120   fEmPhysicsList->ConstructProcess();             
121                                                   
122   // decay physics list                           
123   //                                              
124   fDecPhysicsList->ConstructProcess();            
125                                                   
126   // hadronic physics lists                       
127   for (size_t i = 0; i < fHadronPhys.size(); i    
128     fHadronPhys[i]->ConstructProcess();           
129   }                                               
130                                                   
131   // step limitation (as a full process)          
132   //                                              
133   AddStepMax();                                   
134 }                                                 
135                                                   
136 //....oooOO0OOooo........oooOO0OOooo........oo    
137                                                   
138 void PhysicsList::AddPhysicsList(const G4Strin    
139 {                                                 
140   if (verboseLevel > 1) {                         
141     G4cout << "PhysicsList::AddPhysicsList: <"    
142   }                                               
143                                                   
144   if (name == fEmName) return;                    
145                                                   
146   if (name == "local") {                          
147     fEmName = name;                               
148     delete fEmPhysicsList;                        
149     fEmPhysicsList = new PhysListEmStandard(na    
150   }                                               
151   else if (name == "emstandard_opt0") {           
152     fEmName = name;                               
153     delete fEmPhysicsList;                        
154     fEmPhysicsList = new G4EmStandardPhysics(v    
155   }                                               
156   else if (name == "emstandard_opt1") {           
157     fEmName = name;                               
158     delete fEmPhysicsList;                        
159     fEmPhysicsList = new G4EmStandardPhysics_o    
160   }                                               
161   else if (name == "emstandard_opt2") {           
162     fEmName = name;                               
163     delete fEmPhysicsList;                        
164     fEmPhysicsList = new G4EmStandardPhysics_o    
165   }                                               
166   else if (name == "emstandard_opt3") {           
167     fEmName = name;                               
168     delete fEmPhysicsList;                        
169     fEmPhysicsList = new G4EmStandardPhysics_o    
170   }                                               
171   else if (name == "emstandard_opt4") {           
172     fEmName = name;                               
173     delete fEmPhysicsList;                        
174     fEmPhysicsList = new G4EmStandardPhysics_o    
175   }                                               
176   else if (name == "ionGasModels") {              
177     AddPhysicsList("emstandard_opt0");            
178     fEmName = name;                               
179     AddIonGasModels();                            
180   }                                               
181   else if (name == "standardNR") {                
182     fEmName = name;                               
183     delete fEmPhysicsList;                        
184     fEmPhysicsList = new PhysListEmStandardNR(    
185   }                                               
186   else if (name == "emlivermore") {               
187     fEmName = name;                               
188     delete fEmPhysicsList;                        
189     fEmPhysicsList = new G4EmLivermorePhysics(    
190   }                                               
191   else if (name == "empenelope") {                
192     fEmName = name;                               
193     delete fEmPhysicsList;                        
194     fEmPhysicsList = new G4EmPenelopePhysics(v    
195   }                                               
196   else if (name == "emlowenergy") {               
197     fEmName = name;                               
198     delete fEmPhysicsList;                        
199     fEmPhysicsList = new G4EmLowEPPhysics(verb    
200   }                                               
201   else if (name == "emstandardSS") {              
202     fEmName = name;                               
203     delete fEmPhysicsList;                        
204     fEmPhysicsList = new G4EmStandardPhysicsSS    
205   }                                               
206   else if (name == "emstandardWVI") {             
207     fEmName = name;                               
208     delete fEmPhysicsList;                        
209     fEmPhysicsList = new G4EmStandardPhysicsWV    
210   }                                               
211   else if (name == "emstandardGS") {              
212     fEmName = name;                               
213     delete fEmPhysicsList;                        
214     fEmPhysicsList = new G4EmStandardPhysicsGS    
215   }                                               
216   else if (name == "elastic" && !fHelIsRegiste    
217     fHadronPhys.push_back(new G4HadronElasticP    
218     fHelIsRegisted = true;                        
219   }                                               
220   else if (name == "DElastic" && !fHelIsRegist    
221     fHadronPhys.push_back(new G4HadronDElastic    
222     fHelIsRegisted = true;                        
223   }                                               
224   else if (name == "HElastic" && !fHelIsRegist    
225     fHadronPhys.push_back(new G4HadronHElastic    
226     fHelIsRegisted = true;                        
227   }                                               
228   else if (name == "binary" && !fBicIsRegisted    
229     fHadronPhys.push_back(new G4HadronInelasti    
230     fBicIsRegisted = true;                        
231   }                                               
232   else if (name == "binary_ion" && !fBiciIsReg    
233     fHadronPhys.push_back(new G4IonPhysics(ver    
234     fBiciIsRegisted = true;                       
235   }                                               
236   else {                                          
237     G4cout << "PhysicsList::AddPhysicsList: <"    
238            << " is not defined" << G4endl;        
239   }                                               
240 }                                                 
241                                                   
242 //....oooOO0OOooo........oooOO0OOooo........oo    
243                                                   
244 void PhysicsList::AddStepMax()                    
245 {                                                 
246   // Step limitation seen as a process            
247   fStepMaxProcess = new StepMax();                
248                                                   
249   auto particleIterator = GetParticleIterator(    
250   particleIterator->reset();                      
251   while ((*particleIterator)()) {                 
252     G4ParticleDefinition* particle = particleI    
253     G4ProcessManager* pmanager = particle->Get    
254                                                   
255     if (fStepMaxProcess->IsApplicable(*particl    
256       pmanager->AddDiscreteProcess(fStepMaxPro    
257     }                                             
258   }                                               
259 }                                                 
260                                                   
261 //....oooOO0OOooo........oooOO0OOooo........oo    
262                                                   
263 void PhysicsList::AddIonGasModels()               
264 {                                                 
265   G4EmConfigurator* em_config = G4LossTableMan    
266   auto particleIterator = GetParticleIterator(    
267   particleIterator->reset();                      
268   while ((*particleIterator)()) {                 
269     G4ParticleDefinition* particle = particleI    
270     G4String partname = particle->GetParticleN    
271     if (partname == "alpha" || partname == "He    
272       G4BraggIonGasModel* mod1 = new G4BraggIo    
273       G4BetheBlochIonGasModel* mod2 = new G4Be    
274       G4double eth = 2. * MeV * particle->GetP    
275       em_config->SetExtraEmModel(partname, "io    
276       em_config->SetExtraEmModel(partname, "io    
277                                  new G4Univers    
278     }                                             
279   }                                               
280 }                                                 
281                                                   
282 //....oooOO0OOooo........oooOO0OOooo........oo    
283