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