#include <EnergyLossSimulator.h>
Public Member Functions | |
const XYZTLorentzVector & | deltaMom () const |
Returns the actual energy lost. | |
EnergyLossSimulator (const RandomEngine *engine, double A, double Z, double density, double radLen) | |
Constructor. | |
double | mostLikelyLoss () const |
Return most probable energy loss. | |
~EnergyLossSimulator () | |
Default Destructor. | |
Private Member Functions | |
void | compute (ParticlePropagator &Particle) |
The real dE/dx generation and particle update. | |
Private Attributes | |
XYZTLorentzVector | deltaP |
The actual energy loss. | |
double | mostProbableLoss |
The most probable enery loss. | |
LandauFluctuationGenerator * | theGenerator |
The Landau Fluctuation generator. |
Definition at line 26 of file EnergyLossSimulator.h.
EnergyLossSimulator::EnergyLossSimulator | ( | const RandomEngine * | engine, |
double | A, | ||
double | Z, | ||
double | density, | ||
double | radLen | ||
) |
Constructor.
Definition at line 7 of file EnergyLossSimulator.cc.
References theGenerator.
: MaterialEffectsSimulator(engine,A,Z,density,radLen) { theGenerator = new LandauFluctuationGenerator(engine); }
EnergyLossSimulator::~EnergyLossSimulator | ( | ) |
Default Destructor.
Definition at line 16 of file EnergyLossSimulator.cc.
References theGenerator.
{ delete theGenerator; }
void EnergyLossSimulator::compute | ( | ParticlePropagator & | Particle | ) | [private, virtual] |
The real dE/dx generation and particle update.
Implements MaterialEffectsSimulator.
Definition at line 23 of file EnergyLossSimulator.cc.
References RawParticle::charge(), deltaP, MaterialEffectsSimulator::eMass(), MaterialEffectsSimulator::excitE(), LandauFluctuationGenerator::landau(), funct::log(), RawParticle::mass(), max(), mostProbableLoss, p2, MaterialEffectsSimulator::radLengths, MaterialEffectsSimulator::radLenIncm(), MaterialEffectsSimulator::rho(), mathSSE::sqrt(), MaterialEffectsSimulator::theA(), theGenerator, and MaterialEffectsSimulator::theZ().
{ // FamosHistos* myHistos = FamosHistos::instance(); // double gamma_e = 0.577215664901532861; // Euler constant // The thickness in cm double thick = radLengths * radLenIncm(); // This is a simple version (a la PDG) of a dE/dx generator. // It replaces the buggy GEANT3 -> C++ former version. // Author : Patrick Janot - 8-Jan-2004 double p2 = Particle.Vect().Mag2(); double verySmallP2 = 0.0001; if (p2<=verySmallP2) { deltaP.SetXYZT(0.,0.,0.,0.); return; } double m2 = Particle.mass() * Particle.mass(); double e2 = p2+m2; double beta2 = p2/e2; double gama2 = e2/m2; double charge2 = Particle.charge() * Particle.charge(); // Energy loss spread in GeV double eSpread = 0.1536E-3*charge2*(theZ()/theA())*rho()*thick/beta2; // Most probable energy loss (from the integrated Bethe-Bloch equation) mostProbableLoss = eSpread * ( log ( 2.*eMass()*beta2*gama2*eSpread / (excitE()*excitE()) ) - beta2 + 0.200 ); // This one can be needed on output (but is not used internally) // meanEnergyLoss = 2.*eSpread * ( log ( 2.*eMass()*beta2*gama2 /excitE() ) - beta2 ); // Generate the energy loss with Landau fluctuations double dedx = mostProbableLoss + eSpread * theGenerator->landau(); // Compute the new energy and momentum double aBitAboveMass = Particle.mass()*1.0001; double newE = std::max(aBitAboveMass,Particle.e()-dedx); // double newE = std::max(Particle.mass(),Particle.e()-dedx); double fac = std::sqrt((newE*newE-m2)/p2); // Update the momentum deltaP.SetXYZT(Particle.Px()*(1.-fac),Particle.Py()*(1.-fac), Particle.Pz()*(1.-fac),Particle.E()-newE); Particle.SetXYZT(Particle.Px()*fac,Particle.Py()*fac, Particle.Pz()*fac,newE); }
const XYZTLorentzVector& EnergyLossSimulator::deltaMom | ( | ) | const [inline] |
Returns the actual energy lost.
Definition at line 41 of file EnergyLossSimulator.h.
References deltaP.
Referenced by MuonSimHitProducer::applyMaterialEffects(), and CalorimetryManager::MuonMipSimulation().
{ return deltaP; }
double EnergyLossSimulator::mostLikelyLoss | ( | ) | const [inline] |
Return most probable energy loss.
Definition at line 38 of file EnergyLossSimulator.h.
References mostProbableLoss.
Referenced by MuonSimHitProducer::applyMaterialEffects().
{ return mostProbableLoss; }
XYZTLorentzVector EnergyLossSimulator::deltaP [private] |
The actual energy loss.
Definition at line 54 of file EnergyLossSimulator.h.
Referenced by compute(), and deltaMom().
double EnergyLossSimulator::mostProbableLoss [private] |
The most probable enery loss.
Definition at line 51 of file EnergyLossSimulator.h.
Referenced by compute(), and mostLikelyLoss().
The Landau Fluctuation generator.
Definition at line 45 of file EnergyLossSimulator.h.
Referenced by compute(), EnergyLossSimulator(), and ~EnergyLossSimulator().