Geant4  10.01
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 77792 2013-11-28 09:53:09Z 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 {
179  theParticleIterator->reset();
180 
181  while( (*theParticleIterator)() )
182  {
183  G4ParticleDefinition* particle = theParticleIterator->value();
184  G4ProcessManager* pmanager = particle->GetProcessManager();
185  G4String particleName = particle->GetParticleName();
186 
187  if (particleName == "gamma")
188  {
189  // Construct processes for gamma
190 
194 
195  pmanager->AddDiscreteProcess(fPhotoElectricEffect);
196  pmanager->AddDiscreteProcess(fComptonScattering);
197 
198  pmanager->AddDiscreteProcess(fGammaConversion);
199  }
200  else if (particleName == "e-")
201  {
202  // Construct processes for electron
203 
204  G4eIonisation* feminusIonisation = new G4eIonisation();
205  G4eBremsstrahlung* feminusBremsstrahlung = new G4eBremsstrahlung();
206  F01StepCut* feminusStepCut = new F01StepCut();
207  feminusStepCut->SetMaxStep(fMaxChargedStep);
208 
209  pmanager->AddProcess(feminusIonisation,-1,2,2);
210  pmanager->AddProcess(feminusBremsstrahlung,-1,-1,3);
211  pmanager->AddProcess(feminusStepCut,-1,-1,4);
212  }
213  else if (particleName == "e+")
214  {
215  // Construct processes for positron
216 
217  G4eIonisation* feplusIonisation = new G4eIonisation();
218  G4eBremsstrahlung* feplusBremsstrahlung = new G4eBremsstrahlung();
219  F01StepCut* feplusStepCut = new F01StepCut();
220  feplusStepCut->SetMaxStep(fMaxChargedStep);
221 
222  pmanager->AddProcess(feplusIonisation,-1,2,2);
223  pmanager->AddProcess(feplusBremsstrahlung,-1,-1,3);
224  pmanager->AddProcess(feplusStepCut,-1,-1,5);
225  }
226  else if( particleName == "mu+" || particleName == "mu-" )
227  {
228  // Construct processes for muon+
229 
230  F01StepCut* muonStepCut = new F01StepCut();
231  muonStepCut->SetMaxStep(fMaxChargedStep);
232  G4MuIonisation* muIonisation = new G4MuIonisation();
233 
234  pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
235  pmanager->AddProcess(muIonisation,-1,2,2);
236  pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
237  pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
238  pmanager->AddProcess(muonStepCut,-1,-1,3);
239  }
240  else if ( particleName == "proton"
241  || particleName == "antiproton"
242  || particleName == "pi+"
243  || particleName == "pi-"
244  || particleName == "kaon+"
245  || particleName == "kaon-"
246  )
247  {
248  F01StepCut* theHadronStepCut = new F01StepCut();
249  theHadronStepCut->SetMaxStep(10*mm);
250 
251  G4hIonisation* thehIonisation = new G4hIonisation();
252  G4hMultipleScattering* thehMultipleScattering =
253  new G4hMultipleScattering();
254 
255  pmanager->AddProcess(thehMultipleScattering,-1,1,1);
256  pmanager->AddProcess(thehIonisation,-1,2,2);
257  pmanager->AddProcess(theHadronStepCut,-1,-1,3);
258  }
259  }
260 }
261 
262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263 
264 #include "G4Decay.hh"
265 
267 {
268  // Add Decay Process
269 
270  G4Decay* theDecayProcess = new G4Decay();
271  theParticleIterator->reset();
272 
273  while( (*theParticleIterator)() )
274  {
275  G4ParticleDefinition* particle = theParticleIterator->value();
276  G4ProcessManager* pmanager = particle->GetProcessManager();
277 
278  if (theDecayProcess->IsApplicable(*particle))
279  {
280  pmanager ->AddProcess(theDecayProcess);
281 
282  // set ordering for PostStepDoIt and AtRestDoIt
283 
284  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
285  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
286  }
287  }
288 }
289 
290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291 
293 {
294  G4Timer theTimer;
295  theTimer.Start();
296  if (verboseLevel >0)
297  {
298  G4cout << "F01PhysicsList::SetCuts:";
299  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
300  }
301  // set cut values for gamma at first and for e- second and next for e+,
302  // because some processes for e+/e- need cut values for gamma
303  SetCutValue(fCutForGamma,"gamma");
304 
307 
309 
310  theTimer.Stop();
311  G4cout.precision(6);
312  G4cout << G4endl;
313  G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed()
314  << " s " <<G4endl;
315 
316 }
317 
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319 
321 {
322  fCutForGamma = val;
323 }
324 
325 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
326 
328 {
329  fCutForElectron = val;
330 }
331 
332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
333 
335 {
336  fMaxChargedStep = step;
337  G4cout << " MaxChargedStep=" << fMaxChargedStep << G4endl;
338  G4cout << G4endl;
339 }
340 
341 //....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)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:103
const G4String & GetParticleName() const
G4double fCutForGamma
Definition of the F01DetectorConstruction class.
void SetGammaCut(G4double)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForElectron
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
G4double GetUserElapsed() const
Definition: G4Timer.cc:130
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
void Stop()
void SetMaxStep(G4double)
virtual ~F01PhysicsList()
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
F01DetectorConstruction * fDet
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:102
Definition of the F01PhysicsListMessenger class.
#define theParticleIterator
Definition of the F01PhysicsList class.
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81