70 const Float eplasma = 28.816e-9 *
sqrt(2.33*0.498);
71 const Float delta0 = 2*
log(eplasma/poti) - 1.;
74 Float im2 = Float(1.)/m2;
79 Float ratio2 = (emass*emass)*im2;
80 Float emax = Float(2.)*emass*eta2/(Float(1.) + Float(2.)*emass*e*im2 + ratio2);
82 Float xi = materialConstants.
xi()*xf; xi /= beta2;
84 Float dEdx = xi*(unsafe_logf<2>(Float(2.)*emass*emax/(poti*poti)) - Float(2.)*(beta2) - delta0);
86 Float dEdx2 = xi*emax*(Float(1.)-Float(0.5)*beta2);
88 Float sigp2 = dEdx2/(beta2*p2*
p2);
90 using namespace materialEffect;
111 float normalisedPath =
std::abs(p/localP.
z())*materialConstants.
radLen();
117 float z = unsafe_expf<3>(-normalisedPath);
118 float varz = unsafe_expf<3>(-normalisedPath*l3ol2)-
128 effect.
deltaP += -p*(1.f/z-1.f);
129 using namespace materialEffect;
137 effect.
deltaP += p*(z-1.f);
140 float f2 = 1.f/(p2*z*
z);
141 using namespace materialEffect;
164 double theDeltaP=0., theDeltaCov=0;
170 double p = localP.
mag();
171 double xf = fabs(p/localP.
z());
173 const double m =
mass;
175 const double emass = 0.511e-3;
176 const double poti = 16.e-9 * 10.75;
177 const double eplasma = 28.816e-9 *
sqrt(2.33*0.498);
178 const double delta0 = 2*
log(eplasma/poti) - 1.;
181 double e =
sqrt(p*p + m*m);
184 double eta2 = beta*gamma; eta2 *= eta2;
186 double ratio = emass/
m;
187 double emax = 2.*emass*eta2/(1. + 2.*ratio*gamma + ratio*ratio);
192 double xi = materialConstants.
xi()*xf; xi /= (beta*
beta);
197 double dEdx = xi*(
log(2.*emass*emax/(poti*poti)) - 2.*(beta*
beta) - delta0);
198 double dEdx2 = xi*emax*(1.-0.5*(beta*
beta));
199 double dP = dEdx/
beta;
200 double sigp2 = dEdx2*e*e/(p*p*p*p*p*
p);
202 theDeltaCov += sigp2;
204 std::cout <<
"pion old " << theDeltaP <<
" " << theDeltaCov << std::endl;
214 double theDeltaP=0., theDeltaCov=0;
220 double p = localP.
mag();
221 double normalisedPath = fabs(p/localP.
z())*materialConstants.
radLen();
226 double z =
exp(-normalisedPath);
227 double varz =
exp(-normalisedPath*
log(3.)/
log(2.))-
237 theDeltaP += -p*(1/z-1);
238 theDeltaCov += varz/(p*
p);
245 theDeltaP += p*(z-1);
249 theDeltaCov += f*f*varz;
252 std::cout <<
"electron old " << theDeltaP <<
" " << theDeltaCov << std::endl;
void computeBetheBloch(const LocalVector &, const MediumProperties &, Effect &effect) const
void oldComputeBetheBloch(const LocalVector &localP, const MediumProperties &materialConstants, double mass)
LocalVector localMomentum() const
const SurfaceType & surface() const
void computeElectrons(const LocalVector &, const MediumProperties &, const PropagationDirection, Effect &effect) const
Abs< T >::type abs(const T &t)
void oldComputeElectrons(const LocalVector &localP, const MediumProperties &materialConstants, const PropagationDirection propDir)
const MediumProperties & mediumProperties() const
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const