source: trunk/examples/novice/N07/src/ExN07PhysicsList.cc@ 812

Last change on this file since 812 was 807, checked in by garnier, 17 years ago

update

File size: 11.4 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: ExN07PhysicsList.cc,v 1.7 2007/05/04 01:49:28 asaim Exp $
28// GEANT4 tag $Name: $
29//
30
31#include "ExN07PhysicsList.hh"
32
33#include "G4ParticleDefinition.hh"
34#include "G4ProcessManager.hh"
35#include "G4ProcessVector.hh"
36#include "G4ParticleTypes.hh"
37#include "G4ParticleTable.hh"
38#include "G4ios.hh"
39
40ExN07PhysicsList::ExN07PhysicsList(): G4VUserPhysicsList()
41{
42 defaultCutValue = 1.0*mm;
43 SetVerboseLevel(1);
44}
45
46ExN07PhysicsList::~ExN07PhysicsList()
47{}
48
49void ExN07PhysicsList::ConstructParticle()
50{
51 // In this method, static member functions should be called
52 // for all particles which you want to use.
53 // This ensures that objects of these particle types will be
54 // created in the program.
55
56 ConstructBosons();
57 ConstructLeptons();
58 ConstructMesons();
59 ConstructBaryons();
60}
61
62void ExN07PhysicsList::ConstructBosons()
63{
64 // pseudo-particles
65 G4Geantino::GeantinoDefinition();
66 G4ChargedGeantino::ChargedGeantinoDefinition();
67
68 // gamma
69 G4Gamma::GammaDefinition();
70}
71
72void ExN07PhysicsList::ConstructLeptons()
73{
74 // leptons
75 G4Electron::ElectronDefinition();
76 G4Positron::PositronDefinition();
77 G4MuonPlus::MuonPlusDefinition();
78 G4MuonMinus::MuonMinusDefinition();
79
80 G4NeutrinoE::NeutrinoEDefinition();
81 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
82 G4NeutrinoMu::NeutrinoMuDefinition();
83 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
84}
85
86void ExN07PhysicsList::ConstructMesons()
87{
88 // mesons
89 G4PionPlus::PionPlusDefinition();
90 G4PionMinus::PionMinusDefinition();
91 G4PionZero::PionZeroDefinition();
92 G4Eta::EtaDefinition();
93 G4EtaPrime::EtaPrimeDefinition();
94 G4KaonPlus::KaonPlusDefinition();
95 G4KaonMinus::KaonMinusDefinition();
96 G4KaonZero::KaonZeroDefinition();
97 G4AntiKaonZero::AntiKaonZeroDefinition();
98 G4KaonZeroLong::KaonZeroLongDefinition();
99 G4KaonZeroShort::KaonZeroShortDefinition();
100}
101
102void ExN07PhysicsList::ConstructBaryons()
103{
104// barions
105 G4Proton::ProtonDefinition();
106 G4AntiProton::AntiProtonDefinition();
107 G4Neutron::NeutronDefinition();
108 G4AntiNeutron::AntiNeutronDefinition();
109}
110
111void ExN07PhysicsList::ConstructProcess()
112{
113 AddTransportation();
114 ConstructGeneral();
115 ConstructEM();
116}
117
118#include "G4ComptonScattering.hh"
119#include "G4GammaConversion.hh"
120#include "G4PhotoElectricEffect.hh"
121
122#include "G4MultipleScattering.hh"
123
124#include "G4eIonisation.hh"
125#include "G4eBremsstrahlung.hh"
126#include "G4eplusAnnihilation.hh"
127
128#include "G4MuIonisation.hh"
129#include "G4MuBremsstrahlung.hh"
130#include "G4MuPairProduction.hh"
131
132#include "G4hIonisation.hh"
133
134void ExN07PhysicsList::ConstructEM()
135{
136 G4bool displacementFlg = true; // for multiple scattering
137 theParticleIterator->reset();
138 while( (*theParticleIterator)() ){
139 G4ParticleDefinition* particle = theParticleIterator->value();
140 G4ProcessManager* pmanager = particle->GetProcessManager();
141 G4String particleName = particle->GetParticleName();
142
143 if (particleName == "gamma") {
144 // gamma
145 pmanager->AddDiscreteProcess(new G4GammaConversion());
146 pmanager->AddDiscreteProcess(new G4ComptonScattering());
147 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
148
149 } else if (particleName == "e-") {
150 //electron
151 G4MultipleScattering* theeminusMultipleScattering = new G4MultipleScattering();
152 theeminusMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
153 G4VProcess* theeminusIonisation = new G4eIonisation();
154 G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
155 //
156 // add processes
157 pmanager->AddProcess(theeminusMultipleScattering);
158 pmanager->AddProcess(theeminusIonisation);
159 pmanager->AddProcess(theeminusBremsstrahlung);
160 //
161 // set ordering for AlongStepDoIt
162 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,1);
163 pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,2);
164 pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxAlongStep,3);
165 //
166 // set ordering for PostStepDoIt
167 pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep,1);
168 pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep,2);
169 pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep,3);
170
171 } else if (particleName == "e+") {
172 //positron
173 G4MultipleScattering* theeplusMultipleScattering = new G4MultipleScattering();
174 theeplusMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
175 G4VProcess* theeplusIonisation = new G4eIonisation();
176 G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
177 G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
178 //
179 // add processes
180 pmanager->AddProcess(theeplusMultipleScattering);
181 pmanager->AddProcess(theeplusIonisation);
182 pmanager->AddProcess(theeplusBremsstrahlung);
183 pmanager->AddProcess(theeplusAnnihilation);
184 //
185 // set ordering for AtRestDoIt
186 pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
187 //
188 // set ordering for AlongStepDoIt
189 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,1);
190 pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,2);
191 pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxAlongStep,3);
192 //
193 // set ordering for PostStepDoIt
194 pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep,1);
195 pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep,2);
196 pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep,3);
197 pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep,4);
198
199 } else if( particleName == "mu+" ||
200 particleName == "mu-" ) {
201 //muon
202 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
203 aMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
204 G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
205 G4VProcess* aPairProduction = new G4MuPairProduction();
206 G4VProcess* anIonisation = new G4MuIonisation();
207 //
208 // add processes
209 pmanager->AddProcess(anIonisation);
210 pmanager->AddProcess(aMultipleScattering);
211 pmanager->AddProcess(aBremsstrahlung);
212 pmanager->AddProcess(aPairProduction);
213 //
214 // set ordering for AlongStepDoIt
215 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
216 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
217 pmanager->SetProcessOrdering(aBremsstrahlung, idxAlongStep,3);
218 pmanager->SetProcessOrdering(aPairProduction, idxAlongStep,4);
219
220 //
221 // set ordering for PostStepDoIt
222 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
223 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
224 pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep,3);
225 pmanager->SetProcessOrdering(aPairProduction, idxPostStep,4);
226
227 } else if ((!particle->IsShortLived()) &&
228 (particle->GetPDGCharge() != 0.0) &&
229 (particle->GetParticleName() != "chargedgeantino")) {
230 // all others charged particles except geantino
231 G4MultipleScattering* aMultipleScattering = new G4MultipleScattering();
232 aMultipleScattering->SetLateralDisplasmentFlag(displacementFlg);
233 G4VProcess* anIonisation = new G4hIonisation();
234 //
235 // add processes
236 pmanager->AddProcess(anIonisation);
237 pmanager->AddProcess(aMultipleScattering);
238 //
239 // set ordering for AlongStepDoIt
240 pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
241 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,2);
242 //
243 // set ordering for PostStepDoIt
244 pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
245 pmanager->SetProcessOrdering(anIonisation, idxPostStep,2);
246 }
247 }
248}
249
250#include "G4Decay.hh"
251#include "G4ParallelWorldScoringProcess.hh"
252
253void ExN07PhysicsList::ConstructGeneral()
254{
255 // Add Decay Process and Parallel world Scoring Process
256 G4Decay* theDecayProcess = new G4Decay();
257 G4ParallelWorldScoringProcess* theParallelWorldScoringProcess
258 = new G4ParallelWorldScoringProcess("ParaWorldScoringProc");
259 theParallelWorldScoringProcess->SetParallelWorld("ParallelScoringWorld");
260
261 theParticleIterator->reset();
262 while( (*theParticleIterator)() ){
263 G4ParticleDefinition* particle = theParticleIterator->value();
264 G4ProcessManager* pmanager = particle->GetProcessManager();
265 if (theDecayProcess->IsApplicable(*particle)) {
266 pmanager ->AddProcess(theDecayProcess);
267 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
268 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
269 }
270 pmanager->AddProcess(theParallelWorldScoringProcess);
271 pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
272 pmanager->SetProcessOrdering(theParallelWorldScoringProcess, idxAlongStep, 1);
273 pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
274 }
275}
276
277#include "G4Region.hh"
278#include "G4RegionStore.hh"
279#include "G4ProductionCuts.hh"
280
281void ExN07PhysicsList::SetCuts()
282{
283 if (verboseLevel >0){
284 G4cout << "ExN07PhysicsList::SetCuts: default cut length : "
285 << G4BestUnit(defaultCutValue,"Length") << G4endl;
286 }
287
288 // These values are used as the default production thresholds
289 // for the world volume.
290 SetCutsWithDefault();
291
292
293 // Production thresholds for detector regions
294 G4String regName[] = {"Calor-A","Calor-B","Calor-C"};
295 G4double fuc = 1.;
296 for(G4int i=0;i<3;i++)
297 {
298 G4Region* reg = G4RegionStore::GetInstance()->GetRegion(regName[i]);
299 G4ProductionCuts* cuts = new G4ProductionCuts;
300 cuts->SetProductionCut(defaultCutValue*fuc);
301 reg->SetProductionCuts(cuts);
302 fuc *= 10.;
303 }
304}
305
306
Note: See TracBrowser for help on using the repository browser.