BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
ExN02PhysicsList.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: ExN02PhysicsList.cxx,v 1.1.1.1 2004/09/28 05:16:53 liwd Exp $
25// GEANT4 tag $Name: G4Svc-00-01-53 $
26//
27//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
28//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29
30#include "globals.hh"
32
33#include "G4ParticleDefinition.hh"
34#include "G4ParticleWithCuts.hh"
35#include "G4ProcessManager.hh"
36#include "G4ProcessVector.hh"
37#include "G4ParticleTypes.hh"
38#include "G4ParticleTable.hh"
39#include "G4Material.hh"
40#include "G4ios.hh"
41
42//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43
45{
46 defaultCutValue = 1.0*cm;
47 SetVerboseLevel(1);
48}
49
50//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51
53{}
54
55//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56
58{
59 // In this method, static member functions should be called
60 // for all particles which you want to use.
61 // This ensures that objects of these particle types will be
62 // created in the program.
63
68
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
83//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84
86{
87 // leptons
88 // e+/-
89 G4Electron::ElectronDefinition();
90 G4Positron::PositronDefinition();
91 // mu+/-
92 G4MuonPlus::MuonPlusDefinition();
93 G4MuonMinus::MuonMinusDefinition();
94 // nu_e
95 G4NeutrinoE::NeutrinoEDefinition();
96 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
97 // nu_mu
98 G4NeutrinoMu::NeutrinoMuDefinition();
99 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
100}
101
102//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103
105{
106 // mesons
107 // light mesons
108 G4PionPlus::PionPlusDefinition();
109 G4PionMinus::PionMinusDefinition();
110 G4PionZero::PionZeroDefinition();
111 G4Eta::EtaDefinition();
112 G4EtaPrime::EtaPrimeDefinition();
113 G4KaonPlus::KaonPlusDefinition();
114 G4KaonMinus::KaonMinusDefinition();
115 G4KaonZero::KaonZeroDefinition();
116 G4AntiKaonZero::AntiKaonZeroDefinition();
117 G4KaonZeroLong::KaonZeroLongDefinition();
118 G4KaonZeroShort::KaonZeroShortDefinition();
119}
120
121//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122
124{
125 // barions
126 G4Proton::ProtonDefinition();
127 G4AntiProton::AntiProtonDefinition();
128
129 G4Neutron::NeutronDefinition();
130 G4AntiNeutron::AntiNeutronDefinition();
131}
132
133//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
134
136{
137 AddTransportation();
138 ConstructEM();
140}
141
142//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
143
144#include "G4ComptonScattering.hh"
145#include "G4GammaConversion.hh"
146#include "G4PhotoElectricEffect.hh"
147
148#include "G4MultipleScattering.hh"
149
150#include "G4eIonisation.hh"
151#include "G4eBremsstrahlung.hh"
152#include "G4eplusAnnihilation.hh"
153
154#include "G4MuIonisation.hh"
155#include "G4MuBremsstrahlung.hh"
156#include "G4MuPairProduction.hh"
157
158#include "G4hIonisation.hh"
159
160#include "G4UserSpecialCuts.hh"
161
162//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
163
165{
166 theParticleIterator->reset();
167 while( (*theParticleIterator)() ){
168 G4ParticleDefinition* particle = theParticleIterator->value();
169 G4ProcessManager* pmanager = particle->GetProcessManager();
170 G4String particleName = particle->GetParticleName();
171
172 if (particleName == "gamma") {
173 // gamma
174 pmanager->AddDiscreteProcess(new G4GammaConversion());
175 pmanager->AddDiscreteProcess(new G4ComptonScattering());
176 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
177
178 } else if (particleName == "e-") {
179 //electron
180 G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
181 G4VProcess* theeminusIonisation = new G4eIonisation();
182 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
183 //
184 // add processes
185 pmanager->AddProcess(theeminusMultipleScattering);
186 pmanager->AddProcess(theeminusIonisation);
187 pmanager->AddProcess(theeminusBremsstrahlung);
188 //
189 // set ordering for AlongStepDoIt
190 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
191 pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
192 //
193 // set ordering for PostStepDoIt
194 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
195 pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
196 pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
197
198 } else if (particleName == "e+") {
199 //positron
200 G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
201 G4VProcess* theeplusIonisation = new G4eIonisation();
202 G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
203 G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
204 //
205 // add processes
206 pmanager->AddProcess(theeplusMultipleScattering);
207 pmanager->AddProcess(theeplusIonisation);
208 pmanager->AddProcess(theeplusBremsstrahlung);
209 pmanager->AddProcess(theeplusAnnihilation);
210 //
211 // set ordering for AtRestDoIt
212 pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
213 //
214 // set ordering for AlongStepDoIt
215 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
216 pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
217 //
218 // set ordering for PostStepDoIt
219 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
220 pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
221 pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
222 pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
223
224 } else if( particleName == "mu+" ||
225 particleName == "mu-" ) {
226 //muon
227 G4VProcess* aMultipleScattering = new G4MultipleScattering();
228 G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
229 G4VProcess* aPairProduction = new G4MuPairProduction();
230 G4VProcess* anIonisation = new G4MuIonisation();
231 //
232 // add processes
233 pmanager->AddProcess(anIonisation);
234 pmanager->AddProcess(aMultipleScattering);
235 pmanager->AddProcess(aBremsstrahlung);
236 pmanager->AddProcess(aPairProduction);
237 //
238 // set ordering for AlongStepDoIt
239 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
240 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
241 //
242 // set ordering for PostStepDoIt
243 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
244 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
245 pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
246 pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
247
248 } else if ((!particle->IsShortLived()) &&
249 (particle->GetPDGCharge() != 0.0) &&
250 (particle->GetParticleName() != "chargedgeantino")) {
251 // all others charged particles except geantino
252 G4VProcess* aMultipleScattering = new G4MultipleScattering();
253 G4VProcess* anIonisation = new G4hIonisation();
254 ////G4VProcess* theUserCuts = new G4UserSpecialCuts();
255
256 //
257 // add processes
258 pmanager->AddProcess(anIonisation);
259 pmanager->AddProcess(aMultipleScattering);
260 ////pmanager->AddProcess(theUserCuts);
261
262 //
263 // set ordering for AlongStepDoIt
264 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
265 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
266
267 //
268 // set ordering for PostStepDoIt
269 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
270 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
271 ////pmanager->SetProcessOrdering(theUserCuts, idxPostStep,3);
272 }
273 }
274}
275
276//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
277
278#include "G4Decay.hh"
280{
281 // Add Decay Process
282 G4Decay* theDecayProcess = new G4Decay();
283 theParticleIterator->reset();
284 while( (*theParticleIterator)() ){
285 G4ParticleDefinition* particle = theParticleIterator->value();
286 G4ProcessManager* pmanager = particle->GetProcessManager();
287 if (theDecayProcess->IsApplicable(*particle)) {
288 pmanager ->AddProcess(theDecayProcess);
289 // set ordering for PostStepDoIt and AtRestDoIt
290 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
291 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
292 }
293 }
294}
295
296//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
297
299{
300 //G4VUserPhysicsList::SetCutsWithDefault method sets
301 //the default cut value for all particle types
302 //
303 SetCutsWithDefault();
304
305 if (verboseLevel>0) DumpCutValuesTable();
306}
307
308//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
309