Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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$
31 //
32 
33 #include "G4Timer.hh"
34 
35 #include "F02PhysicsList.hh"
38 
39 #include "G4ProcessManager.hh"
40 #include "G4ProcessVector.hh"
41 #include "G4ParticleTypes.hh"
42 #include "G4ParticleTable.hh"
43 #include "G4Material.hh"
44 #include "G4EnergyLossTables.hh"
45 #include "G4UnitsTable.hh"
46 #include "G4PhysicalConstants.hh"
47 #include "G4SystemOfUnits.hh"
48 #include "G4ios.hh"
49 #include <iomanip>
50 
51 
52 
53 
55 //
56 //
57 
59 : G4VUserPhysicsList(), MaxChargedStep(DBL_MAX),
60  thePhotoElectricEffect(0), theComptonScattering(0),
61  theGammaConversion(0), theeminusIonisation(0),
62  theeminusBremsstrahlung(0), theeplusIonisation(0),
63  theeplusBremsstrahlung(0), theeplusAnnihilation(0),
64  theeminusStepCut(0), theeplusStepCut(0)
65 {
66  pDet = p;
67 
68  defaultCutValue = 1.000*mm ;
69 
70  cutForGamma = defaultCutValue ;
71  cutForElectron = defaultCutValue ;
72 
73  SetVerboseLevel(1);
74  physicsListMessenger = new F02PhysicsListMessenger(this);
75 }
76 
78 //
79 //
80 
82 {
83  delete physicsListMessenger;
84 }
85 
87 //
88 //
89 
91 {
92  // In this method, static member functions should be called
93  // for all particles which you want to use.
94  // This ensures that objects of these particle types will be
95  // created in the program.
96 
101 }
102 
104 //
105 //
106 
108 {
109  // gamma
110 
112 
113  // charged geantino
114 
116 
117 
118 }
119 
121 {
122  // leptons
123 
128 
133 }
134 
136 {
137  // mesons
138 
144 }
145 
146 
148 {
149 // barions
150 
153 }
154 
155 
157 //
158 //
159 
161 {
163  // AddParameterisation();
164 
165  ConstructEM();
167 }
168 
170 //
171 //
172 
173 #include "G4ComptonScattering.hh"
174 #include "G4GammaConversion.hh"
175 #include "G4PhotoElectricEffect.hh"
176 
177 #include "G4eMultipleScattering.hh"
178 #include "G4MuMultipleScattering.hh"
179 #include "G4hMultipleScattering.hh"
180 
181 #include "G4eIonisation.hh"
182 #include "G4eBremsstrahlung.hh"
183 #include "G4eplusAnnihilation.hh"
184 
185 #include "G4MuIonisation.hh"
186 #include "G4MuBremsstrahlung.hh"
187 #include "G4MuPairProduction.hh"
188 
189 #include "G4hIonisation.hh"
190 
191 #include "F02StepCut.hh"
192 
194 {
196 
197  while( (*theParticleIterator)() )
198  {
200  G4ProcessManager* pmanager = particle->GetProcessManager();
201  G4String particleName = particle->GetParticleName();
202 
203  if (particleName == "gamma")
204  {
205  // Construct processes for gamma
206 
207  thePhotoElectricEffect = new G4PhotoElectricEffect();
208  theComptonScattering = new G4ComptonScattering();
209  theGammaConversion = new G4GammaConversion();
210 
211  pmanager->AddDiscreteProcess(thePhotoElectricEffect);
212  pmanager->AddDiscreteProcess(theComptonScattering);
213 
214  pmanager->AddDiscreteProcess(theGammaConversion);
215 
216  }
217  else if (particleName == "e-")
218  {
219  // Construct processes for electron
220 
221  theeminusIonisation = new G4eIonisation();
222  theeminusBremsstrahlung = new G4eBremsstrahlung();
223  theeminusStepCut = new F02StepCut();
224 
225  pmanager->AddProcess(theeminusIonisation,-1,2,2);
226  pmanager->AddProcess(theeminusBremsstrahlung,-1,-1,3);
227  pmanager->AddProcess(theeminusStepCut,-1,-1,4);
228  theeminusStepCut->SetMaxStep(MaxChargedStep) ;
229 
230  }
231  else if (particleName == "e+")
232  {
233  // Construct processes for positron
234 
235  theeplusIonisation = new G4eIonisation();
236  theeplusBremsstrahlung = new G4eBremsstrahlung();
237  theeplusStepCut = new F02StepCut();
238 
239  pmanager->AddProcess(theeplusIonisation,-1,2,2);
240  pmanager->AddProcess(theeplusBremsstrahlung,-1,-1,3);
241  pmanager->AddProcess(theeplusStepCut,-1,-1,5);
242  theeplusStepCut->SetMaxStep(MaxChargedStep) ;
243 
244  }
245  else if( particleName == "mu+" ||
246  particleName == "mu-" )
247  {
248  // Construct processes for muon+
249 
250  F02StepCut* muonStepCut = new F02StepCut();
251 
252  G4MuIonisation* themuIonisation = new G4MuIonisation() ;
253  pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1);
254  pmanager->AddProcess(themuIonisation,-1,2,2);
255  pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
256  pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
257 
258  pmanager->AddProcess( muonStepCut,-1,-1,3);
259  muonStepCut->SetMaxStep(MaxChargedStep) ;
260 
261  }
262  else if (
263  particleName == "proton"
264  || particleName == "antiproton"
265  || particleName == "pi+"
266  || particleName == "pi-"
267  || particleName == "kaon+"
268  || particleName == "kaon-"
269  )
270  {
271  F02StepCut* thehadronStepCut = new F02StepCut();
272 
273  G4hIonisation* thehIonisation = new G4hIonisation() ;
274  G4hMultipleScattering* thehMultipleScattering =
275  new G4hMultipleScattering() ;
276 
277 
278  pmanager->AddProcess(thehMultipleScattering,-1,1,1);
279  pmanager->AddProcess(thehIonisation,-1,2,2);
280 
281  pmanager->AddProcess( thehadronStepCut,-1,-1,3);
282  thehadronStepCut->SetMaxStep(MaxChargedStep) ;
283  }
284  }
285 }
286 
287 #include "G4Decay.hh"
288 
290 {
291  // Add Decay Process
292 
293  G4Decay* theDecayProcess = new G4Decay();
295 
296  while( (*theParticleIterator)() )
297  {
299  G4ProcessManager* pmanager = particle->GetProcessManager();
300 
301  if (theDecayProcess->IsApplicable(*particle))
302  {
303  pmanager ->AddProcess(theDecayProcess);
304 
305  // set ordering for PostStepDoIt and AtRestDoIt
306 
307  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
308  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
309  }
310  }
311 }
312 
314 
316 {
317  G4Timer theTimer ;
318  theTimer.Start() ;
319  if (verboseLevel >0)
320  {
321  G4cout << "F02PhysicsList::SetCuts:";
322  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
323  }
324  // set cut values for gamma at first and for e- second and next for e+,
325  // because some processes for e+/e- need cut values for gamma
326 
327  SetCutValue(cutForGamma,"gamma");
328 
329  SetCutValue(cutForElectron,"e-");
330  SetCutValue(cutForElectron,"e+");
331 
333 
334  theTimer.Stop();
335  G4cout.precision(6);
336  G4cout << G4endl ;
337  G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed() << " s " <<G4endl;
338 
339 }
340 
342 
344 {
345  cutForGamma = val;
346 }
347 
349 
351 {
352  cutForElectron = val;
353 }
354 
356 
358 {
359  MaxChargedStep = step ;
360  G4cout << " MaxChargedStep=" << MaxChargedStep << G4endl;
361  G4cout << G4endl;
362 }
363