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"
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"
148 #endif // EDM_ML_DEBUG
150 return std::pair<float, float>(mpX, mpY);
166 debugstr <<
" wrong mp y, fix " << mpy <<
" " << 0 <<
"\n";
174 debugstr <<
" wrong mp x, fix " << mpx <<
" " << 0 <<
"\n";
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))