Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4EnergyLossForExtrapolator Class Reference

#include <G4EnergyLossForExtrapolator.hh>

Public Member Functions

 G4EnergyLossForExtrapolator (G4int verb=1)
 
 ~G4EnergyLossForExtrapolator ()
 
G4double ComputeDEDX (G4double kinEnergy, const G4ParticleDefinition *)
 
G4double ComputeRange (G4double kinEnergy, const G4ParticleDefinition *)
 
G4double ComputeEnergy (G4double range, const G4ParticleDefinition *)
 
G4double EnergyAfterStep (G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)
 
G4double EnergyBeforeStep (G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)
 
G4double TrueStepLength (G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
 
G4double EnergyAfterStep (G4double kinEnergy, G4double step, const G4Material *, const G4String &particleName)
 
G4double EnergyBeforeStep (G4double kinEnergy, G4double step, const G4Material *, const G4String &particleName)
 
G4double AverageScatteringAngle (G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
 
G4double AverageScatteringAngle (G4double kinEnergy, G4double step, const G4Material *, const G4String &particleName)
 
G4double ComputeTrueStep (const G4Material *, const G4ParticleDefinition *part, G4double kinEnergy, G4double stepLength)
 
G4double EnergyDispersion (G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)
 
G4double EnergyDispersion (G4double kinEnergy, G4double step, const G4Material *, const G4String &particleName)
 
void SetVerbose (G4int val)
 
void SetMinKinEnergy (G4double)
 
void SetMaxKinEnergy (G4double)
 
void SetMaxEnergyTransfer (G4double)
 

Detailed Description

Definition at line 67 of file G4EnergyLossForExtrapolator.hh.

Constructor & Destructor Documentation

G4EnergyLossForExtrapolator::G4EnergyLossForExtrapolator ( G4int  verb = 1)
explicit

Definition at line 67 of file G4EnergyLossForExtrapolator.cc.

68  : maxEnergyTransfer(DBL_MAX), verbose(verb)
69 {
70  currentParticle = nullptr;
71  currentMaterial = nullptr;
72 
73  linLossLimit = 0.01;
74  emin = 1.*MeV;
75  emax = 10.*TeV;
76  nbins = 70;
77 
78  nmat = index = 0;
79 
80  mass = charge2 = electronDensity = radLength = bg2 = beta2
81  = kineticEnergy = tmax = 0.0;
82  gam = 1.0;
83 
84  idxDedxElectron = idxDedxPositron = idxDedxMuon = idxDedxProton
85  = idxRangeElectron = idxRangePositron = idxRangeMuon = idxRangeProton
86  = idxInvRangeElectron = idxInvRangePositron = idxInvRangeMuon
87  = idxInvRangeProton = idxMscElectron = 0;
88 
89  electron = positron = proton = muonPlus = muonMinus = nullptr;
90 }
static constexpr double TeV
Definition: G4SIunits.hh:218
static constexpr double MeV
Definition: G4SIunits.hh:214
#define DBL_MAX
Definition: templates.hh:83
G4EnergyLossForExtrapolator::~G4EnergyLossForExtrapolator ( )

Definition at line 346 of file G4EnergyLossForExtrapolator.cc.

347 {
348  G4AutoLock l(&G4EnergyLossForExtrapolatorMutex);
349  delete tables;
350  tables = nullptr;
351 }

Member Function Documentation

G4double G4EnergyLossForExtrapolator::AverageScatteringAngle ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4ParticleDefinition part 
)
inline

Definition at line 248 of file G4EnergyLossForExtrapolator.hh.

253 {
254  G4double theta = 0.0;
255  if(SetupKinematics(part, mat, kinEnergy)) {
256  G4double t = stepLength/radLength;
257  G4double y = std::max(0.001, t);
258  theta = 19.23*CLHEP::MeV*std::sqrt(charge2*t)*(1.0 + 0.038*G4Log(y))
259  /(beta2*gam*mass);
260  }
261  return theta;
262 }
static constexpr double MeV
G4double G4Log(G4double x)
Definition: G4Log.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::AverageScatteringAngle ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4String particleName 
)
inline

Definition at line 227 of file G4EnergyLossForExtrapolator.hh.

231 {
232  return AverageScatteringAngle(kinEnergy,step,mat,FindParticle(name));
233 }
const XML_Char * name
Definition: expat.h:151
G4double AverageScatteringAngle(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)

Here is the call graph for this function:

G4double G4EnergyLossForExtrapolator::ComputeDEDX ( G4double  kinEnergy,
const G4ParticleDefinition part 
)

Definition at line 240 of file G4EnergyLossForExtrapolator.cc.

242 {
243  G4double x = 0.0;
244  if(part == electron) {
245  x = ComputeValue(ekin, GetPhysicsTable(fDedxElectron), idxDedxElectron);
246  } else if(part == positron) {
247  x = ComputeValue(ekin, GetPhysicsTable(fDedxPositron), idxDedxPositron);
248  } else if(part == muonPlus || part == muonMinus) {
249  x = ComputeValue(ekin, GetPhysicsTable(fDedxMuon), idxDedxMuon);
250  } else {
251  G4double e = ekin*proton_mass_c2/mass;
252  x = ComputeValue(e, GetPhysicsTable(fDedxProton), idxDedxProton)*charge2;
253  }
254  return x;
255 }
tuple x
Definition: test.py:50
float proton_mass_c2
Definition: hepunit.py:275
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::ComputeEnergy ( G4double  range,
const G4ParticleDefinition part 
)

Definition at line 282 of file G4EnergyLossForExtrapolator.cc.

284 {
285  G4double x = 0.0;
286  if(part == electron) {
287  x = ComputeValue(range, GetPhysicsTable(fInvRangeElectron),
288  idxInvRangeElectron);
289  } else if(part == positron) {
290  x = ComputeValue(range, GetPhysicsTable(fInvRangePositron),
291  idxInvRangePositron);
292  } else if(part == muonPlus || part == muonMinus) {
293  x = ComputeValue(range, GetPhysicsTable(fInvRangeMuon), idxInvRangeMuon);
294  } else {
295  G4double massratio = proton_mass_c2/mass;
296  G4double r = range*massratio*charge2;
297  x = ComputeValue(r, GetPhysicsTable(fInvRangeProton),
298  idxInvRangeProton)/massratio;
299  }
300  return x;
301 }
tuple x
Definition: test.py:50
const G4ParticleDefinition const G4Material *G4double range
float proton_mass_c2
Definition: hepunit.py:275
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::ComputeRange ( G4double  kinEnergy,
const G4ParticleDefinition part 
)

Definition at line 260 of file G4EnergyLossForExtrapolator.cc.

262 {
263  G4double x = 0.0;
264  if(part == electron) {
265  x = ComputeValue(ekin, GetPhysicsTable(fRangeElectron), idxRangeElectron);
266  } else if(part == positron) {
267  x = ComputeValue(ekin, GetPhysicsTable(fRangePositron), idxRangePositron);
268  } else if(part == muonPlus || part == muonMinus) {
269  x = ComputeValue(ekin, GetPhysicsTable(fRangeMuon), idxRangeMuon);
270  } else {
271  G4double massratio = proton_mass_c2/mass;
272  G4double e = ekin*massratio;
273  x = ComputeValue(e, GetPhysicsTable(fRangeProton), idxRangeProton)
274  /(charge2*massratio);
275  }
276  return x;
277 }
tuple x
Definition: test.py:50
float proton_mass_c2
Definition: hepunit.py:275
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::ComputeTrueStep ( const G4Material mat,
const G4ParticleDefinition part,
G4double  kinEnergy,
G4double  stepLength 
)
inline

Definition at line 267 of file G4EnergyLossForExtrapolator.hh.

271 {
272  G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part);
273  return stepLength*std::sqrt(1.0 + 0.625*theta*theta);
274 }
G4double AverageScatteringAngle(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyAfterStep ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4ParticleDefinition part 
)

Definition at line 95 of file G4EnergyLossForExtrapolator.cc.

99 {
100  if(0 == nmat) { Initialisation(); }
101  G4double kinEnergyFinal = kinEnergy;
102  if(SetupKinematics(part, mat, kinEnergy)) {
103  G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
104  G4double r = ComputeRange(kinEnergy,part);
105  if(r <= step) {
106  kinEnergyFinal = 0.0;
107  } else if(step < linLossLimit*r) {
108  kinEnergyFinal -= step*ComputeDEDX(kinEnergy,part);
109  } else {
110  G4double r1 = r - step;
111  kinEnergyFinal = ComputeEnergy(r1,part);
112  }
113  }
114  return kinEnergyFinal;
115 }
G4double TrueStepLength(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeRange(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeEnergy(G4double range, const G4ParticleDefinition *)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyAfterStep ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4String particleName 
)
inline

Definition at line 205 of file G4EnergyLossForExtrapolator.hh.

209 {
210  return EnergyAfterStep(kinEnergy,step,mat,FindParticle(name));
211 }
const XML_Char * name
Definition: expat.h:151
G4double EnergyAfterStep(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

Here is the call graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyBeforeStep ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4ParticleDefinition part 
)

Definition at line 120 of file G4EnergyLossForExtrapolator.cc.

124 {
125  //G4cout << "G4EnergyLossForExtrapolator::EnergyBeforeStep" << G4endl;
126  if(0 == nmat) { Initialisation(); }
127  G4double kinEnergyFinal = kinEnergy;
128 
129  if(SetupKinematics(part, mat, kinEnergy)) {
130  G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
131  G4double r = ComputeRange(kinEnergy,part);
132 
133  if(step < linLossLimit*r) {
134  kinEnergyFinal += step*ComputeDEDX(kinEnergy,part);
135  } else {
136  G4double r1 = r + step;
137  kinEnergyFinal = ComputeEnergy(r1,part);
138  }
139  }
140  return kinEnergyFinal;
141 }
G4double TrueStepLength(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeRange(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeEnergy(G4double range, const G4ParticleDefinition *)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyBeforeStep ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4String particleName 
)
inline

Definition at line 216 of file G4EnergyLossForExtrapolator.hh.

220 {
221  return EnergyBeforeStep(kinEnergy,step,mat,FindParticle(name));
222 }
const XML_Char * name
Definition: expat.h:151
G4double EnergyBeforeStep(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

Here is the call graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyDispersion ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4ParticleDefinition part 
)
inline

Definition at line 279 of file G4EnergyLossForExtrapolator.hh.

283 {
284  G4double sig2 = 0.0;
285  if(SetupKinematics(part, mat, kinEnergy)) {
286  G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
287  sig2 = (1.0/beta2 - 0.5)
288  *CLHEP::twopi_mc2_rcl2*tmax*step*electronDensity*charge2;
289  }
290  return sig2;
291 }
static constexpr double twopi_mc2_rcl2
G4double ComputeTrueStep(const G4Material *, const G4ParticleDefinition *part, G4double kinEnergy, G4double stepLength)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossForExtrapolator::EnergyDispersion ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4String particleName 
)
inline

Definition at line 238 of file G4EnergyLossForExtrapolator.hh.

242 {
243  return EnergyDispersion(kinEnergy,step,mat,FindParticle(name));
244 }
const XML_Char * name
Definition: expat.h:151
G4double EnergyDispersion(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

Here is the call graph for this function:

void G4EnergyLossForExtrapolator::SetMaxEnergyTransfer ( G4double  val)
inline

Definition at line 328 of file G4EnergyLossForExtrapolator.hh.

329 {
330  maxEnergyTransfer = val;
331 }
void G4EnergyLossForExtrapolator::SetMaxKinEnergy ( G4double  val)
inline

Definition at line 321 of file G4EnergyLossForExtrapolator.hh.

322 {
323  emax = val;
324 }
void G4EnergyLossForExtrapolator::SetMinKinEnergy ( G4double  val)
inline

Definition at line 314 of file G4EnergyLossForExtrapolator.hh.

315 {
316  emin = val;
317 }
void G4EnergyLossForExtrapolator::SetVerbose ( G4int  val)
inline

Definition at line 307 of file G4EnergyLossForExtrapolator.hh.

308 {
309  verbose = val;
310 }
G4double G4EnergyLossForExtrapolator::TrueStepLength ( G4double  kinEnergy,
G4double  step,
const G4Material mat,
const G4ParticleDefinition part 
)

Definition at line 146 of file G4EnergyLossForExtrapolator.cc.

150 {
151  G4double res = stepLength;
152  if(0 == nmat) { Initialisation(); }
153  //G4cout << "## G4EnergyLossForExtrapolator::TrueStepLength L= " << res
154  // << " " << part->GetParticleName() << G4endl;
155  if(SetupKinematics(part, mat, kinEnergy)) {
156  if(part == electron || part == positron) {
157  G4double x = stepLength*
158  ComputeValue(kinEnergy, GetPhysicsTable(fMscElectron), idxMscElectron);
159  //G4cout << " x= " << x << G4endl;
160  if(x < 0.2) { res *= (1.0 + 0.5*x + x*x/3.0); }
161  else if(x < 0.9999) { res = -G4Log(1.0 - x)*stepLength/x; }
162  else { res = ComputeRange(kinEnergy,part); }
163  } else {
164  res = ComputeTrueStep(mat,part,kinEnergy,stepLength);
165  }
166  }
167  return res;
168 }
tuple x
Definition: test.py:50
G4double ComputeTrueStep(const G4Material *, const G4ParticleDefinition *part, G4double kinEnergy, G4double stepLength)
G4double ComputeRange(G4double kinEnergy, const G4ParticleDefinition *)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: