source: trunk/examples/extended/electromagnetic/TestEm6/src/PhysicsList.cc@ 1036

Last change on this file since 1036 was 807, checked in by garnier, 17 years ago

update

File size: 10.0 KB
Line 
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: PhysicsList.cc,v 1.12 2006/06/29 16:57:09 gunter Exp $
27// GEANT4 tag $Name: $
28//
29//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
32#include "PhysicsList.hh"
33#include "PhysicsListMessenger.hh"
34
35#include "G4ParticleDefinition.hh"
36#include "G4ProcessManager.hh"
37#include "G4ParticleTypes.hh"
38#include "G4ParticleTable.hh"
39
40#include "G4Proton.hh"
41#include "G4AntiProton.hh"
42#include "G4Neutron.hh"
43#include "G4AntiNeutron.hh"
44//#include "G4GenericIon.hh"
45
46#include "G4GammaConversionToMuons.hh"
47
48#include "G4MultipleScattering.hh"
49
50#include "G4eIonisation.hh"
51#include "G4eBremsstrahlung.hh"
52#include "G4eplusAnnihilation.hh"
53#include "G4AnnihiToMuPair.hh"
54
55#include "G4MuIonisation.hh"
56#include "G4MuBremsstrahlung.hh"
57#include "G4MuPairProduction.hh"
58
59#include "G4hIonisation.hh"
60#include "G4hhIonisation.hh"
61#include "G4ionIonisation.hh"
62#include "G4eeToHadrons.hh"
63
64#include "G4Decay.hh"
65#include "G4EmProcessOptions.hh"
66
67#include "G4StepLimiter.hh"
68
69//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70
71PhysicsList::PhysicsList()
72: G4VUserPhysicsList()
73{
74 defaultCutValue = 1.*km;
75 pMes = new PhysicsListMessenger(this);
76 theGammaToMuPairProcess = 0;
77 theAnnihiToMuPairProcess = 0;
78 eehadProcess = 0;
79 SetVerboseLevel(1);
80}
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83
84PhysicsList::~PhysicsList()
85{
86 delete pMes;
87 delete theAnnihiToMuPairProcess;
88 delete theGammaToMuPairProcess;
89 delete eehadProcess;
90}
91
92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93
94void PhysicsList::ConstructParticle()
95{
96 // In this method, static member functions should be called
97 // for all particles which you want to use.
98 // This ensures that objects of these particle types will be
99 // created in the program.
100
101 ConstructBosons();
102 ConstructLeptons();
103 ConstructHadrons();
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
108void PhysicsList::ConstructBosons()
109{
110 // pseudo-particles
111 G4Geantino::GeantinoDefinition();
112 G4ChargedGeantino::ChargedGeantinoDefinition();
113
114 // gamma
115 G4Gamma::GammaDefinition();
116}
117
118//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119
120void PhysicsList::ConstructLeptons()
121{
122 // leptons
123 G4Electron::ElectronDefinition();
124 G4Positron::PositronDefinition();
125 G4MuonPlus::MuonPlusDefinition();
126 G4MuonMinus::MuonMinusDefinition();
127
128 G4NeutrinoE::NeutrinoEDefinition();
129 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
130 G4NeutrinoMu::NeutrinoMuDefinition();
131 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
132}
133//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
134
135void PhysicsList::ConstructHadrons()
136{
137 // mesons
138 G4PionPlus::PionPlusDefinition();
139 G4PionMinus::PionMinusDefinition();
140 G4PionZero::PionZeroDefinition();
141 G4Eta::EtaDefinition();
142 G4EtaPrime::EtaPrimeDefinition();
143 G4KaonPlus::KaonPlusDefinition();
144 G4KaonMinus::KaonMinusDefinition();
145 G4KaonZero::KaonZeroDefinition();
146 G4AntiKaonZero::AntiKaonZeroDefinition();
147 G4KaonZeroLong::KaonZeroLongDefinition();
148 G4KaonZeroShort::KaonZeroShortDefinition();
149
150 // baryons
151 G4Proton::ProtonDefinition();
152 G4AntiProton::AntiProtonDefinition();
153 G4Neutron::NeutronDefinition();
154 G4AntiNeutron::AntiNeutronDefinition();
155}
156
157//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158
159void PhysicsList::ConstructProcess()
160{
161 AddTransportation();
162 ConstructEM();
163 ConstructGeneral();
164}
165
166//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
167
168void PhysicsList::ConstructEM()
169{
170 theParticleIterator->reset();
171 while( (*theParticleIterator)() ){
172 G4ParticleDefinition* particle = theParticleIterator->value();
173 G4ProcessManager* pmanager = particle->GetProcessManager();
174 G4String particleName = particle->GetParticleName();
175
176 if (particleName == "gamma") {
177 // gamma allow only gamma -> mu+mu-
178 theGammaToMuPairProcess=new G4GammaConversionToMuons();
179 pmanager->AddDiscreteProcess(theGammaToMuPairProcess);
180
181 } else if (particleName == "e-") {
182 //electron
183 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
184 pmanager->AddProcess(new G4eIonisation, -1, 2,2);
185 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
186 pmanager->AddProcess(new G4StepLimiter, -1,-1,4);
187
188 } else if (particleName == "e+") {
189 //positron
190 // to make the process of e+e- annihilation more visible,
191 // do not enable the other standard processes:
192 // pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
193 // pmanager->AddProcess(new G4eIonisation, -1, 2,2);
194 // pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3);
195 // pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
196
197 theAnnihiToMuPairProcess = new G4AnnihiToMuPair();
198 eehadProcess = new G4eeToHadrons();
199 pmanager->AddDiscreteProcess(theAnnihiToMuPairProcess);
200 pmanager->AddDiscreteProcess(eehadProcess);
201 pmanager->AddDiscreteProcess(new G4StepLimiter);
202
203 } else if( particleName == "mu+" ||
204 particleName == "mu-" ) {
205 //muon
206 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
207 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
208 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3,3);
209 pmanager->AddProcess(new G4MuPairProduction, -1, 4,4);
210 pmanager->AddProcess(new G4StepLimiter, -1,-1,5);
211
212 } else if( particleName == "anti_proton") {
213 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
214 pmanager->AddProcess(new G4hhIonisation, -1, 2,2);
215 pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
216
217 } else if( particleName == "GenericIon") {
218 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
219 pmanager->AddProcess(new G4ionIonisation, -1, 2,2);
220 pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
221
222 } else if( particle->GetPDGCharge() != 0.0 && !particle->IsShortLived()
223 && particleName != "chargedgeantino") {
224 pmanager->AddProcess(new G4MultipleScattering,-1, 1,1);
225 pmanager->AddProcess(new G4hIonisation, -1, 2,2);
226 pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
227 }
228 }
229
230 G4EmProcessOptions opt;
231 opt.SetVerbose(1);
232}
233
234//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
235
236void PhysicsList::ConstructGeneral()
237{
238 // Add Decay Process
239 G4Decay* theDecayProcess = new G4Decay();
240 theParticleIterator->reset();
241 while ((*theParticleIterator)()){
242 G4ParticleDefinition* particle = theParticleIterator->value();
243 G4ProcessManager* pmanager = particle->GetProcessManager();
244 if (theDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
245 pmanager ->AddProcess(theDecayProcess);
246 // set ordering for PostStepDoIt and AtRestDoIt
247 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
248 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
249 }
250 }
251}
252
253//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254
255void PhysicsList::SetCuts()
256{
257 if (verboseLevel >0){
258 G4cout << "PhysicsList::SetCuts:";
259 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
260 }
261
262 // set cut values for gamma at first and for e- second and next for e+,
263 // because some processes for e+/e- need cut values for gamma
264 SetCutValue(defaultCutValue, "gamma");
265 SetCutValue(defaultCutValue, "e-");
266 SetCutValue(defaultCutValue, "e+");
267
268 if (verboseLevel>0) DumpCutValuesTable();
269}
270
271//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
272
273void PhysicsList::SetGammaToMuPairFac(G4double fac)
274{
275 if(theGammaToMuPairProcess) theGammaToMuPairProcess->SetCrossSecFactor(fac);
276}
277
278//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
279
280void PhysicsList::SetAnnihiToMuPairFac(G4double fac)
281{
282 if(theAnnihiToMuPairProcess) theAnnihiToMuPairProcess->SetCrossSecFactor(fac);
283}
284
285//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
286
287void PhysicsList::SetAnnihiToHadronFac(G4double fac)
288{
289 if(eehadProcess) eehadProcess->SetCrossSecFactor(fac);
290}
291
292//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Note: See TracBrowser for help on using the repository browser.