Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN06PhysicsList.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 //
27 // $Id$
28 //
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
32 #include "globals.hh"
33 #include "ExN06PhysicsList.hh"
35 
36 #include "G4ParticleDefinition.hh"
37 #include "G4ParticleTypes.hh"
38 #include "G4ParticleTable.hh"
39 
40 #include "G4ProcessManager.hh"
41 
42 #include "G4Cerenkov.hh"
43 #include "G4Scintillation.hh"
44 #include "G4OpAbsorption.hh"
45 #include "G4OpRayleigh.hh"
46 #include "G4OpMieHG.hh"
47 #include "G4OpBoundaryProcess.hh"
48 
49 #include "G4LossTableManager.hh"
50 #include "G4EmSaturation.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 {
56  theCerenkovProcess = NULL;
57  theScintillationProcess = NULL;
58  theAbsorptionProcess = NULL;
59  theRayleighScatteringProcess = NULL;
60  theMieHGScatteringProcess = NULL;
61  theBoundaryProcess = NULL;
62 
63  pMessenger = new ExN06PhysicsListMessenger(this);
64  SetVerboseLevel(0);
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
69 ExN06PhysicsList::~ExN06PhysicsList() { delete pMessenger;}
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  // In this method, static member functions should be called
76  // for all particles which you want to use.
77  // This ensures that objects of these particle types will be
78  // created in the program.
79 
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 {
90  // pseudo-particles
93 
94  // gamma
96 
97  // optical photon
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  // leptons
106  // e+/-
109  // mu+/-
112  // nu_e
115  // nu_mu
118 }
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123 {
124  // mesons
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
133 {
134  // barions
137 
140 }
141 
142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
143 
145 {
148  ConstructEM();
149  ConstructOp();
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
154 #include "G4Decay.hh"
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
159 {
160  // Add Decay Process
161  G4Decay* theDecayProcess = new G4Decay();
163  while( (*theParticleIterator)() ){
165  G4ProcessManager* pmanager = particle->GetProcessManager();
166  if (theDecayProcess->IsApplicable(*particle)) {
167  pmanager ->AddProcess(theDecayProcess);
168  // set ordering for PostStepDoIt and AtRestDoIt
169  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
170  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
171  }
172  }
173 }
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
176 
177 #include "G4ComptonScattering.hh"
178 #include "G4GammaConversion.hh"
179 #include "G4PhotoElectricEffect.hh"
180 
181 #include "G4eMultipleScattering.hh"
182 #include "G4MuMultipleScattering.hh"
183 #include "G4hMultipleScattering.hh"
184 
185 #include "G4eIonisation.hh"
186 #include "G4eBremsstrahlung.hh"
187 #include "G4eplusAnnihilation.hh"
188 
189 #include "G4MuIonisation.hh"
190 #include "G4MuBremsstrahlung.hh"
191 #include "G4MuPairProduction.hh"
192 
193 #include "G4hIonisation.hh"
194 
195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
196 
198 {
200  while( (*theParticleIterator)() ){
202  G4ProcessManager* pmanager = particle->GetProcessManager();
203  G4String particleName = particle->GetParticleName();
204 
205  if (particleName == "gamma") {
206  // gamma
207  // Construct processes for gamma
208  pmanager->AddDiscreteProcess(new G4GammaConversion());
209  pmanager->AddDiscreteProcess(new G4ComptonScattering());
210  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
211 
212  } else if (particleName == "e-") {
213  //electron
214  // Construct processes for electron
215  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
216  pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
217  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
218 
219  } else if (particleName == "e+") {
220  //positron
221  // Construct processes for positron
222  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1, 1);
223  pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
224  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
225  pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
226 
227  } else if( particleName == "mu+" ||
228  particleName == "mu-" ) {
229  //muon
230  // Construct processes for muon
231  pmanager->AddProcess(new G4MuMultipleScattering(),-1, 1, 1);
232  pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2);
233  pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
234  pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
235 
236  } else {
237  if ((particle->GetPDGCharge() != 0.0) &&
238  (particle->GetParticleName() != "chargedgeantino")) {
239  // all others charged particles except geantino
240  pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
241  pmanager->AddProcess(new G4hIonisation(), -1,2,2);
242  }
243  }
244  }
245 }
246 
247 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
248 
250 {
251  theCerenkovProcess = new G4Cerenkov("Cerenkov");
252  theScintillationProcess = new G4Scintillation("Scintillation");
253  theAbsorptionProcess = new G4OpAbsorption();
254  theRayleighScatteringProcess = new G4OpRayleigh();
255  theMieHGScatteringProcess = new G4OpMieHG();
256  theBoundaryProcess = new G4OpBoundaryProcess();
257 
258 // theCerenkovProcess->DumpPhysicsTable();
259 // theScintillationProcess->DumpPhysicsTable();
260 // theRayleighScatteringProcess->DumpPhysicsTable();
261 
262  SetVerbose(1);
263 
264  theCerenkovProcess->SetMaxNumPhotonsPerStep(20);
265  theCerenkovProcess->SetMaxBetaChangePerStep(10.0);
266  theCerenkovProcess->SetTrackSecondariesFirst(true);
267 
268  theScintillationProcess->SetScintillationYieldFactor(1.);
269  theScintillationProcess->SetTrackSecondariesFirst(true);
270 
271  // Use Birks Correction in the Scintillation process
272 
274  theScintillationProcess->AddSaturation(emSaturation);
275 
277  while( (*theParticleIterator)() ){
279  G4ProcessManager* pmanager = particle->GetProcessManager();
280  G4String particleName = particle->GetParticleName();
281  if (theCerenkovProcess->IsApplicable(*particle)) {
282  pmanager->AddProcess(theCerenkovProcess);
283  pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);
284  }
285  if (theScintillationProcess->IsApplicable(*particle)) {
286  pmanager->AddProcess(theScintillationProcess);
287  pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
288  pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
289  }
290  if (particleName == "opticalphoton") {
291  G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
292  pmanager->AddDiscreteProcess(theAbsorptionProcess);
293  pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
294  pmanager->AddDiscreteProcess(theMieHGScatteringProcess);
295  pmanager->AddDiscreteProcess(theBoundaryProcess);
296  }
297  }
298 }
299 
300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
301 
303 {
304  theCerenkovProcess->SetVerboseLevel(verbose);
305  theScintillationProcess->SetVerboseLevel(verbose);
306  theAbsorptionProcess->SetVerboseLevel(verbose);
307  theRayleighScatteringProcess->SetVerboseLevel(verbose);
308  theMieHGScatteringProcess->SetVerboseLevel(verbose);
309  theBoundaryProcess->SetVerboseLevel(verbose);
310 }
311 
312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
313 
315 {
316  theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumber);
317 }
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319 
321 {
322  // " G4VUserPhysicsList::SetCutsWithDefault" method sets
323  // the default cut value for all particle types
324  //
326 
328 }
329 
330 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......