63 constexpr Float emass = 0.511e-3;
64 constexpr Float poti = 16.e-9 * 10.75;
65 const Float eplasma = 28.816e-9 *
sqrt(2.33 * 0.498);
66 const Float delta0 = 2 *
log(eplasma / poti) - 1.;
69 Float im2 = Float(1.) /
m2;
72 Float beta2 = p2 / e2;
73 Float
eta2 = p2 * im2;
74 Float ratio2 = (emass * emass) * im2;
75 Float emax = Float(2.) * emass * eta2 / (Float(1.) + Float(2.) * emass * e * im2 + ratio2);
77 Float xi = materialConstants.
xi() * xf;
80 Float
dEdx = xi * (unsafe_logf<2>(Float(2.) * emass * emax / (poti * poti)) - Float(2.) * (beta2)-delta0);
82 Float dEdx2 = xi * emax * (Float(1.) - Float(0.5) * beta2);
84 Float sigp2 = dEdx2 / (beta2 * p2 *
p2);
86 using namespace materialEffect;
105 float normalisedPath =
std::abs(p / localP.
z()) * materialConstants.
radLen();
111 float z = unsafe_expf<3>(-normalisedPath);
112 float varz = unsafe_expf<3>(-normalisedPath * l3ol2) - z * z;
121 effect.
deltaP += -p * (1.f / z - 1.f);
122 using namespace materialEffect;
129 effect.
deltaP += p * (z - 1.f);
132 float f2 = 1.f / (p2 * z *
z);
133 using namespace materialEffect;
144 double theDeltaP = 0., theDeltaCov = 0;
150 double p = localP.
mag();
151 double xf = fabs(p / localP.
z());
153 const double m =
mass;
155 const double emass = 0.511e-3;
156 const double poti = 16.e-9 * 10.75;
157 const double eplasma = 28.816e-9 *
sqrt(2.33 * 0.498);
158 const double delta0 = 2 *
log(eplasma / poti) - 1.;
161 double e =
sqrt(p * p + m * m);
163 double gamma = e /
m;
164 double eta2 = beta * gamma;
167 double ratio = emass /
m;
168 double emax = 2. * emass * eta2 / (1. + 2. * ratio * gamma + ratio * ratio);
173 double xi = materialConstants.
xi() * xf;
179 double dEdx = xi * (
log(2. * emass * emax / (poti * poti)) - 2. * (beta *
beta) - delta0);
180 double dEdx2 = xi * emax * (1. - 0.5 * (beta *
beta));
181 double dP = dEdx /
beta;
182 double sigp2 = dEdx2 * e * e / (p * p * p * p * p *
p);
184 theDeltaCov += sigp2;
186 std::cout <<
"pion old " << theDeltaP <<
" " << theDeltaCov << std::endl;
192 double theDeltaP = 0., theDeltaCov = 0;
198 double p = localP.
mag();
199 double normalisedPath = fabs(p / localP.
z()) * materialConstants.
radLen();
204 double z =
exp(-normalisedPath);
205 double varz =
exp(-normalisedPath *
log(3.) /
log(2.)) - z *
z;
214 theDeltaP += -p * (1 / z - 1);
215 theDeltaCov += varz / (p *
p);
221 theDeltaP += p * (z - 1);
224 double f = 1. / (p *
z);
225 theDeltaCov += f * f * varz;
228 std::cout <<
"electron old " << theDeltaP <<
" " << theDeltaCov << std::endl;
void computeBetheBloch(const LocalVector &, const MediumProperties &, Effect &effect) const
static std::vector< std::string > checklist log
void oldComputeBetheBloch(const LocalVector &localP, const MediumProperties &materialConstants, double mass)
void compute(const TrajectoryStateOnSurface &, const PropagationDirection, Effect &effect) const override
Exp< T >::type exp(const T &t)
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