Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsList.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 // $Id$
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "G4ParticleDefinition.hh"
38 #include "G4ProcessManager.hh"
39 #include "G4ParticleTypes.hh"
40 #include "G4ParticleTable.hh"
41 
42 #include "G4Proton.hh"
43 #include "G4AntiProton.hh"
44 #include "G4Neutron.hh"
45 #include "G4AntiNeutron.hh"
46 
48 
49 #include "G4eMultipleScattering.hh"
51 #include "G4hMultipleScattering.hh"
52 
53 #include "G4eIonisation.hh"
54 #include "G4eBremsstrahlung.hh"
55 #include "G4eplusAnnihilation.hh"
56 #include "G4AnnihiToMuPair.hh"
57 
58 #include "G4MuIonisation.hh"
59 #include "G4MuBremsstrahlung.hh"
60 #include "G4MuPairProduction.hh"
61 
62 #include "G4hIonisation.hh"
63 #include "G4hhIonisation.hh"
64 #include "G4ionIonisation.hh"
65 #include "G4eeToHadrons.hh"
66 
67 #include "G4Decay.hh"
68 #include "G4EmProcessOptions.hh"
69 
70 #include "G4StepLimiter.hh"
71 
72 #include "G4ProcessTable.hh"
73 
74 #include "G4ComptonScattering.hh"
75 #include "G4GammaConversion.hh"
76 #include "G4PhotoElectricEffect.hh"
77 
78 #include "G4SystemOfUnits.hh"
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
84 {
85  defaultCutValue = 1.*km;
86  fMes = new PhysicsListMessenger(this);
87  SetVerboseLevel(1);
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  delete fMes;
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100 {
101  // In this method, static member functions should be called
102  // for all particles which you want to use.
103  // This ensures that objects of these particle types will be
104  // created in the program.
105 
106  ConstructBosons();
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
114 {
115  // pseudo-particles
118 
119  // gamma
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
127  // leptons
132 
137 }
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
142  // mesons
154 
155  // baryons
160 }
161 
162 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163 
165 {
167  ConstructEM();
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 void PhysicsList::ConstructEM()
174 {
176  while( (*theParticleIterator)() ){
178  G4ProcessManager* pmanager = particle->GetProcessManager();
179  G4String particleName = particle->GetParticleName();
180 
181  if (particleName == "gamma") {
182  // gamma allow only gamma -> mu+mu-
186  pmanager->AddDiscreteProcess(new G4GammaConversion);
187 
188  } else if (particleName == "e-") {
189  //electron
190  pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
191  pmanager->AddProcess(new G4eIonisation, -1, 2,2);
192  pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
193  pmanager->AddProcess(new G4StepLimiter, -1,-1,4);
194 
195  } else if (particleName == "e+") {
196  //positron
197  // to make the process of e+e- annihilation more visible,
198  // do not enable the other standard processes:
199  //pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
200  //pmanager->AddProcess(new G4eIonisation, -1, 2,2);
201  //pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
202  //pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
203 
204  pmanager->AddDiscreteProcess(new G4AnnihiToMuPair);
205  pmanager->AddDiscreteProcess(new G4eeToHadrons);
206  pmanager->AddDiscreteProcess(new G4StepLimiter);
207 
208  } else if( particleName == "mu+" ||
209  particleName == "mu-" ) {
210  //muon
211  pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1);
212  pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
213  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
214  pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
215  pmanager->AddProcess(new G4StepLimiter, -1,-1,5);
216 
217  } else if( particleName == "anti_proton") {
218  pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
219  pmanager->AddProcess(new G4hhIonisation, -1, 2,2);
220  pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
221 
222  } else if( particleName == "GenericIon") {
223  pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
224  pmanager->AddProcess(new G4ionIonisation, -1, 2,2);
225  pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
226 
227  } else if( particle->GetPDGCharge() != 0.0 && !particle->IsShortLived()
228  && particleName != "chargedgeantino") {
229  pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
230  pmanager->AddProcess(new G4hIonisation, -1, 2,2);
231  pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
232  }
233  }
234 
235  G4EmProcessOptions opt;
236  opt.SetVerbose(1);
237  opt.SetMinEnergy(100*eV);
238  opt.SetMaxEnergy(1000*TeV);
239  opt.SetDEDXBinning(13*7);
240  opt.SetLambdaBinning(13*7);
241 }
242 
243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
244 
246 {
247  // Add Decay Process
248  G4Decay* theDecayProcess = new G4Decay();
250  while ((*theParticleIterator)()){
252  G4ProcessManager* pmanager = particle->GetProcessManager();
253  if (theDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
254  pmanager ->AddProcess(theDecayProcess);
255  // set ordering for PostStepDoIt and AtRestDoIt
256  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
257  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
258  }
259  }
260 }
261 
262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263 
265 {
266  if (verboseLevel >0){
267  G4cout << "PhysicsList::SetCuts:";
268  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
269  }
270 
271  // set cut values for gamma at first and for e- second and next for e+,
272  // because some processes for e+/e- need cut values for gamma
273  SetCutValue(defaultCutValue, "gamma");
276 
278 }
279 
280 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
281 
283 {
284  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
285  G4GammaConversionToMuons* theGammaToMuPairProcess = (G4GammaConversionToMuons*) theProcessTable->FindProcess("GammaToMuPair","gamma");
286  if(theGammaToMuPairProcess) theGammaToMuPairProcess->SetCrossSecFactor(fac);
287  else G4cout << "Warning. No process GammaToMuPair found, SetGammaToMuPairFac was ignored" << G4endl;
288 }
289 
290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291 
293 {
294  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
295  G4AnnihiToMuPair* theAnnihiToMuPairProcess = (G4AnnihiToMuPair*) theProcessTable->FindProcess("AnnihiToMuPair","e+");
296  if(theAnnihiToMuPairProcess) theAnnihiToMuPairProcess->SetCrossSecFactor(fac);
297  else G4cout << "Warning. No process AnnihiToMuPair found, SetAnnihiToMuPairFac was ignored" << G4endl;
298 }
299 
300 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
301 
303 {
304  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
305  G4eeToHadrons* eehadProcess = (G4eeToHadrons*) theProcessTable->FindProcess("ee2hadr","e+");
306  if(eehadProcess) eehadProcess->SetCrossSecFactor(fac);
307  else G4cout << "Warning. No process ee2hadr found, SetAnnihiToHadronFac was ignored" << G4endl;
308 }
309 
310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......