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 m2 = Particle.mass() * Particle.mass();
00039 double e2 = p2+m2;
00040
00041 double beta2 = p2/e2;
00042 double gama2 = e2/m2;
00043
00044 double charge2 = Particle.charge() * Particle.charge();
00045
00046
00047 double eSpread = 0.1536E-3*charge2*(theZ()/theA())*rho()*thick/beta2;
00048
00049
00050 mostProbableLoss = eSpread * ( log ( 2.*eMass()*beta2*gama2*eSpread
00051 / (excitE()*excitE()) )
00052 - beta2 + 0.200 );
00053
00054
00055
00056
00057
00058 double dedx = mostProbableLoss + eSpread * theGenerator->landau();
00059
00060
00061 double newE = std::max(Particle.mass(),Particle.e()-dedx);
00062 double fac = std::sqrt((newE*newE-m2)/p2);
00063
00064
00065
00066 deltaP.SetXYZT(Particle.Px()*(1.-fac),Particle.Py()*(1.-fac),
00067 Particle.Pz()*(1.-fac),Particle.E()-newE);
00068 Particle.SetXYZT(Particle.Px()*fac,Particle.Py()*fac,
00069 Particle.Pz()*fac,newE);
00070
00071 }
00072