Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
P6DPhysicsList.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 // $Id$
27 //
30 
31 #include "P6DPhysicsList.hh"
32 
33 #include "G4ProcessManager.hh"
34 
35 #include "G4BosonConstructor.hh"
36 #include "G4LeptonConstructor.hh"
37 #include "G4MesonConstructor.hh"
38 #include "G4BosonConstructor.hh"
39 #include "G4BaryonConstructor.hh"
40 #include "G4IonConstructor.hh"
41 
42 #include "G4SystemOfUnits.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
48 {
49  defaultCutValue = 1.0*mm;
50  SetVerboseLevel(1);
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56 {
57 }
58 
59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60 
62 {
63  // In this method, static member functions should be called
64  // for all particles which you want to use.
65  // This ensures that objects of these particle types will be
66  // created in the program.
67 
68  G4BosonConstructor pBosonConstructor;
69  pBosonConstructor.ConstructParticle();
70 
71  G4LeptonConstructor pLeptonConstructor;
72  pLeptonConstructor.ConstructParticle();
73 
74  G4MesonConstructor pMesonConstructor;
75  pMesonConstructor.ConstructParticle();
76 
77  G4BaryonConstructor pBaryonConstructor;
78  pBaryonConstructor.ConstructParticle();
79 
80  G4IonConstructor pIonConstructor;
81  pIonConstructor.ConstructParticle();
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
89  ConstructEM();
90  ConstructDecay();
91 }
92 
93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94 
95 #include "G4ComptonScattering.hh"
96 #include "G4GammaConversion.hh"
97 #include "G4PhotoElectricEffect.hh"
98 
99 #include "G4eMultipleScattering.hh"
100 #include "G4eIonisation.hh"
101 #include "G4eBremsstrahlung.hh"
102 #include "G4eplusAnnihilation.hh"
103 
104 #include "G4MuMultipleScattering.hh"
105 #include "G4MuIonisation.hh"
106 #include "G4MuBremsstrahlung.hh"
107 #include "G4MuPairProduction.hh"
108 
109 #include "G4hMultipleScattering.hh"
110 #include "G4hIonisation.hh"
111 #include "G4hBremsstrahlung.hh"
112 #include "G4hPairProduction.hh"
113 
114 #include "G4ionIonisation.hh"
115 
116 void P6DPhysicsList::ConstructEM()
117 {
119  while( (*theParticleIterator)() ){
121  G4ProcessManager* pmanager = particle->GetProcessManager();
122  G4String particleName = particle->GetParticleName();
123 
124  if (particleName == "gamma") {
125  // gamma
128  pmanager->AddDiscreteProcess(new G4GammaConversion);
129 
130  } else if (particleName == "e-") {
131  //electron
132  pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
133  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
134  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
135 
136  } else if (particleName == "e+") {
137  //positron
138  pmanager->AddProcess(new G4eMultipleScattering,-1, 1, 1);
139  pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
140  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
141  pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
142 
143  } else if( particleName == "mu+" ||
144  particleName == "mu-" ) {
145  //muon
146  pmanager->AddProcess(new G4MuMultipleScattering,-1, 1, 1);
147  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
148  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
149  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
150 
151  } else if( particleName == "proton" ||
152  particleName == "pi-" ||
153  particleName == "pi+" ) {
154  //proton
155  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
156  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
157  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
158  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
159 
160  } else if( particleName == "alpha" ||
161  particleName == "He3" ) {
162  //alpha
163  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
164  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
165 
166  } else if( particleName == "GenericIon" ) {
167  //Ions
168  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
169  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
170 
171  } else if ((!particle->IsShortLived()) &&
172  (particle->GetPDGCharge() != 0.0) &&
173  (particle->GetParticleName() != "chargedgeantino")) {
174  //all others charged particles except geantino
175  pmanager->AddProcess(new G4hMultipleScattering,-1, 1, 1);
176  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
177  }
178  }
179 }
180 
181 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
182 
183 #include "G4Decay.hh"
184 #include "G4Pythia6Decayer.hh"
185 
186 void P6DPhysicsList::ConstructDecay()
187 {
188  // Add Decay Process
189  G4Decay* theDecayProcess = new G4Decay();
190 
191  // Create Geant4 external decayer
192  G4Pythia6Decayer* extDecayer = new G4Pythia6Decayer();
193  extDecayer->SetVerboseLevel(2);
194  // The extDecayer is deleted in G4Decay destructor
195  theDecayProcess->SetExtDecayer(extDecayer);
196 
198  while( (*theParticleIterator)() )
199  {
201  G4ProcessManager* pmanager = particle->GetProcessManager();
202  if (theDecayProcess->IsApplicable(*particle))
203  {
204  pmanager ->AddProcess(theDecayProcess);
205  // set ordering for PostStepDoIt and AtRestDoIt
206  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
207  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
208  }
209  }
210 }
211 
212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
213 
215 {
216  if (verboseLevel >0)
217  {
218  G4cout << "P6DPhysicsList::SetCuts:";
219  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
220  }
221 
222  // set cut values for gamma at first and for e- second and next for e+,
223  // because some processes for e+/e- need cut values for gamma
224  //
225  SetCutValue(defaultCutValue, "gamma");
228  SetCutValue(defaultCutValue, "proton");
229 
231 }
232 
233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
234 
235