26 debugstr <<
"py = " << py <<
", m_yoffset = " <<
m_yoffset <<
"px = " << px <<
", m_xoffset = " <<
m_xoffset <<
"\n";
30 debugstr <<
" wrong lp y " << py <<
" " <<
m_yoffset <<
"\n";
31 py = m_yoffset +
EPSCM;
34 debugstr <<
" wrong lp y " << py <<
" " << -
m_yoffset <<
"\n";
35 py = -m_yoffset -
EPSCM;
39 debugstr <<
" wrong lp x " << px <<
" " << m_xoffset <<
"\n";
40 px = m_xoffset +
EPSCM;
42 if (px > -m_xoffset) {
43 debugstr <<
" wrong lp x " << px <<
" " << -m_xoffset <<
"\n";
44 px = -m_xoffset -
EPSCM;
47 if (!debugstr.str().empty())
48 LogDebug(
"RectangularPixelTopology") << debugstr.str();
49 #endif // EDM_ML_DEBUG 52 int iybin =
int(newybin);
53 float fractionY = newybin - iybin;
68 LogDebug(
"RectangularPixelTopology") <<
" very bad, newbiny " << iybin0 <<
"\n" 70 << iybin <<
" " << fractionY <<
" " << iybin0 <<
" " << numROC;
72 #endif // EDM_ML_DEBUG 75 iybin0 = (iybin % 54);
80 fractionY = (fractionY + 1.) / 2.;
81 }
else if (iybin0 == 52) {
83 fractionY = fractionY / 2.;
84 }
else if (iybin0 > 1) {
86 }
else if (iybin0 == 1) {
88 fractionY = (fractionY + 1.) / 2.;
89 }
else if (iybin0 == 0) {
91 fractionY = fractionY / 2.;
94 mpY =
float(numROC * 52. + iybin0) + fractionY;
99 if (mpY < 0. || mpY >= 416.) {
100 LogDebug(
"RectangularPixelTopology") <<
" bad pix y " << mpY <<
"\n" 102 <<
" " << fractionY <<
" " << iybin0 <<
" " << numROC;
104 #endif // EDM_ML_DEBUG 108 int ixbin =
int(newxbin);
109 float fractionX = newxbin - ixbin;
113 if (ixbin > 161 || ixbin < 0)
115 LogDebug(
"RectangularPixelTopology") <<
" very bad, newbinx " << ixbin <<
"\n" 116 << px <<
" " << m_xoffset <<
" " <<
m_pitchx <<
" " << newxbin <<
" " << ixbin
119 #endif // EDM_ML_DEBUG 124 }
else if (ixbin == 82) {
126 fractionX = (fractionX + 1.) / 2.;
127 }
else if (ixbin == 81) {
129 fractionX = fractionX / 2.;
130 }
else if (ixbin == 80) {
132 fractionX = (fractionX + 1.) / 2.;
133 }
else if (ixbin == 79) {
135 fractionX = fractionX / 2.;
139 float mpX =
float(ixbin) + fractionX;
143 if (mpX < 0. || mpX >= 160.) {
144 LogDebug(
"RectangularPixelTopology") <<
" bad pix x " << mpX <<
"\n" 145 << px <<
" " << m_xoffset <<
" " <<
m_pitchx <<
" " << newxbin <<
" " << ixbin
148 #endif // EDM_ML_DEBUG 150 return std::pair<float, float>(mpX, mpY);
166 debugstr <<
" wrong mp y, fix " << mpy <<
" " << 0 <<
"\n";
170 debugstr <<
" wrong mp y, fix " << mpy <<
" " <<
m_ncols <<
"\n";
174 debugstr <<
" wrong mp x, fix " << mpx <<
" " << 0 <<
"\n";
178 debugstr <<
" wrong mp x, fix " << mpx <<
" " <<
m_nrows <<
"\n";
181 if (!debugstr.str().empty())
182 LogDebug(
"RectangularPixelTopology") << debugstr.str();
183 #endif // EDM_ML_DEBUG 197 int binoffx =
int(mpx);
198 float fractionX = mpx -
float(binoffx);
206 LogDebug(
"RectangularPixelTopology")
207 <<
" very bad, binx " << binoffx <<
"\n" 208 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " <<
m_xoffset <<
"\n";
214 binoffx = binoffx + 2;
215 }
else if (binoffx == 80) {
216 binoffx = binoffx + 1;
218 }
else if (binoffx == 79) {
219 binoffx = binoffx + 0;
228 LogDebug(
"RectangularPixelTopology")
229 <<
" very bad, binx " << binoffx <<
"\n" 230 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " <<
m_xoffset;
239 if (lpX < m_xoffset || lpX > (-m_xoffset)) {
240 LogDebug(
"RectangularPixelTopology") <<
" bad lp x " << lpX <<
"\n" 241 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " 244 #endif // EDM_ML_DEBUG 252 int binoffy =
int(mpy);
253 float fractionY = mpy -
float(binoffy);
261 LogDebug(
"RectangularPixelTopology")
262 <<
" very bad, biny " << binoffy <<
"\n" 263 << mpy <<
" " << binoffy <<
" " << fractionY <<
" " << local_pitchy <<
" " <<
m_yoffset;
268 constexpr int bigYIndeces[]{0, 51, 52, 103, 104, 155, 156, 207, 208, 259, 260, 311, 312, 363, 364, 415, 416, 511};
272 binoffy += (
j - bigYIndeces);
280 if (lpY < m_yoffset || lpY > (-m_yoffset)) {
281 LogDebug(
"RectangularPixelTopology") <<
" bad lp y " << lpY <<
"\n" 282 << mpy <<
" " << binoffy <<
" " << fractionY <<
" " << local_pitchy <<
" " 285 #endif // EDM_ML_DEBUG 294 int binoffy =
int(mp.
y());
299 int binoffx =
int(mp.
x());
315 int iybin0 = iybin % 54;
317 if ((iybin0 <= 1) | (iybin0 >= 52))
322 if ((ixbin >= 79) & (ixbin <= 82))
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
Point3DBase< Scalar, LocalTag > LocalPoint
float localY(const float mpY) const override
std::pair< float, float > pixel(const LocalPoint &p) const override
bool isItBigPixelInY(const int iybin) const override
float localX(const float mpX) const override
bool isItBigPixelInX(const int ixbin) const override
MeasurementError measurementError(const LocalPoint &, const LocalError &) const override
LocalPoint localPosition(const MeasurementPoint &mp) const override