Go to the documentation of this file.00001 #include "FastSimulation/MaterialEffects/interface/EnergyLossSimulator.h"
00002
00003 #include "FastSimulation/Utilities/interface/LandauFluctuationGenerator.h"
00004
00005 #include <cmath>
00006
00007 EnergyLossSimulator::EnergyLossSimulator(const RandomEngine* engine,
00008 double A, double Z, double density, double radLen) :
00009 MaterialEffectsSimulator(engine,A,Z,density,radLen)
00010 {
00011
00012 theGenerator = new LandauFluctuationGenerator(engine);
00013
00014 }
00015
00016 EnergyLossSimulator::~EnergyLossSimulator() {
00017
00018 delete theGenerator;
00019
00020 }
00021
00022 void
00023 EnergyLossSimulator::compute(ParticlePropagator &Particle)
00024 {
00025
00026
00027
00028
00029
00030
00031 double thick = radLengths * radLenIncm();
00032
00033
00034
00035
00036
00037 double p2 = Particle.Vect().Mag2();
00038 double verySmallP2 = 0.0001;
00039 if (p2<=verySmallP2) {
00040 deltaP.SetXYZT(0.,0.,0.,0.);
00041 return;
00042 }
00043 double m2 = Particle.mass() * Particle.mass();
00044 double e2 = p2+m2;
00045
00046 double beta2 = p2/e2;
00047 double gama2 = e2/m2;
00048
00049 double charge2 = Particle.charge() * Particle.charge();
00050
00051
00052 double eSpread = 0.1536E-3*charge2*(theZ()/theA())*rho()*thick/beta2;
00053
00054
00055 mostProbableLoss = eSpread * ( log ( 2.*eMass()*beta2*gama2*eSpread
00056 / (excitE()*excitE()) )
00057 - beta2 + 0.200 );
00058
00059
00060
00061
00062
00063 double dedx = mostProbableLoss + eSpread * theGenerator->landau();
00064
00065
00066 double aBitAboveMass = Particle.mass()*1.0001;
00067 double newE = std::max(aBitAboveMass,Particle.e()-dedx);
00068
00069 double fac = std::sqrt((newE*newE-m2)/p2);
00070
00071
00072
00073 deltaP.SetXYZT(Particle.Px()*(1.-fac),Particle.Py()*(1.-fac),
00074 Particle.Pz()*(1.-fac),Particle.E()-newE);
00075 Particle.SetXYZT(Particle.Px()*fac,Particle.Py()*fac,
00076 Particle.Pz()*fac,newE);
00077
00078 }
00079