Geant4_10
ExGflashPhysicsList.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 // $Id: ExGflashPhysicsList.cc 70923 2013-06-07 13:10:39Z gcosmo $
27 //
30 //
31 #include "ExGflashPhysicsList.hh"
32 
33 #include "globals.hh"
34 #include "G4ParticleDefinition.hh"
35 #include "G4ParticleWithCuts.hh"
36 #include "G4ProcessManager.hh"
37 #include "G4ProcessVector.hh"
38 #include "G4ParticleTypes.hh"
39 #include "G4ParticleTable.hh"
40 #include "G4Material.hh"
41 #include "G4MaterialTable.hh"
42 #include "G4Region.hh"
43 #include "G4RegionStore.hh"
44 #include "G4ios.hh"
45 #include <iomanip>
46 
48 
49 using namespace std;
50 
52 {
53  SetVerboseLevel(0);
54 }
55 
57 {
58 }
59 
61 {
62  // In this method, static member functions should be called
63  // for all particles which you want to use.
64  // This ensures that objects of these particle types will be
65  // created in the program.
66 
67  std::cout<<"start construct particle"<<std::endl;
72  ConstructIons();
73  std::cout<<"end construct particle"<<std::endl;
74 }
75 
77 {
78  // pseudo-particles
81 
82  // gamma
84 
85  // optical photon
87 }
88 
89 #include "G4LeptonConstructor.hh"
91 {
92  // Construct all leptons
93  G4LeptonConstructor pConstructor;
94  pConstructor.ConstructParticle();
95 }
96 
97 #include "G4MesonConstructor.hh"
99 {
100  // Construct all mesons
101  G4MesonConstructor pConstructor;
102  pConstructor.ConstructParticle();
103 }
104 
105 #include "G4BaryonConstructor.hh"
107 {
108  // Construct all barions
109  G4BaryonConstructor pConstructor;
110  pConstructor.ConstructParticle();
111 }
112 
113 #include "G4IonConstructor.hh"
115 {
116  // Construct light ions
117  G4IonConstructor pConstructor;
118  pConstructor.ConstructParticle();
119 }
120 
122 {
125  std::cout<<"AddParameterisation"<<std::endl;
126 
127  ConstructEM();
128  std::cout<<"ConstructEM"<<std::endl;
130 }
131 
132 
134 {
136 }
137 
138 #include "G4ComptonScattering.hh"
139 #include "G4GammaConversion.hh"
140 #include "G4PhotoElectricEffect.hh"
141 
142 #include "G4eMultipleScattering.hh"
143 #include "G4MuMultipleScattering.hh"
144 #include "G4hMultipleScattering.hh"
145 
146 #include "G4eIonisation.hh"
147 #include "G4eBremsstrahlung.hh"
148 #include "G4eplusAnnihilation.hh"
149 
150 #include "G4UserLimits.hh"
151 
152 #include "G4MuIonisation.hh"
153 #include "G4MuBremsstrahlung.hh"
154 #include "G4MuPairProduction.hh"
155 
156 #include "G4hIonisation.hh"
158 {
159 
160  G4cout<<"Physics List constructor"<<G4endl;
161  SetCuts();
162  theParticleIterator->reset();
163  while( (*theParticleIterator)() ){
164  G4ParticleDefinition* particle = theParticleIterator->value();
165  G4ProcessManager* pmanager = particle->GetProcessManager();
166  G4String particleName = particle->GetParticleName();
167 
168  if (particleName == "gamma") {
169  // gamma
170  // Construct processes for gamma
171  G4VProcess* theGammaConversion = new G4GammaConversion();
172  G4VProcess* theComptonScattering = new G4ComptonScattering();
173  G4VProcess* thePhotoElectricEffect = new G4PhotoElectricEffect();
174  // G4VProcess* thegammacut = new G4UserLimits();
175  // thegammacut->SetUserMinEkine(1.0*MeV);
176 
177  pmanager->AddDiscreteProcess(theGammaConversion);
178  pmanager->AddDiscreteProcess(theComptonScattering);
179  pmanager->AddDiscreteProcess(thePhotoElectricEffect);
180  // pmanager->AddProcess(thegammacut);
181  // G4cout <<"theGammaConversion" << theGammaConversion <<endl;
182  //G4cout <<"theComptonScattering" << theComptonScattering <<endl;
183  //G4cout <<"thePhotoElectricEffect" << thePhotoElectricEffect <<endl;
184 
185  } else if (particleName == "e-") {
186  //electron
187  // Construct processes for electron
188  G4VProcess* theeminusMultipleScattering = new G4eMultipleScattering();
189  G4VProcess* theeminusIonisation = new G4eIonisation();
190  G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
191  // G4VProcess* theeminuscut = new G4UserLimits();
192  // theeminuscut->SetUserMinEkine(1.0*MeV);
193  // add processes
194  pmanager->AddProcess(theeminusMultipleScattering);
195  pmanager->AddProcess(theeminusIonisation);
196  pmanager->AddProcess(theeminusBremsstrahlung);
197 
198  // pmanager->AddProcess( theeminuscut);
199 
200 
201 
202  // set ordering for AlongStepDoIt
203  pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep, 1);
204  pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep, 2);
205  // set ordering for PostStepDoIt
206  pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1);
207  pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2);
208  pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3);
209 
210  //G4cout <<"theeminusMultipleScattering" << theeminusMultipleScattering <<endl;
211  //G4cout <<"theeminusIonisation" << theeminusIonisation <<endl;
212  //G4cout <<"theeminusBremsstrahlung" << theeminusBremsstrahlung <<endl;
213 
214  } else if (particleName == "e+") {
215  //positron
216  // Construct processes for positron
217  G4VProcess* theeplusMultipleScattering = new G4eMultipleScattering();
218  G4VProcess* theeplusIonisation = new G4eIonisation();
219  G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
220  G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
221  // add processes
222  pmanager->AddProcess(theeplusMultipleScattering);
223  pmanager->AddProcess(theeplusIonisation);
224  pmanager->AddProcess(theeplusBremsstrahlung);
225  pmanager->AddProcess(theeplusAnnihilation);
226  // set ordering for AtRestDoIt
227  pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
228  // set ordering for AlongStepDoIt
229  pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep, 1);
230  pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep, 2);
231  // set ordering for PostStepDoIt
232  pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1);
233  pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2);
234  pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3);
235  pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);
236 
237  //G4cout <<"theeplusMultipleScattering" << theeplusMultipleScattering <<endl;
238  //G4cout <<"theeplusIonisation" << theeplusIonisation <<endl;
239  //G4cout <<"theeplusBremsstrahlung" << theeplusBremsstrahlung <<endl;
240 
241  } else if( particleName == "mu+" ||
242  particleName == "mu-" ) {
243  //muon
244  // Construct processes for muon+
245  G4VProcess* aMultipleScattering = new G4MuMultipleScattering();
246  G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
247  G4VProcess* aPairProduction = new G4MuPairProduction();
248  G4VProcess* anIonisation = new G4MuIonisation();
249  // add processes
250  pmanager->AddProcess(anIonisation);
251  pmanager->AddProcess(aMultipleScattering);
252  pmanager->AddProcess(aBremsstrahlung);
253  pmanager->AddProcess(aPairProduction);
254  // set ordering for AlongStepDoIt
255  pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
256  pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
257  // set ordering for PostStepDoIt
258  pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
259  pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
260  pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3);
261  pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4);
262 
263  } else if ((!particle->IsShortLived()) &&
264  (particle->GetPDGCharge() != 0.0) &&
265  (particle->GetParticleName() != "chargedgeantino")) {
266  // all others charged particles except geantino
267  G4VProcess* aMultipleScattering = new G4hMultipleScattering();
268  G4VProcess* anIonisation = new G4hIonisation();
269  // add processes
270  pmanager->AddProcess(anIonisation);
271  pmanager->AddProcess(aMultipleScattering);
272  // set ordering for AlongStepDoIt
273  pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep, 1);
274  pmanager->SetProcessOrdering(anIonisation, idxAlongStep, 2);
275  // set ordering for PostStepDoIt
276  pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
277  pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
278  }
279  }
280 }
281 
282 
283 #include "G4Decay.hh"
285 {
286  // Add Decay Process
287  G4Decay* theDecayProcess = new G4Decay();
288  //G4cout << "decay" <<theDecayProcess<<endl;
289  theParticleIterator->reset();
290  while( (*theParticleIterator)() ){
291  G4ParticleDefinition* particle = theParticleIterator->value();
292  G4ProcessManager* pmanager = particle->GetProcessManager();
293  if (theDecayProcess->IsApplicable(*particle)) {
294  pmanager ->AddProcess(theDecayProcess);
295  // set ordering for PostStepDoIt and AtRestDoIt
296  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
297  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
298  }
299  }
300 }
301 
302 // WARNING: This methode is mandatory if U want to use GFLASH
304 {
306  theFastSimulationManagerProcess =
308  G4cout << "FastSimulationManagerProcess" <<G4endl;
309  theParticleIterator->reset();
310  //std::cout<<"---"<<std::endl;
311  while( (*theParticleIterator)() ){
312  //std::cout<<"+++"<<std::endl;
313 
314  G4ParticleDefinition* particle = theParticleIterator->value();
315  // std::cout<<"--- particle "<<particle->GetParticleName()<<std::endl;
316  G4ProcessManager* pmanager = particle->GetProcessManager();
317  // The fast simulation process becomes a discrete process only since 9.0:
318  pmanager->AddDiscreteProcess(theFastSimulationManagerProcess);
319  }
320 }
321 
323 {
324  if (verboseLevel >1){
325  G4cout << "ExGflashPhysicsList::SetCuts:";
326  }
327  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
328  // the default cut value for all particle types
331  // SetCutValue(100*mm, "gamma");
332 // SetCutValue(0*mm, "e-");
333 // SetCutValue(0*mm, "e+");
334 
335 // SetCutValue(62*mm, "gamma");
336 // SetCutValue(0.73*mm, "e-");
337 // SetCutValue(0.78*mm, "e+");
338 
339 
340 
341 
342 
344 // set cuts for region crystals with default Cuts
345  G4Region* region = G4RegionStore::GetInstance()->GetRegion("crystals");
346  region->SetProductionCuts(
347  G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
348 }
349 
350 
351 
352 
353 
354 
355 
356 
357 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
virtual void ConstructGeneral()
void SetProcessOrderingToFirst(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
virtual void AddTransportation()
static void ConstructParticle()
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
virtual void ConstructMesons()
virtual void ConstructLeptons()
const G4String & GetParticleName() const
static void ConstructParticle()
static G4RegionStore * GetInstance()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
virtual void ConstructBaryons()
virtual void ConstructProcess()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static void ConstructParticle()
static G4ProductionCutsTable * GetProductionCutsTable()
static G4ChargedGeantino * ChargedGeantinoDefinition()
#define G4endl
Definition: G4ios.hh:61
void SetProductionCuts(G4ProductionCuts *cut)
static G4OpticalPhoton * OpticalPhotonDefinition()
Definition of the ExGflashPhysicsList class.
virtual void ConstructIons()
G4double GetPDGCharge() const
virtual void ConstructParticle()
virtual void ConstructBosons()
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81