ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ML2PhysicsList.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ML2PhysicsList.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 //*******************************************************//
42 //
43 // This class provides all the physic models that can be activated inside ML2;
44 // Each model can be setted via macro commands;
45 // Inside ML2 the models can be activate with three different complementar methods:
46 //
47 // 1. Use of the *Packages*.
48 // Packages (that are contained inside the
49 // Geant4 distribution at $G4INSTALL/source/physics_lists/lists) provide a full set
50 // of models (both electromagnetic and hadronic).
51 // The User can use this method simply add the line /physic/addPackage <nameOfPackage>
52 // in his/her macro file. No other action is required.
53 // For ML2 applications we suggest the use of the QGSP_BIC package
54 // for proton beams. The same can be used
55 // also for ligth ion beam.
56 //
57 //
58 // 2. Use of the *Physic Lists*.
59 // Physic lists are also already ready to use inside the Geant4 distribution
60 // ($G4INSTALL/source/physics_lists/builders). To use them the simple
61 // /physic/addPhysics <nameOfPhysicList> command must be used in the macro.
62 // In ML2 we provide physics list to activate Electromagnetic,
63 // Hadronic elastic and Hadronic inelastic models.
64 //
65 // For ML2 we suggest the use of:
66 //
67 // /physic/addPhysic/emstandard_option3 (electromagnetic model)
68 // /physic/addPhysic/elastic (hadronic elastic model)
69 // /physic/addPhysic/binary (hadronic inelastic models for proton and neutrons)
70 // /physic/addPhysic/binary_ion (hadronic inelastic models for ions)
71 //
72 // Example of the use of physics lists can be found in the macro files
73 //
74 
75 #include "ML2PhysicsList.hh"
77 #include "ML2StepMax.hh"
78 #include "G4SystemOfUnits.hh"
79 #include "G4VPhysicsConstructor.hh"
80 
81 // Physics lists
84 #include "G4EmLivermorePhysics.hh"
85 #include "G4EmPenelopePhysics.hh"
86 #include "G4DecayPhysics.hh"
88 #include "G4HadronInelasticQBBC.hh"
90 #include "G4Decay.hh"
91 
92 #include "G4UnitsTable.hh"
93 #include "G4ProcessManager.hh"
94 
97 {
98  defaultCutValue = 1.*mm;
99  helIsRegisted = false;
100  bicIsRegisted = false;
101  biciIsRegisted = false;
103 
104  stepMaxProcess = nullptr;
105 
107 
108  SetVerboseLevel(1);
109 
110  // EM physics
112  emName = G4String("emstandard_opt3");
113 
114  // emPhysicsList = new G4EmLivermorePhysics();
115  // emName = G4String("LowE_Livermore");
116 
117  // Decay physics and all particles
119 }
120 
123 {
124  delete pMessenger;
125  delete emPhysicsList;
126  delete decPhysicsList;
127  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
128 }
129 
132 {
134 }
135 
138 {
139  // transportation
140  //
142 
143  // electromagnetic physics list
144  //
146 
147  // decay physics list
148  //
150 
151  // hadronic physics lists
152  for(size_t i=0; i<hadronPhys.size(); i++) {
153  hadronPhys[i]->ConstructProcess();
154  }
155 
156  // step limitation (as a full process)
157  //
158  AddStepMax();
159 }
160 
163 {
164 
165  if (verboseLevel>1) {
166  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
167  }
168  if (name == emName) return;
169 
171  // ELECTROMAGNETIC MODELS
173 
174  if (name == "standard_opt3") {
175  emName = name;
176  delete emPhysicsList;
178  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
179 
180  } else if (name == "standard_opt4") {
181  emName = name;
182  delete emPhysicsList;
184  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl;
185 
186  } else if (name == "LowE_Livermore") {
187  emName = name;
188  delete emPhysicsList;
190  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
191 
192  } else if (name == "LowE_Penelope") {
193  emName = name;
194  delete emPhysicsList;
196  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
197 
199  // HADRONIC MODELS
201  } else if (name == "elastic" && !helIsRegisted) {
202  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
203  hadronPhys.push_back( new G4HadronElasticPhysics());
204  helIsRegisted = true;
205 
206  } else if (name == "binary" && !bicIsRegisted) {
207  hadronPhys.push_back(new G4HadronInelasticQBBC());
208  bicIsRegisted = true;
209  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
210 
211  } else if (name == "binary_ion" && !biciIsRegisted) {
212  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
213  biciIsRegisted = true;
214 
215  } else {
216 
217  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
218  << " is not defined"
219  << G4endl;
220  }
221 }
222 
225 {
226  // Step limitation seen as a process
227  stepMaxProcess = new ML2StepMax();
228 
230  particleIterator->reset();
231  while ((*particleIterator)()){
233  G4ProcessManager* pmanager = particle->GetProcessManager();
234 
235  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
236  {
238  }
239  }
240 }
241 
242 
243