Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
HadrontherapyPhysicsList.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 // Hadrontherapy advanced example for Geant4
27 // See more at: https://twiki.cern.ch/twiki/bin/view/Geant4/AdvancedExamplesHadrontherapy
28 //
29 //
30 // ****** SUGGESTED PHYSICS FOR ACCURATE SIMULATIONS *********
31 // ****** IN MEDICAL PHYSICS APPLI CATIONS *********
32 //
33 // 'HADRONTHERAPY_1' and 'HADRONTHERAPY_2' are both suggested;
34 // It can be activated inside any macro file using the command:
35 // /Physics/addPhysics HADRONTHERAPY_1 (HADRONTHERAPY_2)
36 
37 #include "G4SystemOfUnits.hh"
38 #include "G4RunManager.hh"
39 #include "G4Region.hh"
40 #include "G4RegionStore.hh"
43 #include "HadrontherapyStepMax.hh"
44 #include "G4PhysListFactory.hh"
45 #include "G4VPhysicsConstructor.hh"
49 #include "G4EmStandardPhysics.hh"
50 #include "G4EmExtraPhysics.hh"
51 #include "G4StoppingPhysics.hh"
52 #include "G4DecayPhysics.hh"
57 #include "G4DecayPhysics.hh"
58 #include "G4NeutronTrackingCut.hh"
59 #include "G4LossTableManager.hh"
60 #include "G4UnitsTable.hh"
61 #include "G4ProcessManager.hh"
62 #include "G4IonFluctuations.hh"
64 #include "G4EmProcessOptions.hh"
66 #include "G4EmLivermorePhysics.hh"
67 #include "G4AutoDelete.hh"
68 
71 {
73  defaultCutValue = 1.*mm;
77 
79  SetVerboseLevel(1);
80  decay_List = new G4DecayPhysics();
81  // Elecromagnetic physics
82  //
84 
85 }
86 
89 {
90  delete pMessenger;
91  delete emPhysicsList;
92  delete decay_List;
93  //delete radioactiveDecay_List;
94  hadronPhys.clear();
95  for(size_t i=0; i<hadronPhys.size(); i++)
96  {
97  delete hadronPhys[i];
98  }
99 }
100 
103 {
105 
106 }
107 
110 {
111  // Transportation
112  //
114 
117 
118 
119  //em_config.AddModels();
120 
121  // Hadronic physics
122  //
123  for(size_t i=0; i < hadronPhys.size(); i++)
124  {
126  }
127 
128  // step limitation (as a full process)
129  //
130  AddStepMax();
131 
132  //Parallel world sensitivity
133  //
134  G4ParallelWorldPhysics* pWorld = new G4ParallelWorldPhysics("DetectorROGeometry");
135  pWorld->ConstructProcess();
136 
137  return;
138 }
139 
142 {
143  if (verboseLevel>1) {
144  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
145  }
146  if (name == emName) return;
147 
149  // ELECTROMAGNETIC MODELS
151  if (name == "standard_opt4") {
152  emName = name;
153  delete emPhysicsList;
154  hadronPhys.clear();
156  G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
157  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option4" << G4endl;
158 
160  // ELECTROMAGNETIC + HADRONIC MODELS
162 
163  } else if (name == "HADRONTHERAPY_1") {
164 
165  AddPhysicsList("standard_opt4");
166  hadronPhys.push_back( new G4DecayPhysics());
167  hadronPhys.push_back( new G4RadioactiveDecayPhysics());
168  hadronPhys.push_back( new G4IonBinaryCascadePhysics());
169  hadronPhys.push_back( new G4EmExtraPhysics());
170  hadronPhys.push_back( new G4HadronElasticPhysicsHP());
171  hadronPhys.push_back( new G4StoppingPhysics());
172  hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC_HP());
173  hadronPhys.push_back( new G4NeutronTrackingCut());
174 
175  G4cout << "HADRONTHERAPY_1 PHYSICS LIST has been activated" << G4endl;
176  }
177 
178  else if (name == "HADRONTHERAPY_2") {
179  // HP models are switched off
180  AddPhysicsList("standard_opt4");
181  hadronPhys.push_back( new G4DecayPhysics());
182  hadronPhys.push_back( new G4RadioactiveDecayPhysics());
183  hadronPhys.push_back( new G4IonBinaryCascadePhysics());
184  hadronPhys.push_back( new G4EmExtraPhysics());
185  hadronPhys.push_back( new G4HadronElasticPhysics());
186  hadronPhys.push_back( new G4StoppingPhysics());
187  hadronPhys.push_back( new G4HadronPhysicsQGSP_BIC());
188  hadronPhys.push_back( new G4NeutronTrackingCut());
189 
190  G4cout << "HADRONTHERAPY_2 PHYSICS LIST has been activated" << G4endl; }
191  else {
192  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
193  << " is not defined"
194  << G4endl;
195  }
196 
197 }
198 
201 {
202  // Step limitation seen as a process
203  // This process must exist in all threads.
204  //
205  HadrontherapyStepMax* stepMaxProcess = new HadrontherapyStepMax();
206  G4AutoDelete::Register( stepMaxProcess );
207 
209  particleIterator->reset();
210  while ((*particleIterator)()){
211  G4ParticleDefinition* particle = particleIterator->value();
212  G4ProcessManager* pmanager = particle->GetProcessManager();
213 
214  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
215  {
216  pmanager ->AddDiscreteProcess(stepMaxProcess);
217  }
218  }
219 }
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:80
const XML_Char * name
Definition: expat.h:151
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static constexpr double mm
Definition: G4SIunits.hh:115
#define G4endl
Definition: G4ios.hh:61
HadrontherapyPhysicsListMessenger * pMessenger
void AddPhysicsList(const G4String &name)
void Register(T *inst)
Definition: G4AutoDelete.hh:65
std::vector< G4VPhysicsConstructor * > hadronPhys
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4VPhysicsConstructor * decay_List
G4VPhysicsConstructor * emPhysicsList
G4bool IsApplicable(const G4ParticleDefinition &)
G4ProcessManager * GetProcessManager() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
static G4LossTableManager * Instance()
void SetVerboseLevel(G4int value)