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