Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
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 "G4PhysListFactory.hh"
80 #include "G4VPhysicsConstructor.hh"
81 
82 // Physic lists (contained inside the Geant4 distribution)
84 #include "G4EmLivermorePhysics.hh"
85 #include "G4EmPenelopePhysics.hh"
86 #include "G4DecayPhysics.hh"
88 #include "G4HadronInelasticQBBC.hh"
90 #include "G4Decay.hh"
91 
92 #include "G4LossTableManager.hh"
93 #include "G4UnitsTable.hh"
94 #include "G4ProcessManager.hh"
95 
96 #include "G4IonFluctuations.hh"
98 #include "G4EmProcessOptions.hh"
99 
102 {
104  defaultCutValue = 1.*mm;
108 
109  helIsRegisted = false;
110  bicIsRegisted = false;
111  biciIsRegisted = false;
113 
114  stepMaxProcess = 0;
115 
117 
118  SetVerboseLevel(1);
119 
120  // EM physics
122  emName = G4String("emstandard_opt3");
123 
124 // emPhysicsList = new G4EmLivermorePhysics();
125 // emName = G4String("LowE_Livermore");
126 
127  // Deacy physics and all particles
129 }
130 
133 {
134  delete pMessenger;
135  delete emPhysicsList;
136  delete decPhysicsList;
137  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
138 }
139 
142 {
143  G4PhysListFactory factory;
144  G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
145  G4int i=0;
146  const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
147  G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
148  while (elem !=0)
149  {
150  RegisterPhysics(tmp);
151  elem= phys->GetPhysics(++i) ;
152  tmp = const_cast<G4VPhysicsConstructor*> (elem);
153  }
154  G4cout << "THE FOLLOWING PHYSICS PACKEGE LIST HAS BEEN ACTIVATED: "<<name<< G4endl;
155 }
156 
159 {
161 }
162 
165 {
166  // transportation
167  //
169 
170  // electromagnetic physics list
171  //
174 
175  // decay physics list
176  //
178 
179  // hadronic physics lists
180  for(size_t i=0; i<hadronPhys.size(); i++) {
181  hadronPhys[i]->ConstructProcess();
182  }
183 
184  // step limitation (as a full process)
185  //
186  AddStepMax();
187 }
188 
191 {
192 
193  if (verboseLevel>1) {
194  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
195  }
196  if (name == emName) return;
197 
199  // ELECTROMAGNETIC MODELS
201 
202  if (name == "standard_opt3") {
203  emName = name;
204  delete emPhysicsList;
206  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
207 
208  } else if (name == "LowE_Livermore") {
209  emName = name;
210  delete emPhysicsList;
212  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
213 
214  } else if (name == "LowE_Penelope") {
215  emName = name;
216  delete emPhysicsList;
218  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
219 
221  // HADRONIC MODELS
223  } else if (name == "elastic" && !helIsRegisted) {
224  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
225  hadronPhys.push_back( new G4HadronElasticPhysics());
226  helIsRegisted = true;
227 
228  } else if (name == "binary" && !bicIsRegisted) {
229  hadronPhys.push_back(new G4HadronInelasticQBBC());
230  bicIsRegisted = true;
231  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
232 
233  } else if (name == "binary_ion" && !biciIsRegisted) {
234  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
235  biciIsRegisted = true;
236 
237  } else {
238 
239  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
240  << " is not defined"
241  << G4endl;
242  }
243 }
244 
247 {
248  // Step limitation seen as a process
249  stepMaxProcess = new ML2StepMax();
250 
252  particleIterator->reset();
253  while ((*particleIterator)()){
254  G4ParticleDefinition* particle = particleIterator->value();
255  G4ProcessManager* pmanager = particle->GetProcessManager();
256 
257  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
258  {
260  }
261  }
262 }
263 
266 {
267 
268  if (verboseLevel >0){
269  G4cout << "PhysicsList::SetCuts:";
270  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
271  }
272 
273  // set cut values for gamma at first and for e- second and next for e+,
274  // because some processes for e+/e- need cut values for gamma
275  SetCutValue(cutForGamma, "gamma");
278 
280 }
281 
284 {
285  cutForGamma = cut;
287 }
288 
291 {
292  cutForElectron = cut;
294 }
295 
298 {
299  cutForPositron = cut;
301 }
302 
303 
const XML_Char * name
Definition: expat.h:151
void SetCutForElectron(G4double)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static constexpr double mm
Definition: G4SIunits.hh:115
#define G4endl
Definition: G4ios.hh:61
void AddPackage(const G4String &name)
G4double cutForPositron
ML2StepMax * stepMaxProcess
Float_t tmp
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4EmConfigurator em_config
G4double cutForElectron
virtual void ConstructParticle()=0
virtual void ConstructProcess()=0
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
double G4double
Definition: G4Types.hh:76
const G4VPhysicsConstructor * GetPhysics(G4int index) const
void SetCutForPositron(G4double)
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void RegisterPhysics(G4VPhysicsConstructor *)
G4double cutForGamma
G4VPhysicsConstructor * decPhysicsList
void SetCutForGamma(G4double)
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4bool locIonIonInelasticIsRegistered
static G4Electron * Electron()
Definition: G4Electron.cc:94
std::vector< G4VPhysicsConstructor * > hadronPhys
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4bool IsApplicable(const G4ParticleDefinition &)
Definition: ML2StepMax.cc:72
void AddPhysicsList(const G4String &name)
int G4int
Definition: G4Types.hh:78
G4ProcessManager * GetProcessManager() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
ML2PhysicsListMessenger * pMessenger
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
virtual ~ML2PhysicsList()
void DumpCutValuesTable(G4int flag=1)
G4VPhysicsConstructor * emPhysicsList
void ConstructParticle()
void SetVerboseLevel(G4int value)