Geant4  10.01.p01
F02PhysicsList.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: F02PhysicsList.cc 77794 2013-11-28 09:54:17Z gcosmo $
31 //
32 //
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 #include "G4Timer.hh"
37 
38 #include "F02PhysicsList.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 "F02StepCut.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  pmanager->AddDiscreteProcess(fGammaConversion);
198  }
199  else if (particleName == "e-")
200  {
201  // Construct processes for electron
202 
203  G4eIonisation* feminusIonisation = new G4eIonisation();
204  G4eBremsstrahlung* feminusBremsstrahlung = new G4eBremsstrahlung();
205  F02StepCut* feminusStepCut = new F02StepCut();
206  feminusStepCut->SetMaxStep(fMaxChargedStep);
207 
208  pmanager->AddProcess(feminusIonisation,-1,2,2);
209  pmanager->AddProcess(feminusBremsstrahlung,-1,-1,3);
210  pmanager->AddProcess(feminusStepCut,-1,-1,4);
211  }
212  else if (particleName == "e+")
213  {
214  // Construct processes for positron
215 
216  G4eIonisation* feplusIonisation = new G4eIonisation();
217  G4eBremsstrahlung* feplusBremsstrahlung = new G4eBremsstrahlung();
218  F02StepCut* feplusStepCut = new F02StepCut();
219  feplusStepCut->SetMaxStep(fMaxChargedStep);
220 
221  pmanager->AddProcess(feplusIonisation,-1,2,2);
222  pmanager->AddProcess(feplusBremsstrahlung,-1,-1,3);
223  pmanager->AddProcess(feplusStepCut,-1,-1,5);
224  }
225  else if( particleName == "mu+" || particleName == "mu-" )
226  {
227  // Construct processes for muon+
228 
229  F02StepCut* muonStepCut = new F02StepCut();
230  muonStepCut->SetMaxStep(fMaxChargedStep);
231  G4MuIonisation* muIonisation = new G4MuIonisation();
232 
233  pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
234  pmanager->AddProcess(muIonisation,-1,2,2);
235  pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
236  pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
237  pmanager->AddProcess(muonStepCut,-1,-1,3);
238  }
239  else if ( particleName == "proton"
240  || particleName == "antiproton"
241  || particleName == "pi+"
242  || particleName == "pi-"
243  || particleName == "kaon+"
244  || particleName == "kaon-"
245  )
246  {
247  F02StepCut* theHadronStepCut = new F02StepCut();
248  theHadronStepCut->SetMaxStep(fMaxChargedStep);
249 
250  G4hIonisation* thehIonisation = new G4hIonisation();
251  G4hMultipleScattering* thehMultipleScattering =
252  new G4hMultipleScattering();
253 
254  pmanager->AddProcess(thehMultipleScattering,-1,1,1);
255  pmanager->AddProcess(thehIonisation,-1,2,2);
256  pmanager->AddProcess(theHadronStepCut,-1,-1,3);
257  }
258  }
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262 
263 #include "G4Decay.hh"
264 
266 {
267  // Add Decay Process
268 
269  G4Decay* theDecayProcess = new G4Decay();
270  theParticleIterator->reset();
271 
272  while( (*theParticleIterator)() )
273  {
274  G4ParticleDefinition* particle = theParticleIterator->value();
275  G4ProcessManager* pmanager = particle->GetProcessManager();
276 
277  if (theDecayProcess->IsApplicable(*particle))
278  {
279  pmanager ->AddProcess(theDecayProcess);
280 
281  // set ordering for PostStepDoIt and AtRestDoIt
282 
283  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
284  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
285  }
286  }
287 }
288 
289 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
290 
292 {
293  G4Timer theTimer;
294  theTimer.Start();
295  if (verboseLevel >0)
296  {
297  G4cout << "F02PhysicsList::SetCuts:";
298  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
299  }
300  // set cut values for gamma at first and for e- second and next for e+,
301  // because some processes for e+/e- need cut values for gamma
302 
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
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void SetGammaCut(G4double)
void SetCutValue(G4double aCut, const G4String &pname)
virtual ~F02PhysicsList()
void ConstructBosons()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
Definition of the F02PhysicsListMessenger class.
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
virtual void ConstructProcess()
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
F02DetectorConstruction * fDet
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
void SetElectronCut(G4double)
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:103
const G4String & GetParticleName() const
Definition of the F02DetectorConstruction class.
virtual void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
Definition of the F02PhysicsList class.
G4double GetUserElapsed() const
Definition: G4Timer.cc:130
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4double fCutForGamma
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
G4double fCutForElectron
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
G4double fMaxChargedStep
Definition of the F02StepCut class.
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
F02PhysicsList(F02DetectorConstruction *)
void SetMaxStep(G4double)
void Stop()
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
static G4ChargedGeantino * ChargedGeantinoDefinition()
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
void Start()
F02PhysicsListMessenger * fPhysicsListMessenger
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
#define theParticleIterator
void SetMaxStep(G4double)
Definition: F02StepCut.cc:67
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81