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