BOSS 8.0.0
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-58 $
26//
27//
28
29//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31
33
34#include "G4Material.hh"
35#include "G4ParticleDefinition.hh"
36#include "G4ParticleTable.hh"
37#include "G4ParticleTypes.hh"
38#include "G4ParticleWithCuts.hh"
39#include "G4ProcessManager.hh"
40#include "G4ProcessVector.hh"
41#include "G4ios.hh"
42
43//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
45ExN03PhysicsList::ExN03PhysicsList() : G4VUserPhysicsList() {
46 defaultCutValue = 1.0 * mm;
47 SetVerboseLevel( 1 );
48}
49
50//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51
53
54//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
57 // In this method, static member functions should be called
58 // for all particles which you want to use.
59 // This ensures that objects of these particle types will be
60 // created in the program.
61
66}
67
68//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69
71 // pseudo-particles
72 G4Geantino::GeantinoDefinition();
73 G4ChargedGeantino::ChargedGeantinoDefinition();
74
75 // gamma
76 G4Gamma::GammaDefinition();
77
78 // optical photon
79 G4OpticalPhoton::OpticalPhotonDefinition();
80}
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83
85 // leptons
86 G4Electron::ElectronDefinition();
87 G4Positron::PositronDefinition();
88 G4MuonPlus::MuonPlusDefinition();
89 G4MuonMinus::MuonMinusDefinition();
90
91 G4NeutrinoE::NeutrinoEDefinition();
92 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
93 G4NeutrinoMu::NeutrinoMuDefinition();
94 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
95}
96
97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
100 // 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 G4Neutron::NeutronDefinition();
121 G4AntiNeutron::AntiNeutronDefinition();
122}
123
124//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125
127 AddTransportation();
128 ConstructEM();
130}
131
132//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
133
134#include "G4ComptonScattering.hh"
135#include "G4GammaConversion.hh"
136#include "G4PhotoElectricEffect.hh"
137
138#include "G4MultipleScattering.hh"
139
140#include "G4eBremsstrahlung.hh"
141#include "G4eIonisation.hh"
142#include "G4eplusAnnihilation.hh"
143
144#include "G4MuBremsstrahlung.hh"
145#include "G4MuIonisation.hh"
146#include "G4MuPairProduction.hh"
147
148#include "G4hIonisation.hh"
149
150//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151
153 theParticleIterator->reset();
154 while ( ( *theParticleIterator )() )
155 {
156 G4ParticleDefinition* particle = theParticleIterator->value();
157 G4ProcessManager* pmanager = particle->GetProcessManager();
158 G4String particleName = particle->GetParticleName();
159
160 if ( particleName == "gamma" )
161 {
162 // gamma
163 pmanager->AddDiscreteProcess( new G4GammaConversion() );
164 pmanager->AddDiscreteProcess( new G4ComptonScattering() );
165 pmanager->AddDiscreteProcess( new G4PhotoElectricEffect() );
166 }
167 else if ( particleName == "e-" )
168 {
169 // electron
170 G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
171 G4VProcess* theeminusIonisation = new G4eIonisation();
172 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
173 //
174 // add processes
175 pmanager->AddProcess( theeminusMultipleScattering );
176 pmanager->AddProcess( theeminusIonisation );
177 pmanager->AddProcess( theeminusBremsstrahlung );
178 //
179 // set ordering for AlongStepDoIt
180 pmanager->SetProcessOrdering( theeminusMultipleScattering, idxAlongStep, 1 );
181 pmanager->SetProcessOrdering( theeminusIonisation, idxAlongStep, 2 );
182 //
183 // set ordering for PostStepDoIt
184 pmanager->SetProcessOrdering( theeminusMultipleScattering, idxPostStep, 1 );
185 pmanager->SetProcessOrdering( theeminusIonisation, idxPostStep, 2 );
186 pmanager->SetProcessOrdering( theeminusBremsstrahlung, idxPostStep, 3 );
187 }
188 else if ( particleName == "e+" )
189 {
190 // positron
191 G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
192 G4VProcess* theeplusIonisation = new G4eIonisation();
193 G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
194 G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
195 //
196 // add processes
197 pmanager->AddProcess( theeplusMultipleScattering );
198 pmanager->AddProcess( theeplusIonisation );
199 pmanager->AddProcess( theeplusBremsstrahlung );
200 pmanager->AddProcess( theeplusAnnihilation );
201 //
202 // set ordering for AtRestDoIt
203 pmanager->SetProcessOrderingToFirst( theeplusAnnihilation, idxAtRest );
204 //
205 // set ordering for AlongStepDoIt
206 pmanager->SetProcessOrdering( theeplusMultipleScattering, idxAlongStep, 1 );
207 pmanager->SetProcessOrdering( theeplusIonisation, idxAlongStep, 2 );
208 //
209 // set ordering for PostStepDoIt
210 pmanager->SetProcessOrdering( theeplusMultipleScattering, idxPostStep, 1 );
211 pmanager->SetProcessOrdering( theeplusIonisation, idxPostStep, 2 );
212 pmanager->SetProcessOrdering( theeplusBremsstrahlung, idxPostStep, 3 );
213 pmanager->SetProcessOrdering( theeplusAnnihilation, idxPostStep, 4 );
214 }
215 else if ( particleName == "mu+" || particleName == "mu-" )
216 {
217 // muon
218 G4VProcess* aMultipleScattering = new G4MultipleScattering();
219 G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
220 G4VProcess* aPairProduction = new G4MuPairProduction();
221 G4VProcess* anIonisation = new G4MuIonisation();
222 //
223 // add processes
224 pmanager->AddProcess( anIonisation );
225 pmanager->AddProcess( aMultipleScattering );
226 pmanager->AddProcess( aBremsstrahlung );
227 pmanager->AddProcess( aPairProduction );
228 //
229 // set ordering for AlongStepDoIt
230 pmanager->SetProcessOrdering( aMultipleScattering, idxAlongStep, 1 );
231 pmanager->SetProcessOrdering( anIonisation, idxAlongStep, 2 );
232 //
233 // set ordering for PostStepDoIt
234 pmanager->SetProcessOrdering( aMultipleScattering, idxPostStep, 1 );
235 pmanager->SetProcessOrdering( anIonisation, idxPostStep, 2 );
236 pmanager->SetProcessOrdering( aBremsstrahlung, idxPostStep, 3 );
237 pmanager->SetProcessOrdering( aPairProduction, idxPostStep, 4 );
238 }
239 else if ( ( !particle->IsShortLived() ) && ( particle->GetPDGCharge() != 0.0 ) &&
240 ( particle->GetParticleName() != "chargedgeantino" ) )
241 {
242 // all others charged particles except geantino
243 G4VProcess* aMultipleScattering = new G4MultipleScattering();
244 G4VProcess* anIonisation = new G4hIonisation();
245 //
246 // add processes
247 pmanager->AddProcess( anIonisation );
248 pmanager->AddProcess( aMultipleScattering );
249 //
250 // set ordering for AlongStepDoIt
251 pmanager->SetProcessOrdering( aMultipleScattering, idxAlongStep, 1 );
252 pmanager->SetProcessOrdering( anIonisation, idxAlongStep, 2 );
253 //
254 // set ordering for PostStepDoIt
255 pmanager->SetProcessOrdering( aMultipleScattering, idxPostStep, 1 );
256 pmanager->SetProcessOrdering( anIonisation, idxPostStep, 2 );
257 }
258 }
259}
260
261//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262
263#include "G4Decay.hh"
264
266 // Add Decay Process
267 G4Decay* theDecayProcess = new G4Decay();
268 theParticleIterator->reset();
269 while ( ( *theParticleIterator )() )
270 {
271 G4ParticleDefinition* particle = theParticleIterator->value();
272 G4ProcessManager* pmanager = particle->GetProcessManager();
273 if ( theDecayProcess->IsApplicable( *particle ) )
274 {
275 pmanager->AddProcess( theDecayProcess );
276 // set ordering for PostStepDoIt and AtRestDoIt
277 pmanager->SetProcessOrdering( theDecayProcess, idxPostStep );
278 pmanager->SetProcessOrdering( theDecayProcess, idxAtRest );
279 }
280 }
281}
282
283//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284
286 if ( verboseLevel > 0 )
287 {
288 G4cout << "ExN03PhysicsList::SetCuts:";
289 G4cout << "CutLength : " << G4BestUnit( defaultCutValue, "Length" ) << G4endl;
290 }
291
292 // set cut values for gamma at first and for e- second and next for e+,
293 // because some processes for e+/e- need cut values for gamma
294 //
295 SetCutValue( defaultCutValue, "gamma" );
296 SetCutValue( defaultCutValue, "e-" );
297 SetCutValue( defaultCutValue, "e+" );
298
299 if ( verboseLevel > 0 ) DumpCutValuesTable();
300}
301
302//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......