49 #endif // EDM_ML_DEBUG 52 int iybin =
int(newybin);
53 float fractionY = newybin - iybin;
60 iybin0 = (iybin % 54);
65 fractionY = (fractionY + 1.) / 2.;
66 }
else if (iybin0 == 52) {
68 fractionY = fractionY / 2.;
69 }
else if (iybin0 > 1) {
71 }
else if (iybin0 == 1) {
73 fractionY = (fractionY + 1.) / 2.;
74 }
else if (iybin0 == 0) {
76 fractionY = fractionY / 2.;
79 mpY =
float(numROC * 52. + iybin0) + fractionY;
83 if (mpY < 0. || mpY >= 416.) {
84 LogDebug(
"RectangularPixelTopology") <<
" bad pix y " << mpY <<
"\n" 86 <<
" " << fractionY <<
" " << iybin0 <<
" " << numROC;
88 #endif // EDM_ML_DEBUG 92 int ixbin =
int(newxbin);
93 float fractionX = newxbin - ixbin;
97 if (ixbin > 161 || ixbin < 0)
99 LogDebug(
"RectangularPixelTopology") <<
" very bad, newbinx " << ixbin <<
"\n" 103 #endif // EDM_ML_DEBUG 107 }
else if (ixbin == 82) {
109 fractionX = (fractionX + 1.) / 2.;
110 }
else if (ixbin == 81) {
112 fractionX = fractionX / 2.;
113 }
else if (ixbin == 80) {
115 fractionX = (fractionX + 1.) / 2.;
116 }
else if (ixbin == 79) {
118 fractionX = fractionX / 2.;
121 float mpX =
float(ixbin) + fractionX;
125 if (mpX < 0. || mpX >= 160.) {
126 LogDebug(
"RectangularPixelTopology") <<
" bad pix x " << mpX <<
"\n" 130 #endif // EDM_ML_DEBUG 132 return std::pair<float, float>(mpX, mpY);
148 debugstr <<
" wrong mp y, fix " << mpy <<
" " << 0 <<
"\n";
156 debugstr <<
" wrong mp x, fix " << mpx <<
" " << 0 <<
"\n";
165 #endif // EDM_ML_DEBUG 179 int binoffx =
int(mpx);
180 float fractionX = mpx -
float(binoffx);
184 binoffx = binoffx + 2;
185 }
else if (binoffx == 80) {
186 binoffx = binoffx + 1;
188 }
else if (binoffx == 79) {
189 binoffx = binoffx + 0;
198 LogDebug(
"RectangularPixelTopology") <<
" very bad, binx " << binoffx <<
"\n" 199 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " 208 if (lpX < m_xoffset || lpX > (-
m_xoffset)) {
209 LogDebug(
"RectangularPixelTopology") <<
" bad lp x " << lpX <<
"\n" 210 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " 213 #endif // EDM_ML_DEBUG 221 int binoffy =
int(mpy);
222 float fractionY = mpy -
float(binoffy);
225 constexpr int bigYIndeces[]{0, 51, 52, 103, 104, 155, 156, 207, 208, 259, 260, 311, 312, 363, 364, 415, 416, 511};
226 auto const j =
std::lower_bound(std::begin(bigYIndeces), std::end(bigYIndeces), binoffy);
229 binoffy += (
j - bigYIndeces);
236 if (lpY < m_yoffset || lpY > (-
m_yoffset)) {
237 LogDebug(
"RectangularPixelTopology") <<
" bad lp y " << lpY <<
"\n" 238 << mpy <<
" " << binoffy <<
" " << fractionY <<
" " << local_pitchy <<
" " 241 #endif // EDM_ML_DEBUG 250 int binoffy =
int(mp.
y());
255 int binoffx =
int(mp.
x());
269 int iybin0 = iybin % 54;
271 if ((iybin0 <= 1) | (iybin0 >= 52))
276 if ((ixbin >= 79) & (ixbin <= 82))
LocalPoint localPosition(const MeasurementPoint &mp) const override
Point3DBase< Scalar, LocalTag > LocalPoint
std::pair< float, float > pixel(const LocalPoint &p) const override
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
bool isItBigPixelInX(const int ixbin) const override
float localY(const float mpY) const override
bool isItBigPixelInY(const int iybin) const override
float localX(const float mpX) const override
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override