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: G4hRDEnergyLoss.hh,v 1.2 2010/11/19 17:16:09 pia Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
29 | // |
---|
30 | // $Id: |
---|
31 | // ------------------------------------------------------------ |
---|
32 | // GEANT 4 class header file |
---|
33 | // |
---|
34 | // History: first implementation, based on object model of |
---|
35 | // 2nd December 1995, G.Cosmo |
---|
36 | // ---------- G4hEnergyLoss physics process ----------- |
---|
37 | // by Laszlo Urban, 30 May 1997 |
---|
38 | // |
---|
39 | // ************************************************************ |
---|
40 | // It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS. |
---|
41 | // It calculates the continuous energy loss for charged hadrons. |
---|
42 | // Processes giving contribution to the continuous loss : |
---|
43 | // ionisation (= cont.ion.loss + delta ray production) |
---|
44 | // can be added more easily .......... |
---|
45 | // This class creates static proton/antiproton dE/dx and range tables , |
---|
46 | // which tables can be used by other processes. |
---|
47 | // The energy loss for other charged hadrons is calculated from the p/pbar |
---|
48 | // tables with scaled kinetic energy. |
---|
49 | // |
---|
50 | // 7/10/98 L.Urban some bugs fixed + some cleanup |
---|
51 | // 22/10/98 L.Urban cleanup |
---|
52 | // 02/02/99 L.Urban several bugs fixed |
---|
53 | // 31/03/00 V.Ivanchenko rename to lowenergy as G4hLowEnergyLoss.hh |
---|
54 | // 09/08/00 V.Ivanchenko remove GetContinuousStepLimit and IsApplicable |
---|
55 | // 23/11/01 V.Ivanchenko Move static member-functions from header to source |
---|
56 | // 22/01/03 V.Ivanchenko Cuts per region |
---|
57 | // 18/04/03 V.Ivanchenko Make dRoverRange protected |
---|
58 | // |
---|
59 | // 31 Jul 2008 MGP Short term supply of energy loss of hadrons through clone of |
---|
60 | // former G4hLowEnergyLoss (with some initial cleaning) |
---|
61 | // To be replaced by reworked class to deal with condensed/discrete |
---|
62 | // issues properly |
---|
63 | // |
---|
64 | // -------------------------------------------------------------- |
---|
65 | |
---|
66 | // Class description: |
---|
67 | // Short term supply of energy loss of hadrons through clone of former G4hLowEnergyLoss |
---|
68 | // (with some initial cleaning) |
---|
69 | // To be replaced by reworked class to deal with condensed/discrete issues properly |
---|
70 | |
---|
71 | // -------------------------------------------------------------- |
---|
72 | |
---|
73 | |
---|
74 | #ifndef G4HRDENERGYLOSS_HH |
---|
75 | #define G4HRDENERGYLOSS_HH 1 |
---|
76 | |
---|
77 | #include "G4ios.hh" |
---|
78 | #include "globals.hh" |
---|
79 | #include "Randomize.hh" |
---|
80 | #include "G4VContinuousDiscreteProcess.hh" |
---|
81 | #include "G4Material.hh" |
---|
82 | #include "G4Element.hh" |
---|
83 | #include "G4Proton.hh" |
---|
84 | #include "G4AntiProton.hh" |
---|
85 | #include "G4Electron.hh" |
---|
86 | #include "G4VParticleChange.hh" |
---|
87 | #include "G4Track.hh" |
---|
88 | #include "G4Step.hh" |
---|
89 | #include "G4PhysicsLogVector.hh" |
---|
90 | #include "G4PhysicsLinearVector.hh" |
---|
91 | |
---|
92 | class G4EnergyLossMessenger; |
---|
93 | |
---|
94 | class G4hRDEnergyLoss : public G4VContinuousDiscreteProcess |
---|
95 | |
---|
96 | { |
---|
97 | public: |
---|
98 | |
---|
99 | G4hRDEnergyLoss(const G4String& ); |
---|
100 | |
---|
101 | ~G4hRDEnergyLoss(); |
---|
102 | |
---|
103 | virtual G4double GetMeanFreePath( |
---|
104 | const G4Track& track, |
---|
105 | G4double previousStepSize, |
---|
106 | enum G4ForceCondition* condition |
---|
107 | ) = 0 ; |
---|
108 | |
---|
109 | virtual G4VParticleChange* PostStepDoIt(const G4Track& track, |
---|
110 | const G4Step& Step) = 0 ; |
---|
111 | |
---|
112 | // ---- MGP ---- All this static stuff is expected to disappear in a future |
---|
113 | // development cycle |
---|
114 | |
---|
115 | // get the number of processes contributing to the cont.energy loss |
---|
116 | static G4int GetNumberOfProcesses(); |
---|
117 | |
---|
118 | // set the number of processes contributing to the cont.energy loss |
---|
119 | static void SetNumberOfProcesses(G4int number); |
---|
120 | |
---|
121 | // Increment the number of processes contributing to the cont.energy loss |
---|
122 | static void PlusNumberOfProcesses(); |
---|
123 | |
---|
124 | // decrement the number of processes contributing to the cont.energy loss |
---|
125 | static void MinusNumberOfProcesses(); |
---|
126 | |
---|
127 | static void SetdRoverRange(G4double value); |
---|
128 | static void SetRndmStep (G4bool value); |
---|
129 | static void SetEnlossFluc (G4bool value); |
---|
130 | static void SetStepFunction (G4double c1, G4double c2); |
---|
131 | |
---|
132 | protected: |
---|
133 | |
---|
134 | G4bool CutsWhereModified(); |
---|
135 | |
---|
136 | // G4Material *lastMaterial ; |
---|
137 | const G4double MaxExcitationNumber ; |
---|
138 | const G4double probLimFluct ; |
---|
139 | const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ; |
---|
140 | |
---|
141 | static void BuildDEDXTable(const G4ParticleDefinition& aParticleType); |
---|
142 | |
---|
143 | protected: |
---|
144 | |
---|
145 | static G4PhysicsTable* theDEDXpTable ; |
---|
146 | static G4PhysicsTable* theDEDXpbarTable ; |
---|
147 | static G4PhysicsTable* theRangepTable ; |
---|
148 | static G4PhysicsTable* theRangepbarTable ; |
---|
149 | |
---|
150 | //inverse of the range tables |
---|
151 | static G4PhysicsTable* theInverseRangepTable ; |
---|
152 | static G4PhysicsTable* theInverseRangepbarTable ; |
---|
153 | |
---|
154 | //lab and proper time tables |
---|
155 | static G4PhysicsTable* theLabTimepTable ; |
---|
156 | static G4PhysicsTable* theLabTimepbarTable ; |
---|
157 | |
---|
158 | static G4PhysicsTable* theProperTimepTable ; |
---|
159 | static G4PhysicsTable* theProperTimepbarTable ; |
---|
160 | |
---|
161 | // processes inherited from G4hRDEnergyLoss |
---|
162 | // register themselves in the static array Recorder |
---|
163 | static G4PhysicsTable** RecorderOfpProcess; |
---|
164 | static G4PhysicsTable** RecorderOfpbarProcess; |
---|
165 | static G4int CounterOfpProcess ; |
---|
166 | static G4int CounterOfpbarProcess ; |
---|
167 | |
---|
168 | // particle mass |
---|
169 | static G4double ParticleMass ; |
---|
170 | |
---|
171 | // cut in range |
---|
172 | static G4double ptableElectronCutInRange; |
---|
173 | static G4double pbartableElectronCutInRange; |
---|
174 | |
---|
175 | static G4double Charge ; |
---|
176 | |
---|
177 | static G4double LowestKineticEnergy; |
---|
178 | static G4double HighestKineticEnergy; |
---|
179 | static G4int TotBin; // number of bins in table, |
---|
180 | // calculated in BuildPhysicsTable |
---|
181 | |
---|
182 | static G4double RTable,LOGRTable; // LOGRTable=std::log(HighestKineticEnergy |
---|
183 | // /LowestKineticEnergy)/TotBin |
---|
184 | // RTable = std::exp(LOGRTable) |
---|
185 | |
---|
186 | G4PhysicsTable* theLossTable ; |
---|
187 | |
---|
188 | G4double linLossLimit ; |
---|
189 | |
---|
190 | G4double MinKineticEnergy ; |
---|
191 | |
---|
192 | static G4double dRoverRange ; // maximum allowed deltarange/range |
---|
193 | // in one step |
---|
194 | static G4double finalRange ; // last step before stop |
---|
195 | static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit |
---|
196 | |
---|
197 | static G4bool rndmStepFlag ; |
---|
198 | static G4bool EnlossFlucFlag ; |
---|
199 | |
---|
200 | |
---|
201 | private: |
---|
202 | |
---|
203 | // hide assignment operator |
---|
204 | |
---|
205 | G4hRDEnergyLoss(G4hRDEnergyLoss &); |
---|
206 | G4hRDEnergyLoss & operator=(const G4hRDEnergyLoss &right); |
---|
207 | |
---|
208 | // variables for the integration routines |
---|
209 | static G4double Mass,taulow,tauhigh,ltaulow,ltauhigh; |
---|
210 | |
---|
211 | // ==================================================================== |
---|
212 | // static part of the class |
---|
213 | |
---|
214 | static void BuildRangeTable(const G4ParticleDefinition& aParticleType); |
---|
215 | |
---|
216 | static void BuildInverseRangeTable(const G4ParticleDefinition& aParticleType); |
---|
217 | |
---|
218 | static void BuildTimeTables(const G4ParticleDefinition& aParticleType); |
---|
219 | |
---|
220 | static void BuildLabTimeVector(G4int materialIndex, |
---|
221 | G4PhysicsLogVector* rangeVector); |
---|
222 | |
---|
223 | static void BuildProperTimeVector(G4int materialIndex, |
---|
224 | G4PhysicsLogVector* rangeVector); |
---|
225 | |
---|
226 | static void InvertRangeVector(G4int materialIndex, |
---|
227 | G4PhysicsLogVector* rangeVector); |
---|
228 | |
---|
229 | static void BuildRangeVector(G4int materialIndex, |
---|
230 | G4PhysicsLogVector* rangeVector); |
---|
231 | |
---|
232 | static G4double LabTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin); |
---|
233 | |
---|
234 | static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin); |
---|
235 | |
---|
236 | static G4double RangeIntLin(G4PhysicsVector* physicsVector, G4int nbin); |
---|
237 | |
---|
238 | static G4double RangeIntLog(G4PhysicsVector* physicsVector, G4int nbin); |
---|
239 | |
---|
240 | static void BuildRangeCoeffATable( const G4ParticleDefinition& aParticleType); |
---|
241 | static void BuildRangeCoeffBTable( const G4ParticleDefinition& aParticleType); |
---|
242 | static void BuildRangeCoeffCTable(const G4ParticleDefinition& aParticleType); |
---|
243 | |
---|
244 | // ==================================================================== |
---|
245 | |
---|
246 | static G4PhysicsTable* theDEDXTable; |
---|
247 | |
---|
248 | static G4PhysicsTable* theRangeTable; |
---|
249 | static G4PhysicsTable* theInverseRangeTable; |
---|
250 | |
---|
251 | static G4PhysicsTable* theLabTimeTable; |
---|
252 | static G4PhysicsTable* theProperTimeTable; |
---|
253 | |
---|
254 | static G4PhysicsTable** RecorderOfProcess; |
---|
255 | static G4int CounterOfProcess; |
---|
256 | |
---|
257 | static G4PhysicsTable* thepRangeCoeffATable; |
---|
258 | static G4PhysicsTable* thepRangeCoeffBTable; |
---|
259 | static G4PhysicsTable* thepRangeCoeffCTable; |
---|
260 | static G4PhysicsTable* thepbarRangeCoeffATable; |
---|
261 | static G4PhysicsTable* thepbarRangeCoeffBTable; |
---|
262 | static G4PhysicsTable* thepbarRangeCoeffCTable; |
---|
263 | |
---|
264 | static G4PhysicsTable* theRangeCoeffATable; |
---|
265 | static G4PhysicsTable* theRangeCoeffBTable; |
---|
266 | static G4PhysicsTable* theRangeCoeffCTable; |
---|
267 | static G4int NumberOfProcesses ; |
---|
268 | |
---|
269 | }; |
---|
270 | |
---|
271 | #endif |
---|
272 | |
---|
273 | |
---|
274 | |
---|