Geant4  10.00.p02
HadrontherapyPhysicsList.cc
Go to the documentation of this file.
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 // This is the *BASIC* version of Hadrontherapy, a Geant4-based application
27 // See more at: http://g4advancedexamples.lngs.infn.it/Examples/hadrontherapy
28 //
29 // Visit the Hadrontherapy web site (http://www.lns.infn.it/link/Hadrontherapy) to request
30 // the *COMPLETE* version of this program, together with its documentation;
31 // Hadrontherapy (both basic and full version) are supported by the Italian INFN
32 // Institute in the framework of the MC-INFN Group
33 //
34 //
35 // Hadrontherapy Users are recommended to use the prepared macro files in order to activate the
36 // most appropriate physics for hadrontherapy applications.
37 // As one can easily see the physics we suggest is contained in the
38 // 'QGSP_BIC_EMY' list adding to the decay processes (activated as default).
39 //
40 //
41 // ****** SUGGESTED PHYSICS *********
42 //
43 // AT MOMENT, IF ACCURATE RESULTS ARE NEEDED, WE STRONGLY RECOMMEND:
44 // 1. The use of the macro 'hadron_therapy.mac', that is connected with the HadrontherapyPhysicsList.cc file.
45 // 2. the QGSP_BIC_EMY Reference Physics Lists (define the PHYSLIST eviroment variable):
46 // export PHYSLIST=QGSP_BIC_EMY
47 // User must considered that, in this second case, radioactive processes are not activated
48 
49 #include "G4SystemOfUnits.hh"
50 #include "G4RunManager.hh"
51 #include "G4Region.hh"
52 #include "G4RegionStore.hh"
55 #include "HadrontherapyStepMax.hh"
56 #include "G4PhysListFactory.hh"
57 #include "G4VPhysicsConstructor.hh"
58 
59 // Local physic directly implemented in the Hadronthrapy directory
60 #include "LocalIonIonInelasticPhysic.hh" // Physic dedicated to the ion-ion inelastic processes
61 
62 // Physic lists (contained inside the Geant4 source code, in the 'physicslists folder')
65 #include "G4EmLivermorePhysics.hh"
66 #include "G4EmPenelopePhysics.hh"
67 #include "G4EmExtraPhysics.hh"
68 #include "G4StoppingPhysics.hh"
69 #include "G4DecayPhysics.hh"
74 #include "G4DecayPhysics.hh"
75 #include "G4NeutronTrackingCut.hh"
76 #include "G4LossTableManager.hh"
77 #include "G4UnitsTable.hh"
78 #include "G4ProcessManager.hh"
79 #include "G4IonFluctuations.hh"
81 #include "G4EmProcessOptions.hh"
83 
86 {
88  defaultCutValue = 1.*mm;
92 
93  helIsRegistered = false;
94  bicIsRegistered = false;
95  biciIsRegistered = false;
98 
99  stepMaxProcess = 0;
100 
102 
103  SetVerboseLevel(1);
104 
105  // ****** Definition of some defaults for the physics *****
106  // ****** in case no physics is called by the macro file *****
107  // EM physics
109  emName = G4String("emstandard_opt3");
110 
111  // Decay physics and all particles
114 }
115 
118 {
119  delete pMessenger;
120  delete emPhysicsList;
121  delete decPhysicsList;
122  delete raddecayList;
123 
124  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
125 }
126 
129 {
131 }
132 
135 {
136  // transportation
138 
139  // electromagnetic physics list
142 
143  // decay physics list
146 
147  // hadronic physics lists
148  for(size_t i=0; i<hadronPhys.size(); i++) {
150  }
151 
152  // step limitation (as a full process)
153  //
154  AddStepMax();
155 
156  //Parallel world sensitivity
157  G4ParallelWorldPhysics* pWorld = new G4ParallelWorldPhysics("DetectorROGeometry");
158  pWorld->ConstructProcess();
159 
160  return;
161 }
162 
165 {
166 
167  if (verboseLevel>1) {
168  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
169  }
170  if (name == emName) return;
171 
173  // ELECTROMAGNETIC MODELS
175  if (name == "standard_opt3") {
176  emName = name;
177  delete emPhysicsList;
179  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
180  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
181 
182  } else if (name == "LowE_Livermore") {
183  emName = name;
184  delete emPhysicsList;
186  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
187  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
188 
189  } else if (name == "LowE_Penelope") {
190  emName = name;
191  delete emPhysicsList;
193  G4RunManager::GetRunManager()-> PhysicsHasBeenModified();
194  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmPenelopePhysics" << G4endl;
195 
196  } else if (name == "local_ion_ion_inelastic") {
197  hadronPhys.push_back(new LocalIonIonInelasticPhysic());
199 
200  } else if (name == "QGSP_BIC_EMY") {
201  AddPhysicsList("emstandard_opt3");
202  hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
203  hadronPhys.push_back( new G4EmExtraPhysics());
204  hadronPhys.push_back( new G4HadronElasticPhysics());
205  hadronPhys.push_back( new G4StoppingPhysics());
206  hadronPhys.push_back( new G4IonBinaryCascadePhysics());
207  hadronPhys.push_back( new G4NeutronTrackingCut());
208 
209  } else {
210  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
211  << " is not defined"
212  << G4endl;
213  }
214 }
215 
218 {
219  // Step limitation seen as a process
221 
222  theParticleIterator->reset();
223  while ((*theParticleIterator)()){
224  G4ParticleDefinition* particle = theParticleIterator->value();
225  G4ProcessManager* pmanager = particle->GetProcessManager();
226 
227  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
228  {
230  }
231  }
232 }
233 
236 {
237 
238  if (verboseLevel >0){
239  G4cout << "PhysicsList::SetCuts:";
240  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
241  }
242 
243  // set cut values for gamma at first and for e- second and next for e+,
244  // because some processes for e+/e- need cut values for gamma
245  SetCutValue(cutForGamma, "gamma");
248 
249  // Set cuts for detector
252 }
253 
256 {
257  cutForGamma = cut;
259 }
260 
263 {
264  cutForElectron = cut;
266 }
267 
270 {
271  cutForPositron = cut;
273 }
274 
276 {
277  G4String regionName = "DetectorLog";
278  G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName);
279 
280  G4ProductionCuts* cuts = new G4ProductionCuts ;
281  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("gamma"));
282  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e-"));
283  cuts -> SetProductionCut(cut,G4ProductionCuts::GetIndex("e+"));
284  region -> SetProductionCuts(cuts);
285 }
286 
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4LossTableManager * Instance()
static G4int GetIndex(const G4String &name)
void SetCutValue(G4double aCut, const G4String &pname)
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4VPhysicsConstructor * decPhysicsList
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
HadrontherapyStepMax * stepMaxProcess
G4bool IsApplicable(const G4ParticleDefinition &)
G4ProcessManager * GetProcessManager() const
static G4RegionStore * GetInstance()
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
void AddPhysicsList(const G4String &name)
HadrontherapyPhysicsListMessenger * pMessenger
std::vector< G4VPhysicsConstructor * > hadronPhys
G4VPhysicsConstructor * raddecayList
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:74
static G4Positron * Positron()
Definition: G4Positron.cc:94
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const double mm
Definition: G4SIunits.hh:102
G4VPhysicsConstructor * emPhysicsList
#define theParticleIterator