15 const int& BIG_PIX_PER_ROC_Y,
16 const int& ROWS_PER_ROC,
17 const int& COLS_PER_ROC) {
23 <<
m_yoffset <<
", BIG_PIX_PER_ROC_X " << BIG_PIX_PER_ROC_X
24 <<
", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y <<
", ROWS_PER_ROC " << ROWS_PER_ROC
25 <<
", COLS_PER_ROC " << COLS_PER_ROC <<
", ROCS_X " <<
m_ROCS_X <<
", ROCS_Y "
68 int iybin =
int(newybin);
69 float fractionY = newybin - iybin;
84 LogDebug(
"RectangularMTDTopology") <<
" very bad, newbiny " << iybin0 <<
"\n"
86 <<
" " << fractionY <<
" " << iybin0 <<
" " << numROC;
88 #endif // EDM_ML_DEBUG
91 iybin0 = (iybin % 54);
96 fractionY = (fractionY + 1.) / 2.;
97 }
else if (iybin0 == 52) {
99 fractionY = fractionY / 2.;
100 }
else if (iybin0 > 1) {
102 }
else if (iybin0 == 1) {
104 fractionY = (fractionY + 1.) / 2.;
105 }
else if (iybin0 == 0) {
107 fractionY = fractionY / 2.;
110 mpY =
float(numROC * 52. + iybin0) + fractionY;
115 if (mpY < 0. || mpY >= 416.) {
116 LogDebug(
"RectangularMTDTopology") <<
" bad pix y " << mpY <<
"\n"
118 <<
" " << fractionY <<
" " << iybin0 <<
" " << numROC;
120 #endif // EDM_ML_DEBUG
124 int ixbin =
int(newxbin);
125 float fractionX = newxbin - ixbin;
129 if (ixbin > 161 || ixbin < 0)
131 LogDebug(
"RectangularMTDTopology") <<
" very bad, newbinx " << ixbin <<
"\n"
135 #endif // EDM_ML_DEBUG
140 }
else if (ixbin == 82) {
142 fractionX = (fractionX + 1.) / 2.;
143 }
else if (ixbin == 81) {
145 fractionX = fractionX / 2.;
146 }
else if (ixbin == 80) {
148 fractionX = (fractionX + 1.) / 2.;
149 }
else if (ixbin == 79) {
151 fractionX = fractionX / 2.;
155 float mpX =
float(ixbin) + fractionX;
159 if (mpX < 0. || mpX >= 160.) {
160 LogDebug(
"RectangularMTDTopology") <<
" bad pix x " << mpX <<
"\n"
164 #endif // EDM_ML_DEBUG
166 return std::pair<float, float>(mpX, mpY);
182 debugstr <<
" wrong mp y, fix " << mpy <<
" " << 0 <<
"\n";
190 debugstr <<
" wrong mp x, fix " << mpx <<
" " << 0 <<
"\n";
199 #endif // EDM_ML_DEBUG
213 int binoffx =
int(mpx);
214 float fractionX = mpx -
float(binoffx);
223 <<
" very bad, binx " << binoffx <<
"\n"
224 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" " <<
m_xoffset <<
"\n";
230 binoffx = binoffx + 2;
231 }
else if (binoffx == 80) {
232 binoffx = binoffx + 1;
234 }
else if (binoffx == 79) {
235 binoffx = binoffx + 0;
244 LogDebug(
"RectangularMTDTopology") <<
" very bad, binx " << binoffx <<
"\n"
245 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" "
255 if (lpX < m_xoffset || lpX > (-
m_xoffset)) {
256 LogDebug(
"RectangularMTDTopology") <<
" bad lp x " << lpX <<
"\n"
257 << mpx <<
" " << binoffx <<
" " << fractionX <<
" " << local_pitchx <<
" "
260 #endif // EDM_ML_DEBUG
268 int binoffy =
int(mpy);
269 float fractionY = mpy -
float(binoffy);
278 <<
" very bad, biny " << binoffy <<
"\n"
279 << mpy <<
" " << binoffy <<
" " << fractionY <<
" " << local_pitchy <<
" " <<
m_yoffset;
284 constexpr
int bigYIndeces[]{0, 51, 52, 103, 104, 155, 156, 207, 208, 259, 260, 311, 312, 363, 364, 415, 416, 511};
288 binoffy += (
j - bigYIndeces);
296 if (lpY < m_yoffset || lpY > (-
m_yoffset)) {
297 LogDebug(
"RectangularMTDTopology") <<
" bad lp y " << lpY <<
"\n"
298 << mpy <<
" " << binoffy <<
" " << fractionY <<
" " << local_pitchy <<
" "
301 #endif // EDM_ML_DEBUG
310 int binoffy =
int(mp.
y());
315 int binoffx =
int(mp.
x());
331 int iybin0 = iybin % 54;
333 if ((iybin0 <= 1) | (iybin0 >= 52))
338 if ((ixbin >= 79) & (ixbin <= 82))