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 | // Code developed by: |
---|
28 | // S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano, S.Guatelli |
---|
29 | // |
---|
30 | // Code review: MGP, 5 November 2006 (still to be completed) |
---|
31 | // |
---|
32 | // ********************************** |
---|
33 | // * * |
---|
34 | // * BrachyPhysicsList.cc * |
---|
35 | // * * |
---|
36 | // ********************************** |
---|
37 | // |
---|
38 | // $Id: BrachyPhysicsList.cc,v 1.14 2009/11/12 02:50:51 cirrone Exp $ |
---|
39 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
40 | // |
---|
41 | #include "BrachyPhysicsList.hh" |
---|
42 | |
---|
43 | #include "G4ParticleDefinition.hh" |
---|
44 | #include "G4ProductionCutsTable.hh" |
---|
45 | #include "G4ProcessManager.hh" |
---|
46 | #include "G4ParticleTypes.hh" |
---|
47 | #include "G4UnitsTable.hh" |
---|
48 | #include "G4ios.hh" |
---|
49 | #include "G4MultipleScattering.hh" |
---|
50 | // gamma |
---|
51 | #include "G4PhotoElectricEffect.hh" |
---|
52 | #include "G4LivermorePhotoElectricModel.hh" |
---|
53 | |
---|
54 | #include "G4ComptonScattering.hh" |
---|
55 | #include "G4LivermoreComptonModel.hh" |
---|
56 | |
---|
57 | #include "G4GammaConversion.hh" |
---|
58 | #include "G4LivermoreGammaConversionModel.hh" |
---|
59 | |
---|
60 | #include "G4RayleighScattering.hh" |
---|
61 | #include "G4LivermoreRayleighModel.hh" |
---|
62 | |
---|
63 | // e- |
---|
64 | #include "G4eMultipleScattering.hh" |
---|
65 | #include "G4eIonisation.hh" |
---|
66 | #include "G4LivermoreIonisationModel.hh" |
---|
67 | #include "G4eBremsstrahlung.hh" |
---|
68 | #include "G4LivermoreBremsstrahlungModel.hh" |
---|
69 | |
---|
70 | // e+ |
---|
71 | #include "G4eIonisation.hh" |
---|
72 | #include "G4eBremsstrahlung.hh" |
---|
73 | #include "G4eplusAnnihilation.hh" |
---|
74 | |
---|
75 | BrachyPhysicsList::BrachyPhysicsList(): G4VUserPhysicsList() |
---|
76 | { |
---|
77 | SetVerboseLevel(1); |
---|
78 | } |
---|
79 | |
---|
80 | BrachyPhysicsList::~BrachyPhysicsList() |
---|
81 | { |
---|
82 | } |
---|
83 | |
---|
84 | void BrachyPhysicsList::ConstructParticle() |
---|
85 | { |
---|
86 | // In this method, static member functions should be called |
---|
87 | // for all particles which you want to use. |
---|
88 | // This ensures that objects of these particle types will be |
---|
89 | // created in the program. |
---|
90 | |
---|
91 | ConstructBosons(); |
---|
92 | ConstructLeptons(); |
---|
93 | |
---|
94 | } |
---|
95 | |
---|
96 | void BrachyPhysicsList::ConstructBosons() |
---|
97 | { |
---|
98 | // photons |
---|
99 | G4Gamma::GammaDefinition(); |
---|
100 | } |
---|
101 | |
---|
102 | void BrachyPhysicsList::ConstructLeptons() |
---|
103 | { |
---|
104 | // leptons |
---|
105 | G4Electron::ElectronDefinition(); |
---|
106 | G4Positron::PositronDefinition(); |
---|
107 | } |
---|
108 | |
---|
109 | void BrachyPhysicsList::ConstructProcess() |
---|
110 | { |
---|
111 | AddTransportation(); |
---|
112 | ConstructEM(); |
---|
113 | } |
---|
114 | |
---|
115 | void BrachyPhysicsList::ConstructEM() |
---|
116 | { |
---|
117 | theParticleIterator->reset(); |
---|
118 | |
---|
119 | while( (*theParticleIterator)() ){ |
---|
120 | |
---|
121 | G4ParticleDefinition* particle = theParticleIterator->value(); |
---|
122 | G4ProcessManager* pmanager = particle->GetProcessManager(); |
---|
123 | G4String particleName = particle->GetParticleName(); |
---|
124 | |
---|
125 | // Processes |
---|
126 | |
---|
127 | if (particleName == "gamma") { |
---|
128 | |
---|
129 | // Photon |
---|
130 | G4RayleighScattering* theRayleigh = new G4RayleighScattering(); |
---|
131 | theRayleigh->SetModel(new G4LivermoreRayleighModel()); //not strictly necessary |
---|
132 | pmanager->AddDiscreteProcess(theRayleigh); |
---|
133 | |
---|
134 | G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect(); |
---|
135 | thePhotoElectricEffect->SetModel(new G4LivermorePhotoElectricModel()); |
---|
136 | pmanager->AddDiscreteProcess(thePhotoElectricEffect); |
---|
137 | |
---|
138 | G4ComptonScattering* theComptonScattering = new G4ComptonScattering(); |
---|
139 | theComptonScattering->SetModel(new G4LivermoreComptonModel()); |
---|
140 | pmanager->AddDiscreteProcess(theComptonScattering); |
---|
141 | |
---|
142 | G4GammaConversion* theGammaConversion = new G4GammaConversion(); |
---|
143 | theGammaConversion->SetModel(new G4LivermoreGammaConversionModel()); |
---|
144 | pmanager->AddDiscreteProcess(theGammaConversion); |
---|
145 | |
---|
146 | } else if (particleName == "e-") { |
---|
147 | // Electron |
---|
148 | |
---|
149 | G4eMultipleScattering* msc = new G4eMultipleScattering(); |
---|
150 | msc->SetStepLimitType(fUseDistanceToBoundary); |
---|
151 | pmanager->AddProcess(msc,-1, 1, 1); |
---|
152 | |
---|
153 | // Ionisation |
---|
154 | G4eIonisation* eIonisation = new G4eIonisation(); |
---|
155 | eIonisation->SetEmModel(new G4LivermoreIonisationModel()); |
---|
156 | eIonisation->SetStepFunction(0.2, 100*um); //improved precision in tracking |
---|
157 | pmanager->AddProcess(eIonisation,-1, 2, 2); |
---|
158 | |
---|
159 | // Bremsstrahlung |
---|
160 | G4eBremsstrahlung* eBremsstrahlung = new G4eBremsstrahlung(); |
---|
161 | eBremsstrahlung->SetEmModel(new G4LivermoreBremsstrahlungModel()); |
---|
162 | pmanager->AddProcess(eBremsstrahlung, -1,-3, 3); |
---|
163 | |
---|
164 | } else if (particleName == "e+") { |
---|
165 | // Positron |
---|
166 | G4eMultipleScattering* msc = new G4eMultipleScattering(); |
---|
167 | msc->SetStepLimitType(fUseDistanceToBoundary); |
---|
168 | pmanager->AddProcess(msc,-1, 1, 1); |
---|
169 | |
---|
170 | // Ionisation |
---|
171 | G4eIonisation* eIonisation = new G4eIonisation(); |
---|
172 | eIonisation->SetStepFunction(0.2, 100*um); // |
---|
173 | pmanager->AddProcess(eIonisation, -1, 2, 2); |
---|
174 | |
---|
175 | //Bremsstrahlung (use default, no low-energy available) |
---|
176 | pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3); |
---|
177 | |
---|
178 | //Annihilation |
---|
179 | pmanager->AddProcess(new G4eplusAnnihilation(),0,-1, 4); |
---|
180 | |
---|
181 | } |
---|
182 | } |
---|
183 | } |
---|
184 | |
---|
185 | void BrachyPhysicsList::SetCuts() |
---|
186 | { |
---|
187 | // The production threshold is fixed to 0.1 mm for all the particles |
---|
188 | // Secondary particles with a range bigger than 0.1 mm |
---|
189 | // are generated; otherwise their energy is considered deposited locally |
---|
190 | |
---|
191 | defaultCutValue = 0.1 * mm; |
---|
192 | |
---|
193 | const G4double cutForGamma = defaultCutValue; |
---|
194 | const G4double cutForElectron = defaultCutValue; |
---|
195 | const G4double cutForPositron = defaultCutValue; |
---|
196 | |
---|
197 | SetCutValue(cutForGamma, "gamma"); |
---|
198 | SetCutValue(cutForElectron, "e-"); |
---|
199 | SetCutValue(cutForPositron, "e+"); |
---|
200 | |
---|
201 | // Set the secondary production cut lower than 990. eV |
---|
202 | // Very important for high precision of lowenergy processes at low energies |
---|
203 | |
---|
204 | G4double lowLimit = 250. * eV; |
---|
205 | G4double highLimit = 100. * GeV; |
---|
206 | G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowLimit, highLimit); |
---|
207 | |
---|
208 | if (verboseLevel>0) DumpCutValuesTable(); |
---|
209 | } |
---|