Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/physics_lists/lists/src/LBE.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 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 /physics_lists/lists/src/LBE.cc (Version 11.3.0) and /physics_lists/lists/src/LBE.cc (Version 10.3.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 //                                                
 27 // -------------------------------------------    
 28 //                                                
 29 //      For information related to this code c    
 30 //      e-mail: alexander.howard@cern.ch          
 31 // -------------------------------------------    
 32 // Comments                                       
 33 //                                                
 34 //                  Underground Advanced          
 35 //                                                
 36 // This physics list is taken from the undergr    
 37 // modifications.  It is an example of a "flat    
 38 // on builders.  The physics covered would be     
 39 // experiment including the neutron_hp package    
 40 //                                                
 41 //                                                
 42 //                                                
 43 // PhysicsList program                            
 44 //                                                
 45 // Modified:                                      
 46 //                                                
 47 // 14-02-03 Fix bugs in msc and hIon instancia    
 48 // 16-08-10 Remove inclusion of obsolete class    
 49 // 20-10-10 Migrate LowEnergy process to Liver    
 50 // 28-03-13 Replace LEP/HEP with FTFP+BERT (A.    
 51 // 15-01-20 Updated cross sections (A.R.)         
 52 // -------------------------------------------    
 53                                                   
 54 #include <iomanip>                                
 55                                                   
 56 #include "globals.hh"                             
 57 #include <CLHEP/Units/SystemOfUnits.h>            
 58 #include "G4ios.hh"                               
 59 #include "G4ProcessManager.hh"                    
 60 #include "G4ProcessVector.hh"                     
 61                                                   
 62 #include "G4ParticleTypes.hh"                     
 63 #include "G4ParticleTable.hh"                     
 64 #include "G4ProductionCutsTable.hh"               
 65                                                   
 66 #include "G4UserLimits.hh"                        
 67 #include "G4WarnPLStatus.hh"                      
 68                                                   
 69 // Builder for all stopping processes             
 70 #include "G4StoppingPhysics.hh"                   
 71                                                   
 72 #include "G4HadronicParameters.hh"                
 73 #include "G4ShortLivedConstructor.hh"             
 74 #include "LBE.hh"                                 
 75                                                   
 76 // Constructor ///////////////////////////////    
 77 LBE::LBE(G4int ver)                               
 78 {                                                 
 79   if(ver > 0) {                                   
 80     G4cout << "You are using the simulation en    
 81     G4cout <<G4endl;                              
 82   }                                               
 83   defaultCutValue     = 1.0*CLHEP::micrometer;    
 84   cutForGamma         = defaultCutValue;          
 85   cutForElectron      = 1.0*CLHEP::micrometer;    
 86   cutForPositron      = defaultCutValue;          
 87   //not used:                                     
 88   // cutForProton        = defaultCutValue;       
 89   // cutForAlpha         = 1.0*CLHEP::nanomete    
 90   // cutForGenericIon    = 1.0*CLHEP::nanomete    
 91                                                   
 92   stoppingPhysics = new G4StoppingPhysics;        
 93                                                   
 94   VerboseLevel = ver;                             
 95   OpVerbLevel = 0;                                
 96                                                   
 97   SetVerboseLevel(VerboseLevel);                  
 98 }                                                 
 99                                                   
100                                                   
101 // Destructor ////////////////////////////////    
102 LBE::~LBE()                                       
103 {                                                 
104   delete stoppingPhysics;                         
105 }                                                 
106                                                   
107                                                   
108 // Construct Particles ///////////////////////    
109  void LBE::ConstructParticle()                    
110 {                                                 
111                                                   
112   // In this method, static member functions s    
113   // for all particles which you want to use.     
114   // This ensures that objects of these partic    
115   // created in the program.                      
116                                                   
117   ConstructMyBosons();                            
118   ConstructMyLeptons();                           
119   ConstructMyMesons();                            
120   ConstructMyBaryons();                           
121   ConstructMyIons();                              
122   ConstructMyShortLiveds();                       
123   stoppingPhysics->ConstructParticle(); // Any    
124 }                                                 
125                                                   
126                                                   
127 // construct Bosons://////////////////////////    
128  void LBE::ConstructMyBosons()                    
129 {                                                 
130   // pseudo-particles                             
131   G4Geantino::GeantinoDefinition();               
132   G4ChargedGeantino::ChargedGeantinoDefinition    
133                                                   
134   // gamma                                        
135   G4Gamma::GammaDefinition();                     
136                                                   
137   //OpticalPhotons                                
138   G4OpticalPhoton::OpticalPhotonDefinition();     
139 }                                                 
140                                                   
141                                                   
142 // construct Leptons://///////////////////////    
143  void LBE::ConstructMyLeptons()                   
144 {                                                 
145   // leptons                                      
146   G4Electron::ElectronDefinition();               
147   G4Positron::PositronDefinition();               
148   G4MuonPlus::MuonPlusDefinition();               
149   G4MuonMinus::MuonMinusDefinition();             
150                                                   
151   G4NeutrinoE::NeutrinoEDefinition();             
152   G4AntiNeutrinoE::AntiNeutrinoEDefinition();     
153   G4NeutrinoMu::NeutrinoMuDefinition();           
154   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition()    
155 }                                                 
156                                                   
157 #include "G4MesonConstructor.hh"                  
158 #include "G4BaryonConstructor.hh"                 
159 #include "G4IonConstructor.hh"                    
160                                                   
161                                                   
162 // construct Mesons://////////////////////////    
163  void LBE::ConstructMyMesons()                    
164 {                                                 
165  //  mesons                                       
166   G4MesonConstructor mConstructor;                
167   mConstructor.ConstructParticle();               
168                                                   
169 }                                                 
170                                                   
171                                                   
172 // construct Baryons://///////////////////////    
173  void LBE::ConstructMyBaryons()                   
174 {                                                 
175  //  baryons                                      
176   G4BaryonConstructor bConstructor;               
177   bConstructor.ConstructParticle();               
178                                                   
179 }                                                 
180                                                   
181                                                   
182 // construct Ions:////////////////////////////    
183  void LBE::ConstructMyIons()                      
184 {                                                 
185  //  ions                                         
186   G4IonConstructor iConstructor;                  
187   iConstructor.ConstructParticle();               
188                                                   
189 }                                                 
190                                                   
191 // construct Shortliveds://///////////////////    
192  void LBE::ConstructMyShortLiveds()               
193 {                                                 
194   // ShortLiveds                                  
195   G4ShortLivedConstructor pShortLivedConstruct    
196   pShortLivedConstructor.ConstructParticle();     
197 }                                                 
198                                                   
199                                                   
200                                                   
201                                                   
202 // Construct Processes ///////////////////////    
203  void LBE::ConstructProcess()                     
204 {                                                 
205   AddTransportation();                            
206   ConstructEM();                                  
207   ConstructOp();                                  
208   ConstructHad();                                 
209   ConstructGeneral();                             
210 }                                                 
211                                                   
212                                                   
213 // Transportation ////////////////////////////    
214 #include "G4MaxTimeCuts.hh"                       
215 #include "G4MinEkineCuts.hh"                      
216                                                   
217  void LBE::AddTransportation() {                  
218                                                   
219   G4VUserPhysicsList::AddTransportation();        
220                                                   
221   auto myParticleIterator=G4ParticleTable::Get    
222   myParticleIterator->reset();                    
223   while( (*(myParticleIterator))() ){             
224     G4ParticleDefinition* particle = myParticl    
225     G4ProcessManager* pmanager = particle->Get    
226     G4String particleName = particle->GetParti    
227     // time cuts for ONLY neutrons:               
228     if(particleName == "neutron")                 
229     pmanager->AddDiscreteProcess(new G4MaxTime    
230     // Energy cuts to kill charged (embedded i    
231     pmanager->AddDiscreteProcess(new G4MinEkin    
232   }                                               
233 }                                                 
234                                                   
235                                                   
236 // Electromagnetic Processes /////////////////    
237 // all charged particles                          
238                                                   
239 #include "G4eMultipleScattering.hh"               
240 #include "G4MuMultipleScattering.hh"              
241 #include "G4hMultipleScattering.hh"               
242                                                   
243 // gamma. Use Livermore models                    
244 #include "G4PhotoElectricEffect.hh"               
245 #include "G4LivermorePhotoElectricModel.hh"       
246 #include "G4ComptonScattering.hh"                 
247 #include "G4LivermoreComptonModel.hh"             
248 #include "G4GammaConversion.hh"                   
249 #include "G4LivermoreGammaConversionModel.hh"     
250 #include "G4RayleighScattering.hh"                
251 #include "G4LivermoreRayleighModel.hh"            
252                                                   
253                                                   
254 // e-                                             
255 #include "G4eMultipleScattering.hh"               
256 #include "G4UniversalFluctuation.hh"              
257 #include "G4UrbanMscModel.hh"                     
258                                                   
259 #include "G4eIonisation.hh"                       
260 #include "G4LivermoreIonisationModel.hh"          
261                                                   
262 #include "G4eBremsstrahlung.hh"                   
263 #include "G4LivermoreBremsstrahlungModel.hh"      
264                                                   
265 // e+                                             
266 #include "G4eplusAnnihilation.hh"                 
267                                                   
268                                                   
269 // alpha and GenericIon and deuterons, triton,    
270 #include "G4ionIonisation.hh"                     
271 #include "G4hIonisation.hh"                       
272 #include "G4hBremsstrahlung.hh"                   
273 //                                                
274 #include "G4IonParametrisedLossModel.hh"          
275 #include "G4NuclearStopping.hh"                   
276 #include "G4EnergyLossTables.hh"                  
277                                                   
278 //muon:                                           
279 #include "G4MuIonisation.hh"                      
280 #include "G4MuBremsstrahlung.hh"                  
281 #include "G4MuPairProduction.hh"                  
282 #include "G4MuonMinusCapture.hh"                  
283                                                   
284 //OTHERS:                                         
285 //#include "G4hIonisation.hh" // standard hadr    
286                                                   
287  void LBE::ConstructEM() {                        
288                                                   
289  // models & processes:                           
290  // Use Livermore models up to 20 MeV, and sta    
291  // models for higher energy                      
292  G4double LivermoreHighEnergyLimit = 20*CLHEP:    
293  //                                               
294   auto myParticleIterator=G4ParticleTable::Get    
295   myParticleIterator->reset();                    
296   while( (*(myParticleIterator))() ){             
297     G4ParticleDefinition* particle = myParticl    
298     G4ProcessManager* pmanager = particle->Get    
299     G4String particleName = particle->GetParti    
300     G4String particleType = particle->GetParti    
301     G4double charge = particle->GetPDGCharge()    
302                                                   
303     if (particleName == "gamma")                  
304       {                                           
305       G4PhotoElectricEffect* thePhotoElectricE    
306       G4LivermorePhotoElectricModel* theLiverm    
307   new G4LivermorePhotoElectricModel();            
308       theLivermorePhotoElectricModel->SetHighE    
309       thePhotoElectricEffect->AddEmModel(0, th    
310       pmanager->AddDiscreteProcess(thePhotoEle    
311                                                   
312       G4ComptonScattering* theComptonScatterin    
313       G4LivermoreComptonModel* theLivermoreCom    
314   new G4LivermoreComptonModel();                  
315       theLivermoreComptonModel->SetHighEnergyL    
316       theComptonScattering->AddEmModel(0, theL    
317       pmanager->AddDiscreteProcess(theComptonS    
318                                                   
319       G4GammaConversion* theGammaConversion =     
320       G4LivermoreGammaConversionModel* theLive    
321   new G4LivermoreGammaConversionModel();          
322       theLivermoreGammaConversionModel->SetHig    
323       theGammaConversion->AddEmModel(0, theLiv    
324       pmanager->AddDiscreteProcess(theGammaCon    
325                                                   
326       G4RayleighScattering* theRayleigh = new     
327       G4LivermoreRayleighModel* theRayleighMod    
328       theRayleighModel->SetHighEnergyLimit(Liv    
329       theRayleigh->AddEmModel(0, theRayleighMo    
330       pmanager->AddDiscreteProcess(theRayleigh    
331                                                   
332       }                                           
333     else if (particleName == "e-")                
334       {                                           
335        //electron                                 
336        // process ordering: AddProcess(name, a    
337        // -1 = not implemented, then ordering     
338         G4eMultipleScattering* msc = new G4eMu    
339         //msc->AddEmModel(0, new G4UrbanMscMod    
340         msc->SetStepLimitType(fUseDistanceToBo    
341         pmanager->AddProcess(msc,                 
342                                                   
343        // Ionisation                              
344        G4eIonisation* eIoni = new G4eIonisatio    
345        G4LivermoreIonisationModel* theIoniLive    
346         G4LivermoreIonisationModel();             
347        theIoniLivermore->SetHighEnergyLimit(1*    
348        eIoni->AddEmModel(0, theIoniLivermore,     
349        eIoni->SetStepFunction(0.2, 100*CLHEP::    
350        pmanager->AddProcess(eIoni,                
351                                                   
352        // Bremsstrahlung                          
353        G4eBremsstrahlung* eBrem = new G4eBrems    
354        G4LivermoreBremsstrahlungModel* theBrem    
355          G4LivermoreBremsstrahlungModel();        
356        theBremLivermore->SetHighEnergyLimit(Li    
357        eBrem->AddEmModel(0, theBremLivermore);    
358        pmanager->AddProcess(eBrem, -1,-3, 3);     
359       }                                           
360     else if (particleName == "e+")                
361       {                                           
362   //positron                                      
363       G4eMultipleScattering* msc = new G4eMult    
364       //msc->AddEmModel(0, new G4UrbanMscModel    
365       msc->SetStepLimitType(fUseDistanceToBoun    
366       pmanager->AddProcess(msc,                   
367       G4eIonisation* eIoni = new G4eIonisation    
368       eIoni->SetStepFunction(0.2, 100*CLHEP::u    
369       pmanager->AddProcess(eIoni,                 
370       pmanager->AddProcess(new G4eBremsstrahlu    
371       pmanager->AddProcess(new G4eplusAnnihila    
372       }                                           
373     else if( particleName == "mu+" ||             
374        particleName == "mu-"    )                 
375       {                                           
376   //muon                                          
377         G4MuMultipleScattering* aMultipleScatt    
378   pmanager->AddProcess(aMultipleScattering,       
379   pmanager->AddProcess(new G4MuIonisation(),      
380   pmanager->AddProcess(new G4MuBremsstrahlung(    
381   pmanager->AddProcess(new G4MuPairProduction(    
382   if( particleName == "mu-" )                     
383     pmanager->AddProcess(new G4MuonMinusCaptur    
384       }                                           
385     else if (particleName == "GenericIon")        
386     {                                             
387       pmanager->AddProcess(new G4hMultipleScat    
388       G4ionIonisation* ionIoni = new G4ionIoni    
389       ionIoni->SetEmModel(new G4IonParametrise    
390       ionIoni->SetStepFunction(0.1, 10*CLHEP::    
391       pmanager->AddProcess(ionIoni,               
392       pmanager->AddProcess(new G4NuclearStoppi    
393     }                                             
394     else if (particleName == "alpha" || partic    
395     {                                             
396       //MSC, ion-Ionisation, Nuclear Stopping     
397       pmanager->AddProcess(new G4hMultipleScat    
398                                                   
399       G4ionIonisation* ionIoni = new G4ionIoni    
400       ionIoni->SetStepFunction(0.1, 20*CLHEP::    
401       pmanager->AddProcess(ionIoni,               
402       pmanager->AddProcess(new G4NuclearStoppi    
403     }                                             
404     else if (particleName == "proton"     ||      
405        particleName == "deuteron"   ||            
406        particleName == "triton"     ||            
407              particleName == "pi+" ||             
408              particleName == "pi-" ||             
409        particleName == "kaon+" ||                 
410              particleName == "kaon-")             
411       {                                           
412        //MSC, h-ionisation, bremsstrahlung        
413        pmanager->AddProcess(new G4hMultipleSca    
414        G4hIonisation* hIoni = new G4hIonisatio    
415        hIoni->SetStepFunction(0.2, 50*CLHEP::u    
416        pmanager->AddProcess(hIoni,                
417        pmanager->AddProcess(new G4hBremsstrahl    
418       }                                           
419     else if ((!particle->IsShortLived()) &&       
420        (charge != 0.0) &&                         
421        (particle->GetParticleName() != "charge    
422       {                                           
423   //all others charged particles except geanti    
424         pmanager->AddProcess(new G4hMultipleSc    
425         pmanager->AddProcess(new G4hIonisation    
426       }                                           
427                                                   
428   }                                               
429 }                                                 
430                                                   
431                                                   
432 // Optical Processes /////////////////////////    
433 #include "G4Scintillation.hh"                     
434 #include "G4OpAbsorption.hh"                      
435 //#include "G4OpRayleigh.hh"                      
436 #include "G4OpBoundaryProcess.hh"                 
437                                                   
438  void LBE::ConstructOp()                          
439 {                                                 
440   // default scintillation process                
441   //Coverity report: check that the process is    
442   G4bool theScintProcessDefNeverUsed = true;      
443   G4Scintillation* theScintProcessDef = new G4    
444   // theScintProcessDef->DumpPhysicsTable();      
445   theScintProcessDef->SetTrackSecondariesFirst    
446   theScintProcessDef->SetVerboseLevel(OpVerbLe    
447                                                   
448   // scintillation process for alpha:             
449   G4bool theScintProcessAlphaNeverUsed = true;    
450   G4Scintillation* theScintProcessAlpha = new     
451   // theScintProcessNuc->DumpPhysicsTable();      
452   theScintProcessAlpha->SetTrackSecondariesFir    
453   theScintProcessAlpha->SetVerboseLevel(OpVerb    
454                                                   
455   // scintillation process for heavy nuclei       
456   G4bool theScintProcessNucNeverUsed = true;      
457   G4Scintillation* theScintProcessNuc = new G4    
458   // theScintProcessNuc->DumpPhysicsTable();      
459   theScintProcessNuc->SetTrackSecondariesFirst    
460   theScintProcessNuc->SetVerboseLevel(OpVerbLe    
461                                                   
462   // optical processes                            
463   G4bool theAbsorptionProcessNeverUsed = true;    
464   G4OpAbsorption* theAbsorptionProcess = new G    
465   //  G4OpRayleigh* theRayleighScatteringProce    
466   G4bool theBoundaryProcessNeverUsed = true;      
467   G4OpBoundaryProcess* theBoundaryProcess = ne    
468   //  theAbsorptionProcess->DumpPhysicsTable()    
469   //  theRayleighScatteringProcess->DumpPhysic    
470   theAbsorptionProcess->SetVerboseLevel(OpVerb    
471   // theRayleighScatteringProcess->SetVerboseL    
472   theBoundaryProcess->SetVerboseLevel(OpVerbLe    
473                                                   
474   auto myParticleIterator=G4ParticleTable::Get    
475   myParticleIterator->reset();                    
476   while( (*(myParticleIterator))() )              
477     {                                             
478       G4ParticleDefinition* particle = myParti    
479       G4ProcessManager* pmanager = particle->G    
480       G4String particleName = particle->GetPar    
481       if (theScintProcessDef->IsApplicable(*pa    
482   //      if(particle->GetPDGMass() > 5.0*CLHE    
483   if(particle->GetParticleName() == "GenericIo    
484     pmanager->AddProcess(theScintProcessNuc);     
485     pmanager->SetProcessOrderingToLast(theScin    
486     pmanager->SetProcessOrderingToLast(theScin    
487     theScintProcessNucNeverUsed = false;          
488   }                                               
489   else if(particle->GetParticleName() == "alph    
490     pmanager->AddProcess(theScintProcessAlpha)    
491     pmanager->SetProcessOrderingToLast(theScin    
492     pmanager->SetProcessOrderingToLast(theScin    
493     theScintProcessAlphaNeverUsed = false;        
494   }                                               
495   else {                                          
496     pmanager->AddProcess(theScintProcessDef);     
497     pmanager->SetProcessOrderingToLast(theScin    
498     pmanager->SetProcessOrderingToLast(theScin    
499     theScintProcessDefNeverUsed = false;          
500   }                                               
501       }                                           
502                                                   
503       if (particleName == "opticalphoton") {      
504   pmanager->AddDiscreteProcess(theAbsorptionPr    
505   theAbsorptionProcessNeverUsed = false;          
506   //  pmanager->AddDiscreteProcess(theRayleigh    
507   theBoundaryProcessNeverUsed = false;            
508   pmanager->AddDiscreteProcess(theBoundaryProc    
509       }                                           
510     }                                             
511     if ( theScintProcessDefNeverUsed ) delete     
512     if ( theScintProcessAlphaNeverUsed ) delet    
513     if ( theScintProcessNucNeverUsed ) delete     
514     if ( theBoundaryProcessNeverUsed ) delete     
515     if ( theAbsorptionProcessNeverUsed ) delet    
516 }                                                 
517                                                   
518                                                   
519 // Hadronic processes ////////////////////////    
520                                                   
521 // Elastic processes:                             
522 #include "G4HadronElasticProcess.hh"              
523 #include "G4NeutronCaptureProcess.hh"             
524 #include "G4HadronElastic.hh"                     
525 #include "G4ChipsElasticModel.hh"                 
526 #include "G4ElasticHadrNucleusHE.hh"              
527 #include "G4AntiNuclElastic.hh"                   
528 #include "G4BGGPionElasticXS.hh"                  
529 #include "G4CrossSectionDataSetRegistry.hh"       
530 #include "G4ChipsProtonElasticXS.hh"              
531 #include "G4ChipsNeutronElasticXS.hh"             
532 #include "G4ComponentAntiNuclNuclearXS.hh"        
533 #include "G4ChipsKaonMinusElasticXS.hh"           
534 #include "G4ChipsKaonPlusElasticXS.hh"            
535 #include "G4ChipsKaonZeroElasticXS.hh"            
536 #include "G4BGGNucleonElasticXS.hh"               
537 #include "G4CrossSectionElastic.hh"               
538                                                   
539 // Inelastic processes:                           
540 #include "G4HadronInelasticProcess.hh"            
541                                                   
542 // FTFP + BERT model                              
543 #include "G4TheoFSGenerator.hh"                   
544 #include "G4ExcitationHandler.hh"                 
545 #include "G4PreCompoundModel.hh"                  
546 #include "G4GeneratorPrecompoundInterface.hh"     
547 #include "G4FTFModel.hh"                          
548 #include "G4LundStringFragmentation.hh"           
549 #include "G4ExcitedStringDecay.hh"                
550 #include "G4CascadeInterface.hh"                  
551 #include "G4CrossSectionInelastic.hh"             
552 #include "G4BGGPionInelasticXS.hh"                
553 #include "G4ChipsKaonMinusInelasticXS.hh"         
554 #include "G4ChipsKaonPlusInelasticXS.hh"          
555 #include "G4ChipsKaonZeroInelasticXS.hh"          
556 #include "G4CrossSectionDataSetRegistry.hh"       
557 #include "G4BGGNucleonInelasticXS.hh"             
558 #include "G4ComponentAntiNuclNuclearXS.hh"        
559 #include "G4ComponentGGNuclNuclXsc.hh"            
560                                                   
561 // Neutron high-precision models: <20 MeV         
562 #include "G4ParticleHPElastic.hh"                 
563 #include "G4ParticleHPElasticData.hh"             
564 #include "G4ParticleHPCapture.hh"                 
565 #include "G4ParticleHPCaptureData.hh"             
566 #include "G4ParticleHPInelastic.hh"               
567 #include "G4ParticleHPInelasticData.hh"           
568 #include "G4NeutronCaptureXS.hh"                  
569 #include "G4NeutronRadCapture.hh"                 
570                                                   
571 // Binary light ion cascade for alpha, deutero    
572 #include "G4BinaryLightIonReaction.hh"            
573                                                   
574 // ConstructHad()                                 
575 // Makes discrete physics processes for the ha    
576 // to those particles with GHEISHA interaction    
577 // The processes are: Elastic scattering and I    
578 // F.W.Jones  09-JUL-1998                         
579  void LBE::ConstructHad()                         
580 {                                                 
581   // Elastic scattering                           
582   G4HadronElastic* elastic_lhep0 = new G4Hadro    
583   G4ChipsElasticModel* elastic_chip = new G4Ch    
584   G4ElasticHadrNucleusHE* elastic_he = new G4E    
585                                                   
586   const G4double elastic_elimitAntiNuc = 100.0    
587   G4AntiNuclElastic* elastic_anuc = new G4Anti    
588   elastic_anuc->SetMinEnergy( elastic_elimitAn    
589   G4CrossSectionElastic* elastic_anucxs = new     
590   G4HadronElastic* elastic_lhep2 = new G4Hadro    
591   elastic_lhep2->SetMaxEnergy( elastic_elimitA    
592                                                   
593   // Inelastic scattering                         
594   const G4double theFTFMin0 =    0.0*CLHEP::Ge    
595   const G4double theFTFMin1 =    4.0*CLHEP::Ge    
596   const G4double theFTFMax = G4HadronicParamet    
597   const G4double theBERTMin0 =   0.0*CLHEP::Ge    
598   const G4double theBERTMin1 =  19.0*CLHEP::Me    
599   const G4double theBERTMax =    5.0*CLHEP::Ge    
600   const G4double theHPMin =      0.0*CLHEP::Ge    
601   const G4double theHPMax =     20.0*CLHEP::Me    
602   const G4double theIonBCMin =   0.0*CLHEP::Ge    
603   const G4double theIonBCMax =   5.0*CLHEP::Ge    
604                                                   
605                                                   
606   G4FTFModel * theStringModel = new G4FTFModel    
607   G4ExcitedStringDecay * theStringDecay = new     
608   theStringModel->SetFragmentationModel( theSt    
609   G4PreCompoundModel * thePreEquilib = new G4P    
610   G4GeneratorPrecompoundInterface * theCascade    
611                                                   
612   G4TheoFSGenerator * theFTFModel0 = new G4The    
613   theFTFModel0->SetHighEnergyGenerator( theStr    
614   theFTFModel0->SetTransport( theCascade );       
615   theFTFModel0->SetMinEnergy( theFTFMin0 );       
616   theFTFModel0->SetMaxEnergy( theFTFMax );        
617                                                   
618   G4TheoFSGenerator * theFTFModel1 = new G4The    
619   theFTFModel1->SetHighEnergyGenerator( theStr    
620   theFTFModel1->SetTransport( theCascade );       
621   theFTFModel1->SetMinEnergy( theFTFMin1 );       
622   theFTFModel1->SetMaxEnergy( theFTFMax );        
623                                                   
624   G4CascadeInterface * theBERTModel0 = new G4C    
625   theBERTModel0->SetMinEnergy( theBERTMin0 );     
626   theBERTModel0->SetMaxEnergy( theBERTMax );      
627                                                   
628   G4CascadeInterface * theBERTModel1 = new G4C    
629   theBERTModel1->SetMinEnergy( theBERTMin1 );     
630   theBERTModel1->SetMaxEnergy( theBERTMax );      
631                                                   
632   // Binary Cascade                               
633   G4BinaryLightIonReaction * theIonBC = new G4    
634   theIonBC->SetMinEnergy( theIonBCMin );          
635   theIonBC->SetMaxEnergy( theIonBCMax );          
636                                                   
637   G4VCrossSectionDataSet * theAntiNucleonData     
638   G4ComponentGGNuclNuclXsc * ggNuclNuclXsec =     
639   G4VCrossSectionDataSet * theGGNuclNuclData =    
640                                                   
641   auto myParticleIterator=G4ParticleTable::Get    
642   myParticleIterator->reset();                    
643   while ((*(myParticleIterator))())               
644     {                                             
645       G4ParticleDefinition* particle = myParti    
646       G4ProcessManager* pmanager = particle->G    
647       G4String particleName = particle->GetPar    
648                                                   
649       if (particleName == "pi+")                  
650   {                                               
651           // Elastic scattering                   
652           G4HadronElasticProcess* theElasticPr    
653           theElasticProcess->AddDataSet( new G    
654           theElasticProcess->RegisterMe( elast    
655     pmanager->AddDiscreteProcess( theElasticPr    
656           // Inelastic scattering                 
657           G4HadronInelasticProcess* theInelast    
658           theInelasticProcess->AddDataSet( new    
659     theInelasticProcess->RegisterMe( theFTFMod    
660           theInelasticProcess->RegisterMe( the    
661     pmanager->AddDiscreteProcess( theInelastic    
662   }                                               
663                                                   
664       else if (particleName == "pi-")             
665   {                                               
666           // Elastic scattering                   
667           G4HadronElasticProcess* theElasticPr    
668           theElasticProcess->AddDataSet( new G    
669           theElasticProcess->RegisterMe( elast    
670     pmanager->AddDiscreteProcess( theElasticPr    
671           // Inelastic scattering                 
672           G4HadronInelasticProcess* theInelast    
673           theInelasticProcess->AddDataSet( new    
674     theInelasticProcess->RegisterMe( theFTFMod    
675           theInelasticProcess->RegisterMe( the    
676     pmanager->AddDiscreteProcess( theInelastic    
677   }                                               
678                                                   
679       else if (particleName == "kaon+")           
680   {                                               
681           // Elastic scattering                   
682           G4HadronElasticProcess* theElasticPr    
683           theElasticProcess->RegisterMe( elast    
684           theElasticProcess->AddDataSet( G4Cro    
685     pmanager->AddDiscreteProcess( theElasticPr    
686           // Inelastic scattering                 
687           G4HadronInelasticProcess* theInelast    
688                                                   
689           theInelasticProcess->AddDataSet( G4C    
690     theInelasticProcess->RegisterMe( theFTFMod    
691           theInelasticProcess->RegisterMe( the    
692     pmanager->AddDiscreteProcess( theInelastic    
693   }                                               
694                                                   
695       else if (particleName == "kaon0S")          
696   {                                               
697           // Elastic scattering                   
698           G4HadronElasticProcess* theElasticPr    
699           theElasticProcess->RegisterMe( elast    
700           theElasticProcess->AddDataSet( G4Cro    
701     pmanager->AddDiscreteProcess( theElasticPr    
702           // Inelastic scattering                 
703     G4HadronInelasticProcess* theInelasticProc    
704           theInelasticProcess->AddDataSet( G4C    
705     theInelasticProcess->RegisterMe( theFTFMod    
706           theInelasticProcess->RegisterMe( the    
707     pmanager->AddDiscreteProcess( theInelastic    
708   }                                               
709                                                   
710       else if (particleName == "kaon0L")          
711   {                                               
712           // Elastic scattering                   
713           G4HadronElasticProcess* theElasticPr    
714           theElasticProcess->RegisterMe( elast    
715           theElasticProcess->AddDataSet( G4Cro    
716     pmanager->AddDiscreteProcess( theElasticPr    
717           // Inelastic scattering                 
718           //G4KaonZeroLInelasticProcess* theIn    
719     G4HadronInelasticProcess* theInelasticProc    
720           theInelasticProcess->AddDataSet( G4C    
721     theInelasticProcess->RegisterMe( theFTFMod    
722           theInelasticProcess->RegisterMe( the    
723     pmanager->AddDiscreteProcess( theInelastic    
724   }                                               
725                                                   
726       else if (particleName == "kaon-")           
727   {                                               
728           // Elastic scattering                   
729           G4HadronElasticProcess* theElasticPr    
730           theElasticProcess->RegisterMe( elast    
731           theElasticProcess->AddDataSet( G4Cro    
732     pmanager->AddDiscreteProcess( theElasticPr    
733           // Inelastic scattering                 
734     G4HadronInelasticProcess* theInelasticProc    
735           theInelasticProcess->AddDataSet( G4C    
736     theInelasticProcess->RegisterMe( theFTFMod    
737           theInelasticProcess->RegisterMe( the    
738     pmanager->AddDiscreteProcess( theInelastic    
739   }                                               
740                                                   
741       else if (particleName == "proton")          
742   {                                               
743           // Elastic scattering                   
744           G4HadronElasticProcess* theElasticPr    
745           theElasticProcess->AddDataSet(G4Cros    
746           theElasticProcess->AddDataSet( new G    
747           theElasticProcess->RegisterMe( elast    
748     pmanager->AddDiscreteProcess( theElasticPr    
749           // Inelastic scattering                 
750     G4HadronInelasticProcess* theInelasticProc    
751           theInelasticProcess->AddDataSet( new    
752     theInelasticProcess->RegisterMe( theFTFMod    
753           theInelasticProcess->RegisterMe( the    
754     pmanager->AddDiscreteProcess( theInelastic    
755   }                                               
756                                                   
757       else if (particleName == "anti_proton")     
758   {                                               
759           // Elastic scattering                   
760           G4HadronElasticProcess* theElasticPr    
761           theElasticProcess->AddDataSet( elast    
762           theElasticProcess->RegisterMe( elast    
763           theElasticProcess->RegisterMe( elast    
764     pmanager->AddDiscreteProcess( theElasticPr    
765           // Inelastic scattering                 
766     G4HadronInelasticProcess* theInelasticProc    
767           theInelasticProcess->AddDataSet( the    
768     theInelasticProcess->RegisterMe( theFTFMod    
769     pmanager->AddDiscreteProcess( theInelastic    
770   }                                               
771                                                   
772       else if (particleName == "neutron") {       
773   // elastic scattering                           
774   G4HadronElasticProcess* theElasticProcess =     
775         theElasticProcess->AddDataSet(G4CrossS    
776         G4HadronElastic* elastic_neutronChipsM    
777   elastic_neutronChipsModel->SetMinEnergy( 19.    
778         theElasticProcess->RegisterMe( elastic    
779   G4ParticleHPElastic * theElasticNeutronHP =     
780         theElasticNeutronHP->SetMinEnergy( the    
781         theElasticNeutronHP->SetMaxEnergy( the    
782   theElasticProcess->RegisterMe( theElasticNeu    
783   theElasticProcess->AddDataSet( new G4Particl    
784   pmanager->AddDiscreteProcess( theElasticProc    
785   // inelastic scattering                         
786   G4HadronInelasticProcess* theInelasticProces    
787         theInelasticProcess->AddDataSet( new G    
788   theInelasticProcess->RegisterMe( theFTFModel    
789         theInelasticProcess->RegisterMe( theBE    
790   G4ParticleHPInelastic * theNeutronInelasticH    
791         theNeutronInelasticHPModel->SetMinEner    
792         theNeutronInelasticHPModel->SetMaxEner    
793   theInelasticProcess->RegisterMe( theNeutronI    
794   theInelasticProcess->AddDataSet( new G4Parti    
795   pmanager->AddDiscreteProcess(theInelasticPro    
796   // capture                                      
797   G4NeutronCaptureProcess* theCaptureProcess =    
798   G4ParticleHPCapture * theNeutronCaptureHPMod    
799         theNeutronCaptureHPModel->SetMinEnergy    
800         theNeutronCaptureHPModel->SetMaxEnergy    
801   G4NeutronRadCapture* theNeutronRadCapture =     
802   theNeutronRadCapture->SetMinEnergy(theHPMax*    
803   theCaptureProcess->RegisterMe( theNeutronCap    
804   theCaptureProcess->RegisterMe( theNeutronRad    
805   theCaptureProcess->AddDataSet( new G4Particl    
806   theCaptureProcess->AddDataSet((G4NeutronCapt    
807   pmanager->AddDiscreteProcess(theCaptureProce    
808       }                                           
809       else if (particleName == "anti_neutron")    
810   {                                               
811           // Elastic scattering                   
812           G4HadronElasticProcess* theElasticPr    
813           theElasticProcess->AddDataSet( elast    
814           theElasticProcess->RegisterMe( elast    
815           theElasticProcess->RegisterMe( elast    
816     pmanager->AddDiscreteProcess( theElasticPr    
817           // Inelastic scattering                 
818     G4HadronInelasticProcess* theInelasticProc    
819           theInelasticProcess->AddDataSet( the    
820     theInelasticProcess->RegisterMe( theFTFMod    
821     pmanager->AddDiscreteProcess( theInelastic    
822   }                                               
823                                                   
824       else if (particleName == "deuteron")        
825   {                                               
826           // Elastic scattering                   
827           G4HadronElasticProcess* theElasticPr    
828           theElasticProcess->RegisterMe( elast    
829           theElasticProcess->AddDataSet( theGG    
830     pmanager->AddDiscreteProcess( theElasticPr    
831           // Inelastic scattering                 
832     G4HadronInelasticProcess* theInelasticProc    
833           theInelasticProcess->AddDataSet( the    
834     theInelasticProcess->RegisterMe( theFTFMod    
835     theInelasticProcess->RegisterMe( theIonBC     
836     pmanager->AddDiscreteProcess( theInelastic    
837   }                                               
838                                                   
839       else if (particleName == "triton")          
840   {                                               
841           // Elastic scattering                   
842           G4HadronElasticProcess* theElasticPr    
843           theElasticProcess->RegisterMe( elast    
844           theElasticProcess->AddDataSet( theGG    
845     pmanager->AddDiscreteProcess( theElasticPr    
846           // Inelastic scattering                 
847     G4HadronInelasticProcess* theInelasticProc    
848           theInelasticProcess->AddDataSet( the    
849     theInelasticProcess->RegisterMe( theFTFMod    
850     theInelasticProcess->RegisterMe( theIonBC     
851     pmanager->AddDiscreteProcess( theInelastic    
852   }                                               
853                                                   
854       else if (particleName == "alpha")           
855   {                                               
856           // Elastic scattering                   
857           G4HadronElasticProcess* theElasticPr    
858           theElasticProcess->RegisterMe( elast    
859           theElasticProcess->AddDataSet( theGG    
860     pmanager->AddDiscreteProcess( theElasticPr    
861           // Inelastic scattering                 
862     G4HadronInelasticProcess* theInelasticProc    
863           theInelasticProcess->AddDataSet( the    
864     theInelasticProcess->RegisterMe( theFTFMod    
865     theInelasticProcess->RegisterMe( theIonBC     
866     pmanager->AddDiscreteProcess( theInelastic    
867   }                                               
868     } // while ((*(myParticleIterator))())        
869                                                   
870   // Add stopping processes with builder          
871   stoppingPhysics->ConstructProcess();            
872 }                                                 
873                                                   
874                                                   
875 // Decays ////////////////////////////////////    
876 #include "G4Decay.hh"                             
877 #include "G4RadioactiveDecay.hh"                  
878 #include "G4IonTable.hh"                          
879 #include "G4Ions.hh"                              
880                                                   
881 #include "G4LossTableManager.hh"                  
882 #include "G4UAtomicDeexcitation.hh"               
883 #include "G4NuclearLevelData.hh"                  
884 #include "G4NuclideTable.hh"                      
885                                                   
886  void LBE::ConstructGeneral() {                   
887                                                   
888   // Add Decay Process                            
889   G4Decay* theDecayProcess = new G4Decay();       
890   G4bool theDecayProcessNeverUsed = true; //Ch    
891   auto myParticleIterator=G4ParticleTable::Get    
892   myParticleIterator->reset();                    
893   while( (*(myParticleIterator))() )              
894     {                                             
895       G4ParticleDefinition* particle = myParti    
896       G4ProcessManager* pmanager = particle->G    
897                                                   
898       if (theDecayProcess->IsApplicable(*parti    
899   {                                               
900     theDecayProcessNeverUsed = false;             
901     pmanager ->AddProcess(theDecayProcess);       
902     // set ordering for PostStepDoIt and AtRes    
903     pmanager ->SetProcessOrdering(theDecayProc    
904     pmanager ->SetProcessOrdering(theDecayProc    
905   }                                               
906     }                                             
907                                                   
908   // Declare radioactive decay to the GenericI    
909   const G4IonTable *theIonTable =                 
910     G4ParticleTable::GetParticleTable()->GetIo    
911   G4RadioactiveDecay* theRadioactiveDecay = ne    
912                                                   
913   //Fix for activation of RadioactiveDecay, ba    
914   G4EmParameters* param = G4EmParameters::Inst    
915   param->SetAugerCascade(true);                   
916   param->AddPhysics("world","G4RadioactiveDeca    
917                                                   
918   G4DeexPrecoParameters* deex = G4NuclearLevel    
919   deex->SetStoreAllLevels(true);                  
920   deex->SetMaxLifeTime(G4NuclideTable::GetInst    
921                        /std::log(2.));            
922                                                   
923   G4LossTableManager* man = G4LossTableManager    
924   G4VAtomDeexcitation* ad = man->AtomDeexcitat    
925   if(!ad) {                                       
926     ad = new G4UAtomicDeexcitation();             
927     man->SetAtomDeexcitation(ad);                 
928     ad->InitialiseAtomicDeexcitation();           
929   }                                               
930                                                   
931   for (G4int i=0; i<theIonTable->Entries(); i+    
932     {                                             
933       G4String particleName = theIonTable->Get    
934       G4String particleType = theIonTable->Get    
935                                                   
936       if (particleName == "GenericIon")           
937   {                                               
938     G4ProcessManager* pmanager =                  
939       theIonTable->GetParticle(i)->GetProcessM    
940     pmanager->SetVerboseLevel(VerboseLevel);      
941     pmanager ->AddProcess(theRadioactiveDecay)    
942     pmanager ->SetProcessOrdering(theRadioacti    
943     pmanager ->SetProcessOrdering(theRadioacti    
944   }                                               
945     }                                             
946     //If we actually never used the process, d    
947     //From Coverity report                        
948     if ( theDecayProcessNeverUsed ) delete the    
949 }                                                 
950                                                   
951 // Cuts //////////////////////////////////////    
952 void LBE::SetCuts()                               
953 {                                                 
954                                                   
955   if (verboseLevel >1)                            
956     G4cout << "LBE::SetCuts:";                    
957                                                   
958   if (verboseLevel>0){                            
959     G4cout << "LBE::SetCuts:";                    
960     G4cout << "CutLength : "                      
961      << G4BestUnit(defaultCutValue,"Length") <    
962   }                                               
963                                                   
964   //special for low energy physics                
965   G4double lowlimit=250*CLHEP::eV;                
966   G4ProductionCutsTable * aPCTable = G4Product    
967   aPCTable->SetEnergyRange(lowlimit,100*CLHEP:    
968                                                   
969   // set cut values for gamma at first and for    
970   // because some processes for e+/e- need cut    
971   SetCutValue(cutForGamma, "gamma");              
972   SetCutValue(cutForElectron, "e-");              
973   SetCutValue(cutForPositron, "e+");              
974                                                   
975   //  SetCutValue(cutForProton, "proton");        
976   //  SetCutValue(cutForProton, "anti_proton")    
977   //  SetCutValue(cutForAlpha,  "alpha");         
978   //  SetCutValue(cutForGenericIon,  "GenericI    
979                                                   
980   //  SetCutValueForOthers(defaultCutValue);      
981                                                   
982   if (verboseLevel>0) DumpCutValuesTable();       
983 }                                                 
984                                                   
985