BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
ExN03PhysicsList.cxx
Go to the documentation of this file.
1//
2// ********************************************************************
3// * DISCLAIMER *
4// * *
5// * The following disclaimer summarizes all the specific disclaimers *
6// * of contributors to this software. The specific disclaimers,which *
7// * govern, are listed with their locations in: *
8// * http://cern.ch/geant4/license *
9// * *
10// * Neither the authors of this software system, nor their employing *
11// * institutes,nor the agencies providing financial support for this *
12// * work make any representation or warranty, express or implied, *
13// * regarding this software system or assume any liability for its *
14// * use. *
15// * *
16// * This code implementation is the intellectual property of the *
17// * GEANT4 collaboration. *
18// * By copying, distributing or modifying the Program (or any work *
19// * based on the Program) you indicate your acceptance of this *
20// * statement, and all its terms. *
21// ********************************************************************
22//
23//
24// $Id: ExN03PhysicsList.cxx,v 1.1.1.1 2004/09/28 05:16:53 liwd Exp $
25// GEANT4 tag $Name: G4Svc-00-01-53 $
26//
27//
28
29//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
33
34#include "G4ParticleDefinition.hh"
35#include "G4ParticleWithCuts.hh"
36#include "G4ProcessManager.hh"
37#include "G4ProcessVector.hh"
38#include "G4ParticleTypes.hh"
39#include "G4ParticleTable.hh"
40#include "G4Material.hh"
41#include "G4ios.hh"
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
46{
47 defaultCutValue = 1.0*mm;
48 SetVerboseLevel(1);
49}
50
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52
54{}
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57
59{
60 // In this method, static member functions should be called
61 // for all particles which you want to use.
62 // This ensures that objects of these particle types will be
63 // created in the program.
64
69}
70
71//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72
74{
75 // pseudo-particles
76 G4Geantino::GeantinoDefinition();
77 G4ChargedGeantino::ChargedGeantinoDefinition();
78
79 // gamma
80 G4Gamma::GammaDefinition();
81
82 // optical photon
83 G4OpticalPhoton::OpticalPhotonDefinition();
84}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87
89{
90 // leptons
91 G4Electron::ElectronDefinition();
92 G4Positron::PositronDefinition();
93 G4MuonPlus::MuonPlusDefinition();
94 G4MuonMinus::MuonMinusDefinition();
95
96 G4NeutrinoE::NeutrinoEDefinition();
97 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
98 G4NeutrinoMu::NeutrinoMuDefinition();
99 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
100}
101
102//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103
105{
106 // mesons
107 G4PionPlus::PionPlusDefinition();
108 G4PionMinus::PionMinusDefinition();
109 G4PionZero::PionZeroDefinition();
110 G4Eta::EtaDefinition();
111 G4EtaPrime::EtaPrimeDefinition();
112 G4KaonPlus::KaonPlusDefinition();
113 G4KaonMinus::KaonMinusDefinition();
114 G4KaonZero::KaonZeroDefinition();
115 G4AntiKaonZero::AntiKaonZeroDefinition();
116 G4KaonZeroLong::KaonZeroLongDefinition();
117 G4KaonZeroShort::KaonZeroShortDefinition();
118}
119
120//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121
123{
124// barions
125 G4Proton::ProtonDefinition();
126 G4AntiProton::AntiProtonDefinition();
127 G4Neutron::NeutronDefinition();
128 G4AntiNeutron::AntiNeutronDefinition();
129}
130
131
132//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133
135{
136 AddTransportation();
137 ConstructEM();
139}
140
141//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142
143#include "G4ComptonScattering.hh"
144#include "G4GammaConversion.hh"
145#include "G4PhotoElectricEffect.hh"
146
147#include "G4MultipleScattering.hh"
148
149#include "G4eIonisation.hh"
150#include "G4eBremsstrahlung.hh"
151#include "G4eplusAnnihilation.hh"
152
153#include "G4MuIonisation.hh"
154#include "G4MuBremsstrahlung.hh"
155#include "G4MuPairProduction.hh"
156
157#include "G4hIonisation.hh"
158
159//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
160
162{
163 theParticleIterator->reset();
164 while( (*theParticleIterator)() ){
165 G4ParticleDefinition* particle = theParticleIterator->value();
166 G4ProcessManager* pmanager = particle->GetProcessManager();
167 G4String particleName = particle->GetParticleName();
168
169 if (particleName == "gamma") {
170 // gamma
171 pmanager->AddDiscreteProcess(new G4GammaConversion());
172 pmanager->AddDiscreteProcess(new G4ComptonScattering());
173 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
174
175 } else if (particleName == "e-") {
176 //electron
177 G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
178 G4VProcess* theeminusIonisation = new G4eIonisation();
179 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
180 //
181 // add processes
182 pmanager->AddProcess(theeminusMultipleScattering);
183 pmanager->AddProcess(theeminusIonisation);
184 pmanager->AddProcess(theeminusBremsstrahlung);
185 //
186 // set ordering for AlongStepDoIt
187 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
188 pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
189 //
190 // set ordering for PostStepDoIt
191 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
192 pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
193 pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
194
195 } else if (particleName == "e+") {
196 //positron
197 G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
198 G4VProcess* theeplusIonisation = new G4eIonisation();
199 G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
200 G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
201 //
202 // add processes
203 pmanager->AddProcess(theeplusMultipleScattering);
204 pmanager->AddProcess(theeplusIonisation);
205 pmanager->AddProcess(theeplusBremsstrahlung);
206 pmanager->AddProcess(theeplusAnnihilation);
207 //
208 // set ordering for AtRestDoIt
209 pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
210 //
211 // set ordering for AlongStepDoIt
212 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
213 pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
214 //
215 // set ordering for PostStepDoIt
216 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
217 pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
218 pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
219 pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
220
221 } else if( particleName == "mu+" ||
222 particleName == "mu-" ) {
223 //muon
224 G4VProcess* aMultipleScattering = new G4MultipleScattering();
225 G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
226 G4VProcess* aPairProduction = new G4MuPairProduction();
227 G4VProcess* anIonisation = new G4MuIonisation();
228 //
229 // add processes
230 pmanager->AddProcess(anIonisation);
231 pmanager->AddProcess(aMultipleScattering);
232 pmanager->AddProcess(aBremsstrahlung);
233 pmanager->AddProcess(aPairProduction);
234 //
235 // set ordering for AlongStepDoIt
236 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
237 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
238 //
239 // set ordering for PostStepDoIt
240 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
241 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
242 pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
243 pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
244
245 } else if ((!particle->IsShortLived()) &&
246 (particle->GetPDGCharge() != 0.0) &&
247 (particle->GetParticleName() != "chargedgeantino")) {
248 // all others charged particles except geantino
249 G4VProcess* aMultipleScattering = new G4MultipleScattering();
250 G4VProcess* anIonisation = new G4hIonisation();
251 //
252 // add processes
253 pmanager->AddProcess(anIonisation);
254 pmanager->AddProcess(aMultipleScattering);
255 //
256 // set ordering for AlongStepDoIt
257 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
258 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
259 //
260 // set ordering for PostStepDoIt
261 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
262 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
263 }
264 }
265}
266
267//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268
269#include "G4Decay.hh"
270
272{
273 // Add Decay Process
274 G4Decay* theDecayProcess = new G4Decay();
275 theParticleIterator->reset();
276 while( (*theParticleIterator)() ){
277 G4ParticleDefinition* particle = theParticleIterator->value();
278 G4ProcessManager* pmanager = particle->GetProcessManager();
279 if (theDecayProcess->IsApplicable(*particle)) {
280 pmanager ->AddProcess(theDecayProcess);
281 // set ordering for PostStepDoIt and AtRestDoIt
282 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
283 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
284 }
285 }
286}
287
288//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289
291{
292 if (verboseLevel >0){
293 G4cout << "ExN03PhysicsList::SetCuts:";
294 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
295 }
296
297 // set cut values for gamma at first and for e- second and next for e+,
298 // because some processes for e+/e- need cut values for gamma
299 //
300 SetCutValue(defaultCutValue, "gamma");
301 SetCutValue(defaultCutValue, "e-");
302 SetCutValue(defaultCutValue, "e+");
303
304 if (verboseLevel>0) DumpCutValuesTable();
305}
306
307//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
308