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)];
29 float ieta = eta / theDeltaEta;
30 if (
std::abs(ieta) >= theHalfNBins - 1.
e-3)
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());
55 sort(layers.begin(), layers.end());
56 setX0(layers, etaValue, msX0data);
60 vector<MSLayer>::iterator it;
61 for (it = layers.begin(); it != layers.end(); 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;
76 vector<MSLayer>
candidates = layout.detLayers(etaValue, z, bfield);
77 vector<MSLayer>::iterator it;
78 for (it = candidates.begin(); it != candidates.end(); 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;
130 for (il = layers.begin(); il != layers.end(); 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.;
135 float sumX0atAngle = sumX0.
sumX0atEta(eta, rBound);
138 : (sumX0atAngle - sumX0atAngleLast) * fabs(cosTheta);
140 setDataX0(*il,
DataX0(dX0, 0, cotTheta));
141 sumX0atAngleLast = sumX0atAngle;
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
MSLayersKeeperX0AtEta(const GeometricSearchTracker &tracker, const MagneticField &bfield)
~MSLayersKeeperX0AtEta() override
const MSLayersAtAngle & layers(float cotTheta) const override
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 &)
int idxBin(float eta) const
const MSLayer * findLayer(const MSLayer &layer) const