source: trunk/source/geometry/divisions/test/ExDivisions/src/ExDivPhysicsList.cc@ 1350

Last change on this file since 1350 was 1347, checked in by garnier, 15 years ago

geant4 tag 9.4

File size: 8.3 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//
27// $Id: ExDivPhysicsList.cc,v 1.3 2010/06/16 08:51:13 gcosmo Exp $
28// GEANT4 tag $Name: geant4-09-04-ref-00 $
29//
30//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
33#include "globals.hh"
34#include "ExDivPhysicsList.hh"
35
36#include "G4ParticleDefinition.hh"
37#include "G4ParticleWithCuts.hh"
38#include "G4ProcessManager.hh"
39#include "G4ProcessVector.hh"
40#include "G4ParticleTypes.hh"
41#include "G4ParticleTable.hh"
42#include "G4Material.hh"
43#include "G4ios.hh"
44#include <iomanip>
45
46//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47
48ExDivPhysicsList::ExDivPhysicsList(): G4VUserPhysicsList()
49{
50 defaultCutValue = 1.0*cm;
51 SetVerboseLevel(1);
52}
53
54//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55
56ExDivPhysicsList::~ExDivPhysicsList()
57{}
58
59//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
60
61void ExDivPhysicsList::ConstructParticle()
62{
63 // In this method, static member functions should be called
64 // for all particles which you want to use.
65 // This ensures that objects of these particle types will be
66 // created in the program.
67
68 ConstructBosons();
69 ConstructLeptons();
70 ConstructMesons();
71 ConstructBaryons();
72
73}
74
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
77void ExDivPhysicsList::ConstructBosons()
78{
79 // pseudo-particles
80 G4Geantino::GeantinoDefinition();
81 G4ChargedGeantino::ChargedGeantinoDefinition();
82
83 // gamma
84 G4Gamma::GammaDefinition();
85}
86
87//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88
89void ExDivPhysicsList::ConstructLeptons()
90{
91 // leptons
92 // e+/-
93 G4Electron::ElectronDefinition();
94 G4Positron::PositronDefinition();
95 // mu+/-
96 G4MuonPlus::MuonPlusDefinition();
97 G4MuonMinus::MuonMinusDefinition();
98 // nu_e
99 G4NeutrinoE::NeutrinoEDefinition();
100 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
101 // nu_mu
102 G4NeutrinoMu::NeutrinoMuDefinition();
103 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
104}
105
106//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107
108void ExDivPhysicsList::ConstructMesons()
109{
110 // mesons
111 // light mesons
112 G4PionPlus::PionPlusDefinition();
113 G4PionMinus::PionMinusDefinition();
114 G4PionZero::PionZeroDefinition();
115 G4Eta::EtaDefinition();
116 G4EtaPrime::EtaPrimeDefinition();
117 G4KaonPlus::KaonPlusDefinition();
118 G4KaonMinus::KaonMinusDefinition();
119 G4KaonZero::KaonZeroDefinition();
120 G4AntiKaonZero::AntiKaonZeroDefinition();
121 G4KaonZeroLong::KaonZeroLongDefinition();
122 G4KaonZeroShort::KaonZeroShortDefinition();
123}
124
125//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126
127void ExDivPhysicsList::ConstructBaryons()
128{
129 // barions
130 G4Proton::ProtonDefinition();
131 G4AntiProton::AntiProtonDefinition();
132
133 G4Neutron::NeutronDefinition();
134 G4AntiNeutron::AntiNeutronDefinition();
135}
136
137//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138
139void ExDivPhysicsList::ConstructProcess()
140{
141 AddTransportation();
142 ConstructEM();
143 ConstructGeneral();
144}
145
146//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147
148#include "G4ComptonScattering.hh"
149#include "G4GammaConversion.hh"
150#include "G4PhotoElectricEffect.hh"
151
152#include "G4eMultipleScattering.hh"
153#include "G4hMultipleScattering.hh"
154#include "G4MuMultipleScattering.hh"
155
156#include "G4eIonisation.hh"
157#include "G4eBremsstrahlung.hh"
158#include "G4eplusAnnihilation.hh"
159
160#include "G4MuIonisation.hh"
161#include "G4MuBremsstrahlung.hh"
162#include "G4MuPairProduction.hh"
163
164#include "G4hIonisation.hh"
165
166#include "G4UserSpecialCuts.hh"
167
168//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
169
170void ExDivPhysicsList::ConstructEM()
171{
172 theParticleIterator->reset();
173 while( (*theParticleIterator)() ){
174 G4ParticleDefinition* particle = theParticleIterator->value();
175 G4ProcessManager* pmanager = particle->GetProcessManager();
176 G4String particleName = particle->GetParticleName();
177
178 if (particleName == "gamma") {
179 // gamma
180 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
181 pmanager->AddDiscreteProcess(new G4ComptonScattering);
182 pmanager->AddDiscreteProcess(new G4GammaConversion);
183
184 } else if (particleName == "e-") {
185 //electron
186 pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
187 pmanager->AddProcess(new G4eIonisation, -1, 2,2);
188 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
189
190 } else if (particleName == "e+") {
191 //positron
192 pmanager->AddProcess(new G4eMultipleScattering,-1, 1,1);
193 pmanager->AddProcess(new G4eIonisation, -1, 2,2);
194 pmanager->AddProcess(new G4eBremsstrahlung, -1,-1,3);
195 pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4);
196
197 } else if( particleName == "mu+" ||
198 particleName == "mu-" ) {
199 //muon
200 pmanager->AddProcess(new G4MuMultipleScattering,-1, 1,1);
201 pmanager->AddProcess(new G4MuIonisation, -1, 2,2);
202 pmanager->AddProcess(new G4MuBremsstrahlung, -1,-1,3);
203 pmanager->AddProcess(new G4MuPairProduction, -1,-1,4);
204
205 } else if ((!particle->IsShortLived()) &&
206 (particle->GetPDGCharge() != 0.0) &&
207 (particle->GetParticleName() != "chargedgeantino")) {
208 //all others charged particles except geantino
209 pmanager->AddProcess(new G4hMultipleScattering,-1, 1,1);
210 pmanager->AddProcess(new G4hIonisation, -1, 2,2);
211 ///pmanager->AddProcess(new G4hUserSpecialCuts, -1,-1,3);
212 }
213 }
214}
215
216//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217
218#include "G4Decay.hh"
219void ExDivPhysicsList::ConstructGeneral()
220{
221 // Add Decay Process
222 G4Decay* theDecayProcess = new G4Decay();
223 theParticleIterator->reset();
224 while( (*theParticleIterator)() ){
225 G4ParticleDefinition* particle = theParticleIterator->value();
226 G4ProcessManager* pmanager = particle->GetProcessManager();
227 if (theDecayProcess->IsApplicable(*particle)) {
228 pmanager ->AddProcess(theDecayProcess);
229 // set ordering for PostStepDoIt and AtRestDoIt
230 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
231 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
232 }
233 }
234}
235
236//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
237
238void ExDivPhysicsList::SetCuts()
239{
240 //G4VUserPhysicsList::SetCutsWithDefault method sets
241 //the default cut value for all particle types
242 //
243 SetCutsWithDefault();
244
245 if (verboseLevel>0) DumpCutValuesTable();
246}
247
248//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
249
Note: See TracBrowser for help on using the repository browser.