15 inline float unsafe_asinhf(
float x) {
return unsafe_logf<3>(
x +
std::sqrt(1.
f + x * x)); }
20 float eta = unsafe_asinhf(cotTheta);
21 return theLayersData[idxBin(
eta)];
31 return (
eta > 0) ?
max(2 * theHalfNBins - 1, 0) : 0;
33 return int(
ieta + theHalfNBins);
38 const float BIG = 99999.;
44 theDeltaEta = (theHalfNBins != 0) ?
etaMax / theHalfNBins : BIG;
46 theLayersData = vector<MSLayersAtAngle>(
max(2 * theHalfNBins, 1));
48 for (
int idxbin = 0; idxbin < 2 * theHalfNBins; idxbin++) {
49 float etaValue =
eta(idxbin);
50 float cotTheta = sinh(etaValue);
52 vector<MSLayer>
layers =
layout.detLayers(etaValue, 0, bfield);
53 vector<MSLayer> tmplay =
layout.otherLayers(etaValue);
54 layers.insert(
layers.end(), tmplay.begin(), tmplay.end());
56 setX0(
layers, etaValue, msX0data);
60 vector<MSLayer>::iterator it;
62 float x0 = getDataX0(*it).x0;
63 float sumX0D = theLayersData[idxbin].sumX0D(
zero, it->crossing(
line).first);
64 setDataX0(*it,
DataX0(x0, sumX0D, cotTheta));
65 theLayersData[idxbin].update(*it);
71 for (
int idxbin = 0; idxbin < 2 * theHalfNBins; idxbin++) {
72 float etaValue =
eta(idxbin);
73 for (
int isign = -1; isign <= 1; isign += 2) {
74 float z = isign * 15.9;
77 vector<MSLayer>::iterator it;
87 found = theLayersData[
bin].findLayer(*it);
92 if (
bin > 2 * theHalfNBins - 1)
94 found = theLayersData[
bin].findLayer(*it);
97 theLayersData[idxbin].update(*
found);
123 const float BIG = 99999.;
124 float cotTheta = sinh(
eta);
125 float sinTheta = 1 /
sqrt(1 +
sqr(cotTheta));
126 float cosTheta = cotTheta * sinTheta;
128 float sumX0atAngleLast = 0.;
129 vector<MSLayer>::iterator il;
132 float rL = (*il).crossing(
line).first.r();
133 float rN = (il + 1 !=
layers.end()) ? (il + 1)->crossing(
line).first.r() : BIG;
134 float rBound = (rL + rN) / 2.;
138 : (sumX0atAngle - sumX0atAngleLast) * fabs(cosTheta);
140 setDataX0(*il,
DataX0(dX0, 0, cotTheta));
141 sumX0atAngleLast = sumX0atAngle;
int idxBin(float eta) const
MSLayersKeeperX0AtEta(const GeometricSearchTracker &tracker, const MagneticField &bfield)
~MSLayersKeeperX0AtEta() override
const MSLayersAtAngle & layers(float cotTheta) const override
const MSLayer * findLayer(const MSLayer &layer) const
virtual float sumX0atEta(float eta, float r) const =0
float eta(int idxBin) const
Abs< T >::type abs(const T &t)
static void setX0(std::vector< MSLayer > &, float eta, const SumX0AtEtaDataProvider &)
Square< F >::type sqr(const F &f)