71 : maxEnergyTransfer(
DBL_MAX), verbose(verb)
74 emax = 100.*CLHEP::TeV;
96 if(SetupKinematics(part, mat, kinEnergy)) {
100 kinEnergyFinal = 0.0;
101 }
else if(step < linLossLimit*r) {
102 kinEnergyFinal -= step*
ComputeDEDX(kinEnergy,part,mat);
108 return kinEnergyFinal;
120 G4double kinEnergyFinal = kinEnergy;
122 if(SetupKinematics(part, mat, kinEnergy)) {
126 if(step < linLossLimit*r) {
127 kinEnergyFinal += step*
ComputeDEDX(kinEnergy,part,mat);
133 return kinEnergyFinal;
147 if(SetupKinematics(part, mat, kinEnergy)) {
148 if(part == electron || part == positron) {
152 if(x < 0.2) { res *= (1.0 + 0.5*x + x*x/3.0); }
153 else if(x < 0.9999) { res = -
G4Log(1.0 - x)*stepLength/x; }
170 if(
nullptr == part ||
nullptr == mat || kinEnergy < CLHEP::keV)
172 if(part != currentParticle) {
173 currentParticle = part;
177 if(mat != currentMaterial) {
180 G4cout <<
"### G4EnergyLossForExtrapolator WARNING: material index i= "
181 << i <<
" above number of materials " << nmat <<
G4endl;
184 currentMaterial = mat;
189 if(kinEnergy != kineticEnergy) {
190 kineticEnergy = kinEnergy;
195 bg2 = tau * (tau + 2.0);
196 beta2 = bg2/(gam*gam);
198 if(part == electron) tmax *= 0.5;
199 else if(part != positron) {
200 G4double r = CLHEP::electron_mass_c2/mass;
201 tmax = 2.0*bg2*CLHEP::electron_mass_c2/(1.0 + 2.0*gam*r + r*r);
203 tmax = std::min(tmax, maxEnergyTransfer);
211G4EnergyLossForExtrapolator::FindParticle(
const G4String& name)
214 if(
nullptr == currentParticle) {
215 G4cout <<
"### G4EnergyLossForExtrapolator WARNING: "
216 <<
"FindParticle() fails to find " <<
name <<
G4endl;
218 return currentParticle;
230 if(part == electron) {
232 }
else if(part == positron) {
234 }
else if(part == muonPlus || part == muonMinus) {
253 if(part == electron) {
255 }
else if(part == positron) {
257 }
else if(part == muonPlus || part == muonMinus) {
278 if(part == electron) {
280 }
else if(part == positron) {
282 }
else if(part == muonPlus || part == muonMinus) {
302 if(SetupKinematics(part, mat, kinEnergy)) {
304 sig2 = (1.0/beta2 - 0.5)
305 *CLHEP::twopi_mc2_rcl2*tmax*step*electronDensity*charge2;
319 if(SetupKinematics(part, mat, kinEnergy)) {
322 theta = 19.23*CLHEP::MeV*std::sqrt(charge2*t)*(1.0 + 0.038*
G4Log(y))
333 G4cout <<
"### G4EnergyLossForExtrapolator::Initialisation tables= "
343 if(
nullptr == tables) {
344#ifdef G4MULTITHREADED
346 if(
nullptr == tables) {
353 G4cout <<
"### G4EnergyLossForExtrapolator::BuildTables for "
354 << nmat <<
" materials Nbins= "
355 << nbins <<
" Emin(MeV)= " << emin <<
" Emax(MeV)= " << emax
358#ifdef G4MULTITHREADED
366#ifdef G4MULTITHREADED
370#ifdef G4MULTITHREADED
G4double G4Log(G4double x)
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
static G4Electron * Electron()
static size_t GetNumberOfMaterials()
G4double GetElectronDensity() const
G4double GetRadlen() const
static G4MuonMinus * MuonMinus()
static G4MuonPlus * MuonPlus()
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4Positron * Positron()
static G4Proton * Proton()
const char * name(G4int ptype)