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);
41 const float BIG = 99999.;
47 theDeltaEta = (theHalfNBins != 0) ?
etaMax / theHalfNBins : BIG;
49 theLayersData = vector<MSLayersAtAngle>(
max(2 * theHalfNBins, 1));
51 for (
int idxbin = 0; idxbin < 2 * theHalfNBins; idxbin++) {
52 float etaValue =
eta(idxbin);
53 float cotTheta = sinh(etaValue);
55 vector<MSLayer>
layers =
layout.detLayers(etaValue, 0, iSetup);
56 vector<MSLayer> tmplay =
layout.otherLayers(etaValue, iSetup);
57 layers.insert(
layers.end(), tmplay.begin(), tmplay.end());
59 setX0(
layers, etaValue, msX0data);
63 vector<MSLayer>::iterator it;
65 float x0 = getDataX0(*it).x0;
66 float sumX0D = theLayersData[idxbin].sumX0D(zero, it->crossing(
line).first);
67 setDataX0(*it,
DataX0(x0, sumX0D, cotTheta));
68 theLayersData[idxbin].update(*it);
74 for (
int idxbin = 0; idxbin < 2 * theHalfNBins; idxbin++) {
75 float etaValue =
eta(idxbin);
76 for (
int isign = -1; isign <= 1; isign += 2) {
77 float z = isign * 15.9;
80 vector<MSLayer>::iterator it;
90 found = theLayersData[
bin].findLayer(*it);
95 if (
bin > 2 * theHalfNBins - 1)
97 found = theLayersData[
bin].findLayer(*it);
100 theLayersData[idxbin].update(*
found);
126 const float BIG = 99999.;
127 float cotTheta = sinh(
eta);
128 float sinTheta = 1 /
sqrt(1 +
sqr(cotTheta));
129 float cosTheta = cotTheta * sinTheta;
131 float sumX0atAngleLast = 0.;
132 vector<MSLayer>::iterator il;
135 float rL = (*il).crossing(
line).first.r();
136 float rN = (il + 1 !=
layers.end()) ? (il + 1)->crossing(
line).first.r() : BIG;
137 float rBound = (rL + rN) / 2.;
141 : (sumX0atAngle - sumX0atAngleLast) * fabs(cosTheta);
143 setDataX0(*il,
DataX0(dX0, 0, cotTheta));
144 sumX0atAngleLast = sumX0atAngle;