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


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file PhysicsList.cc                           26 /// \file PhysicsList.cc
 27 /// \brief Implementation of the PhysicsList c     27 /// \brief Implementation of the PhysicsList class
 28 //                                                 28 //
 29 //                                                 29 //
 30 //....oooOO0OOooo........oooOO0OOooo........oo     30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 31 //....oooOO0OOooo........oooOO0OOooo........oo     31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 32                                                    32 
 33 #include "PhysicsList.hh"                          33 #include "PhysicsList.hh"
                                                   >>  34 #include "PhysicsListMessenger.hh"
 34                                                    35 
 35 #include "PhysListEmStandard.hh"                   36 #include "PhysListEmStandard.hh"
 36 #include "PhysicsListMessenger.hh"             << 
 37 #include "StepMax.hh"                          << 
 38                                                    37 
 39 #include "G4DecayPhysics.hh"                   << 
 40 #include "G4EmDNAPhysics.hh"                   << 
 41 #include "G4EmDNAPhysics_option2.hh"           << 
 42 #include "G4EmDNAPhysics_option4.hh"           << 
 43 #include "G4EmDNAPhysics_option6.hh"           << 
 44 #include "G4EmLivermorePhysics.hh"             << 
 45 #include "G4EmLowEPPhysics.hh"                 << 
 46 #include "G4EmPenelopePhysics.hh"              << 
 47 #include "G4EmStandardPhysics.hh"                  38 #include "G4EmStandardPhysics.hh"
 48 #include "G4EmStandardPhysicsGS.hh"            << 
 49 #include "G4EmStandardPhysicsSS.hh"            << 
 50 #include "G4EmStandardPhysicsWVI.hh"           << 
 51 #include "G4EmStandardPhysics_option1.hh"          39 #include "G4EmStandardPhysics_option1.hh"
 52 #include "G4EmStandardPhysics_option2.hh"          40 #include "G4EmStandardPhysics_option2.hh"
 53 #include "G4EmStandardPhysics_option3.hh"          41 #include "G4EmStandardPhysics_option3.hh"
 54 #include "G4EmStandardPhysics_option4.hh"          42 #include "G4EmStandardPhysics_option4.hh"
                                                   >>  43 #include "G4EmStandardPhysicsWVI.hh"
                                                   >>  44 #include "G4EmStandardPhysicsGS.hh"
                                                   >>  45 #include "G4EmStandardPhysicsSS.hh"
                                                   >>  46 
                                                   >>  47 #include "G4EmLivermorePhysics.hh"
                                                   >>  48 #include "G4EmPenelopePhysics.hh"
                                                   >>  49 #include "G4EmLowEPPhysics.hh"
                                                   >>  50 
                                                   >>  51 #include "G4EmDNAPhysics.hh"
                                                   >>  52 #include "G4EmDNAPhysics_option2.hh"
                                                   >>  53 #include "G4EmDNAPhysics_option4.hh"
                                                   >>  54 #include "G4EmDNAPhysics_option6.hh"
                                                   >>  55 
 55 #include "G4HadronElasticPhysics.hh"               56 #include "G4HadronElasticPhysics.hh"
                                                   >>  57 
                                                   >>  58 #include "G4DecayPhysics.hh"
                                                   >>  59 #include "StepMax.hh"
                                                   >>  60 
                                                   >>  61 #include "G4UnitsTable.hh"
                                                   >>  62 #include "G4SystemOfUnits.hh"
                                                   >>  63 
 56 #include "G4ParticleDefinition.hh"                 64 #include "G4ParticleDefinition.hh"
 57 #include "G4ProcessManager.hh"                     65 #include "G4ProcessManager.hh"
 58 #include "G4SystemOfUnits.hh"                  << 
 59 #include "G4UnitsTable.hh"                     << 
 60                                                    66 
 61 // particles                                       67 // particles
 62                                                    68 
 63 #include "G4BaryonConstructor.hh"              << 
 64 #include "G4BosonConstructor.hh"                   69 #include "G4BosonConstructor.hh"
 65 #include "G4DNAGenericIonsManager.hh"          << 
 66 #include "G4IonConstructor.hh"                 << 
 67 #include "G4LeptonConstructor.hh"                  70 #include "G4LeptonConstructor.hh"
 68 #include "G4MesonConstructor.hh"                   71 #include "G4MesonConstructor.hh"
                                                   >>  72 #include "G4BosonConstructor.hh"
                                                   >>  73 #include "G4BaryonConstructor.hh"
                                                   >>  74 #include "G4IonConstructor.hh"
 69 #include "G4ShortLivedConstructor.hh"              75 #include "G4ShortLivedConstructor.hh"
                                                   >>  76 #include "G4DNAGenericIonsManager.hh"
 70                                                    77 
 71 //....oooOO0OOooo........oooOO0OOooo........oo     78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 72                                                    79 
 73 PhysicsList::PhysicsList()                     <<  80 PhysicsList::PhysicsList() : G4VModularPhysicsList(),
 74 {                                              <<  81   fHadPhysicsList(nullptr)
 75   fMessenger = new PhysicsListMessenger(this); <<  82 {  
                                                   >>  83   fMessenger = new PhysicsListMessenger(this); 
 76   SetVerboseLevel(1);                              84   SetVerboseLevel(1);
 77                                                <<  85      
 78   // EM physics                                    86   // EM physics
 79   fEmName = G4String("emstandard_opt4");           87   fEmName = G4String("emstandard_opt4");
 80   fEmPhysicsList = new G4EmStandardPhysics_opt     88   fEmPhysicsList = new G4EmStandardPhysics_option4();
 81                                                    89 
 82   // Decay physics                             <<  90   // Decay physics  
 83   fDecayPhysics = new G4DecayPhysics(1);           91   fDecayPhysics = new G4DecayPhysics(1);
 84                                                <<  92   
 85   SetDefaultCutValue(1 * mm);                  <<  93   SetDefaultCutValue(1*mm);  
 86 }                                                  94 }
 87                                                    95 
 88 //....oooOO0OOooo........oooOO0OOooo........oo     96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 89                                                    97 
 90 PhysicsList::~PhysicsList()                        98 PhysicsList::~PhysicsList()
 91 {                                                  99 {
 92   delete fEmPhysicsList;                          100   delete fEmPhysicsList;
 93   delete fMessenger;                           << 101   delete fMessenger;  
 94 }                                                 102 }
 95                                                   103 
 96 //....oooOO0OOooo........oooOO0OOooo........oo    104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 97                                                   105 
 98 void PhysicsList::ConstructParticle()             106 void PhysicsList::ConstructParticle()
 99 {                                                 107 {
100   G4BosonConstructor pBosonConstructor;        << 108   G4BosonConstructor  pBosonConstructor;
101   pBosonConstructor.ConstructParticle();          109   pBosonConstructor.ConstructParticle();
102                                                   110 
103   G4LeptonConstructor pLeptonConstructor;         111   G4LeptonConstructor pLeptonConstructor;
104   pLeptonConstructor.ConstructParticle();         112   pLeptonConstructor.ConstructParticle();
105                                                   113 
106   G4MesonConstructor pMesonConstructor;           114   G4MesonConstructor pMesonConstructor;
107   pMesonConstructor.ConstructParticle();          115   pMesonConstructor.ConstructParticle();
108                                                   116 
109   G4BaryonConstructor pBaryonConstructor;         117   G4BaryonConstructor pBaryonConstructor;
110   pBaryonConstructor.ConstructParticle();         118   pBaryonConstructor.ConstructParticle();
111                                                   119 
112   G4IonConstructor pIonConstructor;               120   G4IonConstructor pIonConstructor;
113   pIonConstructor.ConstructParticle();            121   pIonConstructor.ConstructParticle();
114                                                   122 
115   G4ShortLivedConstructor sLivedConstructor;      123   G4ShortLivedConstructor sLivedConstructor;
116   sLivedConstructor.ConstructParticle();          124   sLivedConstructor.ConstructParticle();
117                                                   125 
118   // Geant4-DNA                                   126   // Geant4-DNA
119                                                   127 
120   G4DNAGenericIonsManager* genericIonsManager;    128   G4DNAGenericIonsManager* genericIonsManager;
121   genericIonsManager = G4DNAGenericIonsManager << 129   genericIonsManager=G4DNAGenericIonsManager::Instance();
122   genericIonsManager->GetIon("alpha++");          130   genericIonsManager->GetIon("alpha++");
123   genericIonsManager->GetIon("alpha+");           131   genericIonsManager->GetIon("alpha+");
124   genericIonsManager->GetIon("helium");           132   genericIonsManager->GetIon("helium");
125   genericIonsManager->GetIon("hydrogen");      << 133   genericIonsManager->GetIon("hydrogen");  
126 }                                                 134 }
127                                                   135 
128 //....oooOO0OOooo........oooOO0OOooo........oo    136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129                                                   137 
130 void PhysicsList::ConstructProcess()              138 void PhysicsList::ConstructProcess()
131 {                                                 139 {
132   AddTransportation();                            140   AddTransportation();
133   fEmPhysicsList->ConstructProcess();             141   fEmPhysicsList->ConstructProcess();
134   fDecayPhysics->ConstructProcess();              142   fDecayPhysics->ConstructProcess();
135   if (fHadPhysicsList) {                       << 143   if(fHadPhysicsList) { fHadPhysicsList->ConstructProcess(); }
136     fHadPhysicsList->ConstructProcess();       << 
137   }                                            << 
138   AddStepMax();                                   144   AddStepMax();
139 }                                                 145 }
140                                                   146 
141 //....oooOO0OOooo........oooOO0OOooo........oo    147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142                                                   148 
143 void PhysicsList::AddStepMax()                    149 void PhysicsList::AddStepMax()
144 {                                                 150 {
145   // Step limitation seen as a process            151   // Step limitation seen as a process
146   StepMax* stepMaxProcess = new StepMax();        152   StepMax* stepMaxProcess = new StepMax();
147                                                   153 
148   auto particleIterator = GetParticleIterator( << 154   auto particleIterator=GetParticleIterator();
149   particleIterator->reset();                      155   particleIterator->reset();
150   while ((*particleIterator)()) {              << 156   while ((*particleIterator)()){
151     G4ParticleDefinition* particle = particleI    157     G4ParticleDefinition* particle = particleIterator->value();
152     G4ProcessManager* pmanager = particle->Get    158     G4ProcessManager* pmanager = particle->GetProcessManager();
153                                                   159 
154     if (stepMaxProcess->IsApplicable(*particle << 160     if (stepMaxProcess->IsApplicable(*particle))
155       pmanager->AddDiscreteProcess(stepMaxProc << 161       {
156     }                                          << 162         pmanager ->AddDiscreteProcess(stepMaxProcess);
                                                   >> 163       }
157   }                                               164   }
158 }                                                 165 }
159                                                   166 
160 //....oooOO0OOooo........oooOO0OOooo........oo    167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
161                                                   168 
162 void PhysicsList::AddPhysicsList(const G4Strin    169 void PhysicsList::AddPhysicsList(const G4String& name)
163 {                                                 170 {
164   if (verboseLevel > -1) {                     << 171   if (verboseLevel>-1) {
165     G4cout << "PhysicsList::AddPhysicsList: <"    172     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
166   }                                               173   }
167                                                   174 
168   if (name == fEmName) return;                    175   if (name == fEmName) return;
169                                                   176 
170   if (name == "local") {                          177   if (name == "local") {
                                                   >> 178 
171     fEmName = name;                               179     fEmName = name;
172     delete fEmPhysicsList;                        180     delete fEmPhysicsList;
173     fEmPhysicsList = new PhysListEmStandard(na    181     fEmPhysicsList = new PhysListEmStandard(name);
174   }                                            << 182 
175   else if (name == "emstandard_opt0") {        << 183   } else if (name == "emstandard_opt0") {
                                                   >> 184 
176     fEmName = name;                               185     fEmName = name;
177     delete fEmPhysicsList;                        186     delete fEmPhysicsList;
178     fEmPhysicsList = new G4EmStandardPhysics()    187     fEmPhysicsList = new G4EmStandardPhysics();
179   }                                            << 188 
180   else if (name == "emstandard_opt1") {        << 189   } else if (name == "emstandard_opt1") {
                                                   >> 190 
181     fEmName = name;                               191     fEmName = name;
182     delete fEmPhysicsList;                        192     delete fEmPhysicsList;
183     fEmPhysicsList = new G4EmStandardPhysics_o    193     fEmPhysicsList = new G4EmStandardPhysics_option1();
184   }                                            << 194 
185   else if (name == "emstandard_opt2") {        << 195   } else if (name == "emstandard_opt2") {
                                                   >> 196 
186     fEmName = name;                               197     fEmName = name;
187     delete fEmPhysicsList;                        198     delete fEmPhysicsList;
188     fEmPhysicsList = new G4EmStandardPhysics_o    199     fEmPhysicsList = new G4EmStandardPhysics_option2();
189   }                                            << 200     
190   else if (name == "emstandard_opt3") {        << 201   } else if (name == "emstandard_opt3") {
                                                   >> 202 
191     fEmName = name;                               203     fEmName = name;
192     delete fEmPhysicsList;                        204     delete fEmPhysicsList;
193     fEmPhysicsList = new G4EmStandardPhysics_o    205     fEmPhysicsList = new G4EmStandardPhysics_option3();
194   }                                            << 206     
195   else if (name == "emstandard_opt4") {        << 207   } else if (name == "emstandard_opt4") {
                                                   >> 208 
196     fEmName = name;                               209     fEmName = name;
197     delete fEmPhysicsList;                        210     delete fEmPhysicsList;
198     fEmPhysicsList = new G4EmStandardPhysics_o    211     fEmPhysicsList = new G4EmStandardPhysics_option4();
199   }                                            << 212         
200   else if (name == "emstandardSS") {           << 213   } else if (name == "emstandardSS") {
                                                   >> 214 
201     fEmName = name;                               215     fEmName = name;
202     delete fEmPhysicsList;                        216     delete fEmPhysicsList;
203     fEmPhysicsList = new G4EmStandardPhysicsSS    217     fEmPhysicsList = new G4EmStandardPhysicsSS();
204   }                                            << 218 
205   else if (name == "emstandardWVI") {          << 219   } else if (name == "emstandardWVI") {
                                                   >> 220 
206     fEmName = name;                               221     fEmName = name;
207     delete fEmPhysicsList;                        222     delete fEmPhysicsList;
208     fEmPhysicsList = new G4EmStandardPhysicsWV    223     fEmPhysicsList = new G4EmStandardPhysicsWVI();
209   }                                            << 224 
210   else if (name == "emstandardGS") {           << 225   } else if (name == "emstandardGS") {
                                                   >> 226 
211     fEmName = name;                               227     fEmName = name;
212     delete fEmPhysicsList;                        228     delete fEmPhysicsList;
213     fEmPhysicsList = new G4EmStandardPhysicsGS    229     fEmPhysicsList = new G4EmStandardPhysicsGS();
214   }                                            << 230 
215   else if (name == "empenelope") {             << 231   } else if (name == "empenelope") {
216     fEmName = name;                               232     fEmName = name;
217     delete fEmPhysicsList;                        233     delete fEmPhysicsList;
218     fEmPhysicsList = new G4EmPenelopePhysics()    234     fEmPhysicsList = new G4EmPenelopePhysics();
219   }                                            << 235 
220   else if (name == "emlowenergy") {            << 236   } else if (name == "emlowenergy") {
221     fEmName = name;                               237     fEmName = name;
222     delete fEmPhysicsList;                        238     delete fEmPhysicsList;
223     fEmPhysicsList = new G4EmLowEPPhysics();      239     fEmPhysicsList = new G4EmLowEPPhysics();
224   }                                            << 240 
225   else if (name == "emlivermore") {            << 241   } else if (name == "emlivermore") {
226     fEmName = name;                               242     fEmName = name;
227     delete fEmPhysicsList;                        243     delete fEmPhysicsList;
228     fEmPhysicsList = new G4EmLivermorePhysics(    244     fEmPhysicsList = new G4EmLivermorePhysics();
229   }                                            << 245                         
230   else if (name == "dna") {                    << 246   } else if (name == "dna") {
231     fEmName = name;                               247     fEmName = name;
232     delete fEmPhysicsList;                        248     delete fEmPhysicsList;
233     fEmPhysicsList = new G4EmDNAPhysics();        249     fEmPhysicsList = new G4EmDNAPhysics();
234   }                                            << 250                         
235   else if (name == "dna_opt2") {               << 251   } else if (name == "dna_opt2") {
236     fEmName = name;                               252     fEmName = name;
237     delete fEmPhysicsList;                        253     delete fEmPhysicsList;
238     fEmPhysicsList = new G4EmDNAPhysics_option    254     fEmPhysicsList = new G4EmDNAPhysics_option2();
239   }                                            << 255                         
240   else if (name == "dna_opt4") {               << 256   } else if (name == "dna_opt4") {
241     fEmName = name;                               257     fEmName = name;
242     delete fEmPhysicsList;                        258     delete fEmPhysicsList;
243     fEmPhysicsList = new G4EmDNAPhysics_option    259     fEmPhysicsList = new G4EmDNAPhysics_option4();
244   }                                            << 260                         
245   else if (name == "dna_opt6") {               << 261   } else if (name == "dna_opt6") {
246     fEmName = name;                               262     fEmName = name;
247     delete fEmPhysicsList;                        263     delete fEmPhysicsList;
248     fEmPhysicsList = new G4EmDNAPhysics_option    264     fEmPhysicsList = new G4EmDNAPhysics_option6();
249   }                                            << 265 
250   else if (name == "had_elastic" && !fHadPhysi << 266   } else if (name == "had_elastic" && !fHadPhysicsList) {
251     fHadPhysicsList = new G4HadronElasticPhysi    267     fHadPhysicsList = new G4HadronElasticPhysics();
252   }                                            << 268                         
253   else {                                       << 269   } else {
                                                   >> 270 
254     G4cout << "PhysicsList::AddPhysicsList: <"    271     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
255            << " is not defined" << G4endl;     << 272            << " is not defined"
                                                   >> 273            << G4endl;
256   }                                               274   }
257 }                                                 275 }
258                                                   276 
259 //....oooOO0OOooo........oooOO0OOooo........oo    277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
260                                                   278