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 ( G4int  verb = 1  ) 

Definition at line 75 of file G4EnergyLossForExtrapolator.cc.

00076   :maxEnergyTransfer(DBL_MAX),verbose(verb),isInitialised(false)
00077 {
00078   currentParticle = 0;
00079   currentMaterial = 0;
00080 
00081   linLossLimit = 0.01;
00082   emin         = 1.*MeV;
00083   emax         = 10.*TeV;
00084   nbins        = 70;
00085 
00086   nmat = index = 0;
00087   cuts = 0;
00088 
00089   mass = charge2 = electronDensity = radLength = bg2 = beta2 
00090     = kineticEnergy = tmax = 0;
00091   gam = 1.0;
00092 
00093   dedxElectron = dedxPositron = dedxProton = rangeElectron 
00094     = rangePositron = rangeProton = invRangeElectron = invRangePositron 
00095     = invRangeProton = mscElectron = dedxMuon = rangeMuon = invRangeMuon = 0;
00096   cuts = 0;
00097   electron = positron = proton = muonPlus = muonMinus = 0;
00098 }

G4EnergyLossForExtrapolator::~G4EnergyLossForExtrapolator (  ) 

Definition at line 102 of file G4EnergyLossForExtrapolator.cc.

00103 {
00104   for(G4int i=0; i<nmat; i++) {delete couples[i];}
00105   delete dedxElectron;
00106   delete dedxPositron;
00107   delete dedxProton;
00108   delete dedxMuon;
00109   delete rangeElectron;
00110   delete rangePositron;
00111   delete rangeProton;
00112   delete rangeMuon;
00113   delete invRangeElectron;
00114   delete invRangePositron;
00115   delete invRangeProton;
00116   delete invRangeMuon;
00117   delete mscElectron;
00118   delete cuts;
00119 }


Member Function Documentation

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

Definition at line 215 of file G4EnergyLossForExtrapolator.hh.

References AverageScatteringAngle().

00219 {
00220   return AverageScatteringAngle(kinEnergy,step,mat,FindParticle(name));
00221 }

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

Definition at line 237 of file G4EnergyLossForExtrapolator.hh.

Referenced by AverageScatteringAngle(), and ComputeTrueStep().

00241 {
00242   G4double theta = 0.0;
00243   if(SetupKinematics(part, mat, kinEnergy)) {
00244     G4double t = stepLength/radLength;
00245     G4double y = std::max(0.001, t); 
00246     theta = 19.23*CLHEP::MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(y))/(beta2*gam*mass);
00247   }
00248   return theta;
00249 }

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

Definition at line 350 of file G4EnergyLossForExtrapolator.cc.

Referenced by EnergyAfterStep(), and EnergyBeforeStep().

00352 {
00353   G4double x = 0.0;
00354   if(part == electron)      x = ComputeValue(kinEnergy, dedxElectron);
00355   else if(part == positron) x = ComputeValue(kinEnergy, dedxPositron);
00356   else if(part == muonPlus || part == muonMinus) {
00357     x = ComputeValue(kinEnergy, dedxMuon);
00358   } else {
00359     G4double e = kinEnergy*proton_mass_c2/mass;
00360     x = ComputeValue(e, dedxProton)*charge2;
00361   }
00362   return x;
00363 }

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

Definition at line 385 of file G4EnergyLossForExtrapolator.cc.

Referenced by EnergyAfterStep(), and EnergyBeforeStep().

00387 {
00388   G4double x = 0.0;
00389   if(part == electron)      x = ComputeValue(range, invRangeElectron);
00390   else if(part == positron) x = ComputeValue(range, invRangePositron);
00391   else if(part == muonPlus || part == muonMinus) 
00392     x = ComputeValue(range, invRangeMuon);
00393   else {
00394     G4double massratio = proton_mass_c2/mass;
00395     G4double r = range*massratio*charge2;
00396     x = ComputeValue(r, invRangeProton)/massratio;
00397   }
00398   return x;
00399 }

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

Definition at line 367 of file G4EnergyLossForExtrapolator.cc.

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

00369 {
00370   G4double x = 0.0;
00371   if(part == electron)      x = ComputeValue(kinEnergy, rangeElectron);
00372   else if(part == positron) x = ComputeValue(kinEnergy, rangePositron);
00373   else if(part == muonPlus || part == muonMinus) 
00374     x = ComputeValue(kinEnergy, rangeMuon);
00375   else {
00376     G4double massratio = proton_mass_c2/mass;
00377     G4double e = kinEnergy*massratio;
00378     x = ComputeValue(e, rangeProton)/(charge2*massratio);
00379   }
00380   return x;
00381 }

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

Definition at line 254 of file G4EnergyLossForExtrapolator.hh.

References AverageScatteringAngle().

Referenced by EnergyDispersion(), and TrueStepLength().

00258 {
00259   G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part);
00260   return stepLength*std::sqrt(1.0 + 0.625*theta*theta);
00261 } 

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

Definition at line 195 of file G4EnergyLossForExtrapolator.hh.

References EnergyAfterStep().

00199 {
00200   return EnergyAfterStep(kinEnergy,step,mat,FindParticle(name));
00201 }

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

Definition at line 123 of file G4EnergyLossForExtrapolator.cc.

References ComputeDEDX(), ComputeEnergy(), ComputeRange(), and TrueStepLength().

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

00127 {
00128   if(!isInitialised) Initialisation();
00129   G4double kinEnergyFinal = kinEnergy;
00130   if(SetupKinematics(part, mat, kinEnergy)) {
00131     G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
00132     G4double r  = ComputeRange(kinEnergy,part);
00133     if(r <= step) {
00134       kinEnergyFinal = 0.0;
00135     } else if(step < linLossLimit*r) {
00136       kinEnergyFinal -= step*ComputeDEDX(kinEnergy,part);
00137     } else {  
00138       G4double r1 = r - step;
00139       kinEnergyFinal = ComputeEnergy(r1,part);
00140     }
00141   }
00142   return kinEnergyFinal;
00143 }

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

Definition at line 205 of file G4EnergyLossForExtrapolator.hh.

References EnergyBeforeStep().

00209 {
00210   return EnergyBeforeStep(kinEnergy,step,mat,FindParticle(name));
00211 }

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

Definition at line 147 of file G4EnergyLossForExtrapolator.cc.

References ComputeDEDX(), ComputeEnergy(), ComputeRange(), and TrueStepLength().

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

00151 {
00152   if(!isInitialised) Initialisation();
00153   G4double kinEnergyFinal = kinEnergy;
00154 
00155   if(SetupKinematics(part, mat, kinEnergy)) {
00156     G4double step = TrueStepLength(kinEnergy,stepLength,mat,part);
00157     G4double r  = ComputeRange(kinEnergy,part);
00158 
00159     if(step < linLossLimit*r) {
00160       kinEnergyFinal += step*ComputeDEDX(kinEnergy,part);
00161     } else {  
00162       G4double r1 = r + step;
00163       kinEnergyFinal = ComputeEnergy(r1,part);
00164     }
00165   }
00166   return kinEnergyFinal;
00167 }

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

Definition at line 226 of file G4EnergyLossForExtrapolator.hh.

References EnergyDispersion().

00230 {
00231   return EnergyDispersion(kinEnergy,step,mat,FindParticle(name));
00232 }

G4double G4EnergyLossForExtrapolator::EnergyDispersion ( G4double  kinEnergy,
G4double  step,
const G4Material ,
const G4ParticleDefinition  
) [inline]

Definition at line 266 of file G4EnergyLossForExtrapolator.hh.

References ComputeTrueStep().

Referenced by EnergyDispersion().

00270 {
00271   G4double sig2 = 0.0;
00272   if(SetupKinematics(part, mat, kinEnergy)) {
00273     G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength);
00274     sig2 = (1.0/beta2 - 0.5)*CLHEP::twopi_mc2_rcl2*tmax*step*electronDensity*charge2;
00275   }
00276   return sig2;
00277 }

void G4EnergyLossForExtrapolator::SetMaxEnergyTransfer ( G4double   )  [inline]

Definition at line 313 of file G4EnergyLossForExtrapolator.hh.

00314 {
00315   maxEnergyTransfer = val;
00316 }

void G4EnergyLossForExtrapolator::SetMaxKinEnergy ( G4double   )  [inline]

Definition at line 306 of file G4EnergyLossForExtrapolator.hh.

00307 {
00308   emax = val;
00309 }

void G4EnergyLossForExtrapolator::SetMinKinEnergy ( G4double   )  [inline]

Definition at line 299 of file G4EnergyLossForExtrapolator.hh.

00300 {
00301   emin = val;
00302 }

void G4EnergyLossForExtrapolator::SetVerbose ( G4int  val  )  [inline]

Definition at line 292 of file G4EnergyLossForExtrapolator.hh.

00293 {
00294   verbose = val;
00295 }

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

Definition at line 171 of file G4EnergyLossForExtrapolator.cc.

References ComputeRange(), and ComputeTrueStep().

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

00175 {
00176   G4double res = stepLength;
00177   if(!isInitialised) Initialisation();
00178   if(SetupKinematics(part, mat, kinEnergy)) {
00179     if(part == electron || part == positron) {
00180       G4double x = stepLength*ComputeValue(kinEnergy, mscElectron);
00181       if(x < 0.2) res *= (1.0 + 0.5*x + x*x/3.0);
00182       else if(x < 0.9999) res = -std::log(1.0 - x)*stepLength/x;
00183       else res = ComputeRange(kinEnergy,part);
00184     
00185     } else {
00186       res = ComputeTrueStep(mat,part,kinEnergy,stepLength);
00187     }
00188   }
00189   return res;
00190 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:53 2013 for Geant4 by  doxygen 1.4.7