Geant4  10.02.p03
F01PhysicsList.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 //
28 //
29 //
30 // $Id: F01PhysicsList.cc 102356 2017-01-23 16:22:42Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "G4Timer.hh"
37 
38 #include "F01PhysicsList.hh"
41 
42 #include "G4ProcessManager.hh"
43 #include "G4ProcessVector.hh"
44 #include "G4ParticleTypes.hh"
45 #include "G4ParticleTable.hh"
46 #include "G4Material.hh"
47 #include "G4EnergyLossTables.hh"
48 #include "G4UnitsTable.hh"
49 #include "G4SystemOfUnits.hh"
50 
51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52 
54 : G4VUserPhysicsList(), fMaxChargedStep(DBL_MAX)
55 {
56  fDet = p;
57 
58  defaultCutValue = 1.000*mm;
59 
62 
63  SetVerboseLevel(1);
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71  delete fPhysicsListMessenger;
72 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77 {
78  // In this method, static member functions should be called
79  // for all particles which you want to use.
80  // This ensures that objects of these particle types will be
81  // created in the program.
82 
87 
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  // gamma
96 
98 
99  // charged geantino
100 
102 
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
109  // leptons
110 
115 
120 }
121 
122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
123 
125 {
126  // mesons
127 
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
138 {
139  // barions
140 
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
150 
151  ConstructEM();
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156 
157 #include "G4ComptonScattering.hh"
158 #include "G4GammaConversion.hh"
159 #include "G4PhotoElectricEffect.hh"
160 
161 #include "G4eMultipleScattering.hh"
162 #include "G4MuMultipleScattering.hh"
163 #include "G4hMultipleScattering.hh"
164 
165 #include "G4eIonisation.hh"
166 #include "G4eBremsstrahlung.hh"
167 #include "G4eplusAnnihilation.hh"
168 
169 #include "G4MuIonisation.hh"
170 #include "G4MuBremsstrahlung.hh"
171 #include "G4MuPairProduction.hh"
172 
173 #include "G4hIonisation.hh"
174 
175 #include "F01StepCut.hh"
176 
178 {
180  particleIterator->reset();
181 
182  while( (*particleIterator)() )
183  {
184  G4ParticleDefinition* particle = particleIterator->value();
185  G4ProcessManager* pmanager = particle->GetProcessManager();
186  G4String particleName = particle->GetParticleName();
187 
188  if (particleName == "gamma")
189  {
190  // Construct processes for gamma
191 
195 
196  pmanager->AddDiscreteProcess(fPhotoElectricEffect);
197  pmanager->AddDiscreteProcess(fComptonScattering);
198 
199  pmanager->AddDiscreteProcess(fGammaConversion);
200  }
201  else if (particleName == "e-")
202  {
203  // Construct processes for electron
204 
205  G4eIonisation* feminusIonisation = new G4eIonisation();
206  G4eBremsstrahlung* feminusBremsstrahlung = new G4eBremsstrahlung();
207  F01StepCut* feminusStepCut = new F01StepCut();
208  feminusStepCut->SetMaxStep(fMaxChargedStep);
209 
210  pmanager->AddProcess(feminusIonisation,-1,2,2);
211  pmanager->AddProcess(feminusBremsstrahlung,-1,-1,3);
212  pmanager->AddProcess(feminusStepCut,-1,-1,4);
213  }
214  else if (particleName == "e+")
215  {
216  // Construct processes for positron
217 
218  G4eIonisation* feplusIonisation = new G4eIonisation();
219  G4eBremsstrahlung* feplusBremsstrahlung = new G4eBremsstrahlung();
220  F01StepCut* feplusStepCut = new F01StepCut();
221  feplusStepCut->SetMaxStep(fMaxChargedStep);
222 
223  pmanager->AddProcess(feplusIonisation,-1,2,2);
224  pmanager->AddProcess(feplusBremsstrahlung,-1,-1,3);
225  pmanager->AddProcess(feplusStepCut,-1,-1,5);
226  }
227  else if( particleName == "mu+" || particleName == "mu-" )
228  {
229  // Construct processes for muon+
230 
231  F01StepCut* muonStepCut = new F01StepCut();
232  muonStepCut->SetMaxStep(fMaxChargedStep);
233  G4MuIonisation* muIonisation = new G4MuIonisation();
234 
235  pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
236  pmanager->AddProcess(muIonisation,-1,2,2);
237  pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
238  pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
239  pmanager->AddProcess(muonStepCut,-1,-1,3);
240  }
241  else if ( particleName == "proton"
242  || particleName == "antiproton"
243  || particleName == "pi+"
244  || particleName == "pi-"
245  || particleName == "kaon+"
246  || particleName == "kaon-"
247  )
248  {
249  F01StepCut* theHadronStepCut = new F01StepCut();
250  theHadronStepCut->SetMaxStep(10*mm);
251 
252  G4hIonisation* thehIonisation = new G4hIonisation();
253  G4hMultipleScattering* thehMultipleScattering =
254  new G4hMultipleScattering();
255 
256  pmanager->AddProcess(thehMultipleScattering,-1,1,1);
257  pmanager->AddProcess(thehIonisation,-1,2,2);
258  pmanager->AddProcess(theHadronStepCut,-1,-1,3);
259  }
260  }
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
264 
265 #include "G4Decay.hh"
266 
268 {
269  // Add Decay Process
270 
271  G4Decay* theDecayProcess = new G4Decay();
273  particleIterator->reset();
274 
275  while( (*particleIterator)() )
276  {
277  G4ParticleDefinition* particle = particleIterator->value();
278  G4ProcessManager* pmanager = particle->GetProcessManager();
279 
280  if (theDecayProcess->IsApplicable(*particle))
281  {
282  pmanager ->AddProcess(theDecayProcess);
283 
284  // set ordering for PostStepDoIt and AtRestDoIt
285 
286  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
287  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
288  }
289  }
290 }
291 
292 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
293 
295 {
296  G4Timer theTimer;
297  theTimer.Start();
298  if (verboseLevel >0)
299  {
300  G4cout << "F01PhysicsList::SetCuts:";
301  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
302  }
303  // set cut values for gamma at first and for e- second and next for e+,
304  // because some processes for e+/e- need cut values for gamma
305  SetCutValue(fCutForGamma,"gamma");
306 
309 
311 
312  theTimer.Stop();
313  G4cout.precision(6);
314  G4cout << G4endl;
315  G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed()
316  << " s " <<G4endl;
317 
318 }
319 
320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
321 
323 {
324  fCutForGamma = val;
325 }
326 
327 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
328 
330 {
331  fCutForElectron = val;
332 }
333 
334 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
335 
337 {
338  fMaxChargedStep = step;
339  G4cout << " MaxChargedStep=" << fMaxChargedStep << G4endl;
340  G4cout << G4endl;
341 }
342 
343 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
void SetMaxStep(G4double)
Definition: F01StepCut.cc:66
F01PhysicsListMessenger * fPhysicsListMessenger
F01PhysicsList(F01DetectorConstruction *)
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void SetElectronCut(G4double)
void ConstructBosons()
void SetCutValue(G4double aCut, const G4String &pname)
virtual void ConstructProcess()
G4double fMaxChargedStep
virtual void ConstructParticle()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:103
G4double fCutForGamma
Definition of the F01DetectorConstruction class.
void SetGammaCut(G4double)
const G4String & GetParticleName() const
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForElectron
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
Definition of the F01StepCut class.
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
G4double GetUserElapsed() const
Definition: G4Timer.cc:130
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
void Stop()
void SetMaxStep(G4double)
virtual ~F01PhysicsList()
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
F01DetectorConstruction * fDet
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
void Start()
double G4double
Definition: G4Types.hh:76
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
#define DBL_MAX
Definition: templates.hh:83
static const double mm
Definition: G4SIunits.hh:114
Definition of the F01PhysicsListMessenger class.
Definition of the F01PhysicsList class.
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81