Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 66 of file G4EnergyLossForExtrapolator.hh.

Constructor & Destructor Documentation

◆ G4EnergyLossForExtrapolator()

G4EnergyLossForExtrapolator::G4EnergyLossForExtrapolator ( G4int  verb = 1)

Definition at line 75 of file G4EnergyLossForExtrapolator.cc.

76 :maxEnergyTransfer(DBL_MAX),verbose(verb),isInitialised(false)
77{
78 currentParticle = 0;
79 currentMaterial = 0;
80
81 linLossLimit = 0.01;
82 emin = 1.*MeV;
83 emax = 10.*TeV;
84 nbins = 70;
85
86 nmat = index = 0;
87 cuts = 0;
88
89 mass = charge2 = electronDensity = radLength = bg2 = beta2
90 = kineticEnergy = tmax = 0;
91 gam = 1.0;
92
93 dedxElectron = dedxPositron = dedxProton = rangeElectron
94 = rangePositron = rangeProton = invRangeElectron = invRangePositron
95 = invRangeProton = mscElectron = dedxMuon = rangeMuon = invRangeMuon = 0;
96 cuts = 0;
97 electron = positron = proton = muonPlus = muonMinus = 0;
98}
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4EnergyLossForExtrapolator()

G4EnergyLossForExtrapolator::~G4EnergyLossForExtrapolator ( )

Definition at line 102 of file G4EnergyLossForExtrapolator.cc.

103{
104 for(G4int i=0; i<nmat; i++) {delete couples[i];}
105 delete dedxElectron;
106 delete dedxPositron;
107 delete dedxProton;
108 delete dedxMuon;
109 delete rangeElectron;
110 delete rangePositron;
111 delete rangeProton;
112 delete rangeMuon;
113 delete invRangeElectron;
114 delete invRangePositron;
115 delete invRangeProton;
116 delete invRangeMuon;
117 delete mscElectron;
118 delete cuts;
119}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ AverageScatteringAngle() [1/2]

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

Definition at line 237 of file G4EnergyLossForExtrapolator.hh.

241{
242 G4double theta = 0.0;
243 if(SetupKinematics(part, mat, kinEnergy)) {
244 G4double t = stepLength/radLength;
245 G4double y = std::max(0.001, t);
246 theta = 19.23*CLHEP::MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(y))/(beta2*gam*mass);
247 }
248 return theta;
249}
double G4double
Definition: G4Types.hh:64

Referenced by AverageScatteringAngle(), and ComputeTrueStep().

◆ AverageScatteringAngle() [2/2]

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

Definition at line 215 of file G4EnergyLossForExtrapolator.hh.

219{
220 return AverageScatteringAngle(kinEnergy,step,mat,FindParticle(name));
221}
G4double AverageScatteringAngle(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)

◆ ComputeDEDX()

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

Definition at line 350 of file G4EnergyLossForExtrapolator.cc.

352{
353 G4double x = 0.0;
354 if(part == electron) x = ComputeValue(kinEnergy, dedxElectron);
355 else if(part == positron) x = ComputeValue(kinEnergy, dedxPositron);
356 else if(part == muonPlus || part == muonMinus) {
357 x = ComputeValue(kinEnergy, dedxMuon);
358 } else {
359 G4double e = kinEnergy*proton_mass_c2/mass;
360 x = ComputeValue(e, dedxProton)*charge2;
361 }
362 return x;
363}

Referenced by EnergyAfterStep(), and EnergyBeforeStep().

◆ ComputeEnergy()

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

Definition at line 385 of file G4EnergyLossForExtrapolator.cc.

387{
388 G4double x = 0.0;
389 if(part == electron) x = ComputeValue(range, invRangeElectron);
390 else if(part == positron) x = ComputeValue(range, invRangePositron);
391 else if(part == muonPlus || part == muonMinus)
392 x = ComputeValue(range, invRangeMuon);
393 else {
394 G4double massratio = proton_mass_c2/mass;
395 G4double r = range*massratio*charge2;
396 x = ComputeValue(r, invRangeProton)/massratio;
397 }
398 return x;
399}

Referenced by EnergyAfterStep(), and EnergyBeforeStep().

◆ ComputeRange()

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

Definition at line 367 of file G4EnergyLossForExtrapolator.cc.

369{
370 G4double x = 0.0;
371 if(part == electron) x = ComputeValue(kinEnergy, rangeElectron);
372 else if(part == positron) x = ComputeValue(kinEnergy, rangePositron);
373 else if(part == muonPlus || part == muonMinus)
374 x = ComputeValue(kinEnergy, rangeMuon);
375 else {
376 G4double massratio = proton_mass_c2/mass;
377 G4double e = kinEnergy*massratio;
378 x = ComputeValue(e, rangeProton)/(charge2*massratio);
379 }
380 return x;
381}

Referenced by EnergyAfterStep(), EnergyBeforeStep(), and TrueStepLength().

◆ ComputeTrueStep()

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

Definition at line 254 of file G4EnergyLossForExtrapolator.hh.

258{
259 G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part);
260 return stepLength*std::sqrt(1.0 + 0.625*theta*theta);
261}

Referenced by EnergyDispersion(), and TrueStepLength().

◆ EnergyAfterStep() [1/2]

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

Definition at line 123 of file G4EnergyLossForExtrapolator.cc.

127{
128 if(!isInitialised) Initialisation();
129 G4double kinEnergyFinal = kinEnergy;
130 if(SetupKinematics(part, mat, kinEnergy)) {
131 G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
132 G4double r = ComputeRange(kinEnergy,part);
133 if(r <= step) {
134 kinEnergyFinal = 0.0;
135 } else if(step < linLossLimit*r) {
136 kinEnergyFinal -= step*ComputeDEDX(kinEnergy,part);
137 } else {
138 G4double r1 = r - step;
139 kinEnergyFinal = ComputeEnergy(r1,part);
140 }
141 }
142 return kinEnergyFinal;
143}
G4double TrueStepLength(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *part)
G4double ComputeRange(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeDEDX(G4double kinEnergy, const G4ParticleDefinition *)
G4double ComputeEnergy(G4double range, const G4ParticleDefinition *)

Referenced by G4ErrorEnergyLoss::AlongStepDoIt(), EnergyAfterStep(), and G4ErrorEnergyLoss::GetContinuousStepLimit().

◆ EnergyAfterStep() [2/2]

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

Definition at line 195 of file G4EnergyLossForExtrapolator.hh.

199{
200 return EnergyAfterStep(kinEnergy,step,mat,FindParticle(name));
201}
G4double EnergyAfterStep(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

◆ EnergyBeforeStep() [1/2]

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

Definition at line 147 of file G4EnergyLossForExtrapolator.cc.

151{
152 if(!isInitialised) Initialisation();
153 G4double kinEnergyFinal = kinEnergy;
154
155 if(SetupKinematics(part, mat, kinEnergy)) {
156 G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
157 G4double r = ComputeRange(kinEnergy,part);
158
159 if(step < linLossLimit*r) {
160 kinEnergyFinal += step*ComputeDEDX(kinEnergy,part);
161 } else {
162 G4double r1 = r + step;
163 kinEnergyFinal = ComputeEnergy(r1,part);
164 }
165 }
166 return kinEnergyFinal;
167}

Referenced by G4ErrorEnergyLoss::AlongStepDoIt(), EnergyBeforeStep(), and G4ErrorEnergyLoss::GetContinuousStepLimit().

◆ EnergyBeforeStep() [2/2]

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

Definition at line 205 of file G4EnergyLossForExtrapolator.hh.

209{
210 return EnergyBeforeStep(kinEnergy,step,mat,FindParticle(name));
211}
G4double EnergyBeforeStep(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

◆ EnergyDispersion() [1/2]

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

Definition at line 266 of file G4EnergyLossForExtrapolator.hh.

270{
271 G4double sig2 = 0.0;
272 if(SetupKinematics(part, mat, kinEnergy)) {
273 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
274 sig2 = (1.0/beta2 - 0.5)*CLHEP::twopi_mc2_rcl2*tmax*step*electronDensity*charge2;
275 }
276 return sig2;
277}
G4double ComputeTrueStep(const G4Material *, const G4ParticleDefinition *part, G4double kinEnergy, G4double stepLength)

Referenced by EnergyDispersion().

◆ EnergyDispersion() [2/2]

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

Definition at line 226 of file G4EnergyLossForExtrapolator.hh.

230{
231 return EnergyDispersion(kinEnergy,step,mat,FindParticle(name));
232}
G4double EnergyDispersion(G4double kinEnergy, G4double step, const G4Material *, const G4ParticleDefinition *)

◆ SetMaxEnergyTransfer()

void G4EnergyLossForExtrapolator::SetMaxEnergyTransfer ( G4double  val)
inline

Definition at line 313 of file G4EnergyLossForExtrapolator.hh.

314{
315 maxEnergyTransfer = val;
316}

◆ SetMaxKinEnergy()

void G4EnergyLossForExtrapolator::SetMaxKinEnergy ( G4double  val)
inline

Definition at line 306 of file G4EnergyLossForExtrapolator.hh.

307{
308 emax = val;
309}

◆ SetMinKinEnergy()

void G4EnergyLossForExtrapolator::SetMinKinEnergy ( G4double  val)
inline

Definition at line 299 of file G4EnergyLossForExtrapolator.hh.

300{
301 emin = val;
302}

◆ SetVerbose()

void G4EnergyLossForExtrapolator::SetVerbose ( G4int  val)
inline

Definition at line 292 of file G4EnergyLossForExtrapolator.hh.

293{
294 verbose = val;
295}

◆ TrueStepLength()

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

Definition at line 171 of file G4EnergyLossForExtrapolator.cc.

175{
176 G4double res = stepLength;
177 if(!isInitialised) Initialisation();
178 if(SetupKinematics(part, mat, kinEnergy)) {
179 if(part == electron || part == positron) {
180 G4double x = stepLength*ComputeValue(kinEnergy, mscElectron);
181 if(x < 0.2) res *= (1.0 + 0.5*x + x*x/3.0);
182 else if(x < 0.9999) res = -std::log(1.0 - x)*stepLength/x;
183 else res = ComputeRange(kinEnergy,part);
184
185 } else {
186 res = ComputeTrueStep(mat,part,kinEnergy,stepLength);
187 }
188 }
189 return res;
190}

Referenced by EnergyAfterStep(), EnergyBeforeStep(), and G4EnergySplitter::SplitEnergyInVolumes().


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