source: trunk/source/geometry/solids/test/OpticalEscape/src/AXPETPhysicsList.cc@ 1330

Last change on this file since 1330 was 1316, checked in by garnier, 15 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 8.7 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// $Id: AXPETPhysicsList.cc,v 1.1 2008/09/03 13:34:03 gcosmo Exp $
27// ------------------------------------------------------------
28// Geant4 class implementation file
29//
30// 03/09/2008, by T.Nikitina
31// ------------------------------------------------------------
32
33#include "globals.hh"
34#include "AXPETPhysicsList.hh"
35
36#include "G4ParticleDefinition.hh"
37#include "G4ParticleTypes.hh"
38#include "G4ParticleTable.hh"
39
40#include "G4Material.hh"
41#include "G4MaterialTable.hh"
42
43#include "G4ProcessManager.hh"
44#include "G4ProcessVector.hh"
45
46#include "G4Cerenkov.hh"
47#include "G4Scintillation.hh"
48#include "G4OpAbsorption.hh"
49#include "G4OpRayleigh.hh"
50#include "G4OpBoundaryProcess.hh"
51#include "G4OpWLS.hh"
52
53AXPETPhysicsList::AXPETPhysicsList() : G4VUserPhysicsList()
54{
55 theCerenkovProcess = 0;
56 theScintillationProcess = 0;
57 theAbsorptionProcess = 0;
58 theRayleighScatteringProcess = 0;
59 theBoundaryProcess = 0;
60 theOpWLSProcess = 0;
61
62 SetVerboseLevel(0);
63}
64
65AXPETPhysicsList::~AXPETPhysicsList()
66{;}
67
68void AXPETPhysicsList::ConstructParticle()
69{
70// Construct bosons
71 // gamma
72 G4Gamma::GammaDefinition();
73
74 // optical photon
75 G4OpticalPhoton::OpticalPhotonDefinition();
76
77// Construct Leptons
78 G4Electron::ElectronDefinition();
79 G4Positron::PositronDefinition();
80 G4NeutrinoE::NeutrinoEDefinition();
81 G4AntiNeutrinoE::AntiNeutrinoEDefinition();
82 G4MuonPlus::MuonPlusDefinition();
83 G4MuonMinus::MuonMinusDefinition();
84 G4NeutrinoMu::NeutrinoMuDefinition();
85 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
86
87// Construct mesons
88 G4PionPlus::PionPlusDefinition();
89 G4PionMinus::PionMinusDefinition();
90 G4PionZero::PionZeroDefinition();
91
92 G4cout << "All particles constructed" << G4endl;
93}
94
95
96void AXPETPhysicsList::ConstructProcess()
97{
98 AddTransportation();
99 ConstructGeneral();
100 ConstructEM();
101 ConstructOp();
102}
103
104
105#include "G4Decay.hh"
106
107void AXPETPhysicsList::ConstructGeneral()
108{
109 // Add Decay Process
110 G4Decay* theDecayProcess = new G4Decay();
111 theParticleIterator->reset();
112 while( (*theParticleIterator)() ){
113 G4ParticleDefinition* particle = theParticleIterator->value();
114 G4ProcessManager* pmanager = particle->GetProcessManager();
115 if (theDecayProcess->IsApplicable(*particle)) {
116 pmanager ->AddProcess(theDecayProcess);
117 // set ordering for PostStepDoIt and AtRestDoIt
118 pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
119 pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
120 }
121 }
122 G4cout << "General processes constructed" << G4endl;
123
124}
125
126
127#include "G4ComptonScattering.hh"
128#include "G4GammaConversion.hh"
129#include "G4PhotoElectricEffect.hh"
130
131#include "G4MultipleScattering.hh"
132
133#include "G4eIonisation.hh"
134#include "G4eBremsstrahlung.hh"
135#include "G4eplusAnnihilation.hh"
136
137#include "G4MuIonisation.hh"
138#include "G4MuBremsstrahlung.hh"
139#include "G4MuPairProduction.hh"
140
141#include "G4hIonisation.hh"
142
143void AXPETPhysicsList::ConstructEM()
144{
145 theParticleIterator->reset();
146 while( (*theParticleIterator)() ){
147 G4ParticleDefinition* particle = theParticleIterator->value();
148 G4ProcessManager* pmanager = particle->GetProcessManager();
149 G4String particleName = particle->GetParticleName();
150
151 if (particleName == "gamma") {
152 // gamma
153 // Construct processes for gamma
154 pmanager->AddDiscreteProcess(new G4GammaConversion());
155 pmanager->AddDiscreteProcess(new G4ComptonScattering());
156 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
157
158 } else if (particleName == "e-") {
159 //electron
160 // Construct processes for electron
161 pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
162 pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
163 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
164
165 } else if (particleName == "e+") {
166 //positron
167 // Construct processes for positron
168 pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
169 pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
170 pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
171 pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
172
173 } else if( particleName == "mu+" ||
174 particleName == "mu-" ) {
175 //muon
176 // Construct processes for muon
177 pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
178 pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2);
179 pmanager->AddProcess(new G4MuBremsstrahlung(), -1, 3, 3);
180 pmanager->AddProcess(new G4MuPairProduction(), -1, 4, 4);
181
182 } else {
183 if ((particle->GetPDGCharge() != 0.0) &&
184 (particle->GetParticleName() != "chargedgeantino")) {
185 // all others charged particles except geantino
186 pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
187 pmanager->AddProcess(new G4hIonisation(), -1,2,2);
188 }
189 }
190 }
191 G4cout << "EM physics constructed" << G4endl;
192
193}
194
195void AXPETPhysicsList::ConstructOp()
196{
197 theCerenkovProcess = new G4Cerenkov("Cerenkov");
198 theScintillationProcess = new G4Scintillation("Scintillation");
199 theAbsorptionProcess = new G4OpAbsorption();
200 theRayleighScatteringProcess = new G4OpRayleigh();
201 theBoundaryProcess = new G4OpBoundaryProcess();
202 theOpWLSProcess = new G4OpWLS();
203
204 theCerenkovProcess->SetTrackSecondariesFirst(true);
205
206 //this is to force the same scintillitation yield for all particle types
207 theScintillationProcess->SetScintillationYieldFactor(1.);
208 theScintillationProcess->SetTrackSecondariesFirst(true);
209
210// G4OpticalSurfaceModel themodel = glisur;
211 G4OpticalSurfaceModel themodel = unified;
212 theBoundaryProcess->SetModel(themodel);
213// theBoundaryProcess->SetVerboseLevel(1);
214
215 // Selects the time profile generator
216 theOpWLSProcess->UseTimeProfile("exponential"); // or ("delta");
217
218 theParticleIterator->reset();
219 while( (*theParticleIterator)() ){
220 G4ParticleDefinition* particle = theParticleIterator->value();
221 G4ProcessManager* pmanager = particle->GetProcessManager();
222 G4String particleName = particle->GetParticleName();
223 if (theCerenkovProcess->IsApplicable(*particle)) {
224 // pmanager->AddContinuousProcess(theCerenkovProcess);
225 pmanager->AddProcess(theCerenkovProcess);
226 pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);
227
228 }
229 if (theScintillationProcess->IsApplicable(*particle)) {
230 pmanager->AddProcess(theScintillationProcess);
231 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
232 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
233 }
234 if (particleName == "opticalphoton") {
235 G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
236 pmanager->AddDiscreteProcess(theAbsorptionProcess);
237 pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
238 pmanager->AddDiscreteProcess(theBoundaryProcess);
239 pmanager->AddDiscreteProcess(theOpWLSProcess);
240 }
241 }
242 G4cout << "Optical photon physics constructed" << G4endl;
243
244}
245
246
247void AXPETPhysicsList::SetCuts()
248{
249 // " G4VUserPhysicsList::SetCutsWithDefault" method sets
250 // the default cut value for all particle types
251 //
252 SetCutsWithDefault();
253
254 if (verboseLevel>0) DumpCutValuesTable();
255}
Note: See TracBrowser for help on using the repository browser.