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: PhysicsList.cc,v 1.6 2006/06/29 16:54:17 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | |
---|
31 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
32 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
33 | |
---|
34 | #include "PhysicsList.hh" |
---|
35 | |
---|
36 | #include "G4ParticleDefinition.hh" |
---|
37 | #include "G4ProcessManager.hh" |
---|
38 | #include "G4ParticleTypes.hh" |
---|
39 | #include "G4ParticleTable.hh" |
---|
40 | |
---|
41 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
42 | |
---|
43 | PhysicsList::PhysicsList() |
---|
44 | : G4VUserPhysicsList() |
---|
45 | { |
---|
46 | defaultCutValue = 1.0*mm; |
---|
47 | SetVerboseLevel(1); |
---|
48 | } |
---|
49 | |
---|
50 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
51 | |
---|
52 | PhysicsList::~PhysicsList() |
---|
53 | {} |
---|
54 | |
---|
55 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
56 | |
---|
57 | void PhysicsList::ConstructParticle() |
---|
58 | { |
---|
59 | // In this method, static member functions should be called |
---|
60 | // for all particles which you want to use. |
---|
61 | // This ensures that objects of these particle types will be |
---|
62 | // created in the program. |
---|
63 | |
---|
64 | ConstructBosons(); |
---|
65 | ConstructLeptons(); |
---|
66 | } |
---|
67 | |
---|
68 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
69 | |
---|
70 | void PhysicsList::ConstructBosons() |
---|
71 | { |
---|
72 | G4Gamma::GammaDefinition(); |
---|
73 | } |
---|
74 | |
---|
75 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
76 | |
---|
77 | void PhysicsList::ConstructLeptons() |
---|
78 | { |
---|
79 | G4Electron::ElectronDefinition(); |
---|
80 | G4Positron::PositronDefinition(); |
---|
81 | } |
---|
82 | |
---|
83 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
84 | |
---|
85 | void PhysicsList::ConstructProcess() |
---|
86 | { |
---|
87 | AddTransportation(); |
---|
88 | ConstructEM(); |
---|
89 | } |
---|
90 | |
---|
91 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
92 | |
---|
93 | #include "G4ComptonScattering.hh" |
---|
94 | #include "G4GammaConversion.hh" |
---|
95 | #include "G4PhotoElectricEffect.hh" |
---|
96 | |
---|
97 | #include "G4MultipleScattering.hh" |
---|
98 | |
---|
99 | #include "G4eIonisation.hh" |
---|
100 | #include "G4eBremsstrahlung.hh" |
---|
101 | #include "G4eplusAnnihilation.hh" |
---|
102 | |
---|
103 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
104 | |
---|
105 | void PhysicsList::ConstructEM() |
---|
106 | { |
---|
107 | theParticleIterator->reset(); |
---|
108 | while( (*theParticleIterator)() ){ |
---|
109 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
110 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
111 | G4String particleName = particle->GetParticleName(); |
---|
112 | |
---|
113 | if (particleName == "gamma") { |
---|
114 | // gamma |
---|
115 | |
---|
116 | pmanager->AddDiscreteProcess(new G4PhotoElectricEffect); |
---|
117 | pmanager->AddDiscreteProcess(new G4ComptonScattering); |
---|
118 | pmanager->AddDiscreteProcess(new G4GammaConversion); |
---|
119 | |
---|
120 | } else if (particleName == "e-") { |
---|
121 | //electron |
---|
122 | |
---|
123 | pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); |
---|
124 | pmanager->AddProcess(new G4eIonisation, -1, 2,2); |
---|
125 | pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); |
---|
126 | |
---|
127 | } else if (particleName == "e+") { |
---|
128 | //positron |
---|
129 | |
---|
130 | pmanager->AddProcess(new G4MultipleScattering,-1, 1,1); |
---|
131 | pmanager->AddProcess(new G4eIonisation, -1, 2,2); |
---|
132 | pmanager->AddProcess(new G4eBremsstrahlung, -1, 3,3); |
---|
133 | pmanager->AddProcess(new G4eplusAnnihilation, 0,-1,4); |
---|
134 | } |
---|
135 | } |
---|
136 | } |
---|
137 | |
---|
138 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
139 | |
---|
140 | void PhysicsList::SetCuts() |
---|
141 | { |
---|
142 | if (verboseLevel >0){ |
---|
143 | G4cout << "PhysicsList::SetCuts:"; |
---|
144 | G4cout << "CutLength : " << defaultCutValue/mm << " (mm)" << G4endl; |
---|
145 | } |
---|
146 | |
---|
147 | // set cut values for gamma at first and for e- second and next for e+, |
---|
148 | // because some processes for e+/e- need cut values for gamma |
---|
149 | SetCutValue(defaultCutValue, "gamma"); |
---|
150 | SetCutValue(defaultCutValue, "e-"); |
---|
151 | SetCutValue(defaultCutValue, "e+"); |
---|
152 | } |
---|
153 | |
---|
154 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|