CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RectangularMTDTopology Class Referencefinal

#include <RectangularMTDTopology.h>

Inheritance diagram for RectangularMTDTopology:
PixelTopology Topology

Public Member Functions

int channel (const LocalPoint &lp) const override
 
int colsperroc () const override
 
bool containsBigPixelInX (int ixmin, int ixmax) const override
 
bool containsBigPixelInY (int iymin, int iymax) const override
 
bool isItBigPixelInX (const int ixbin) const override
 
bool isItBigPixelInY (const int iybin) const override
 
bool isItEdgePixel (int ixbin, int iybin) const override
 
bool isItEdgePixelInX (int ixbin) const override
 
bool isItEdgePixelInY (int iybin) const override
 
LocalError localError (const MeasurementPoint &, const MeasurementError &) const override
 
LocalPoint localPosition (const MeasurementPoint &mp) const override
 
float localX (const float mpX) const override
 
float localY (const float mpY) const override
 
MeasurementError measurementError (const LocalPoint &, const LocalError &) const override
 
MeasurementPoint measurementPosition (const LocalPoint &lp) const override
 
LocalPoint moduleToPixelLocalPoint (const LocalPoint &mlp) const
 
int ncolumns () const override
 
int nrows () const override
 
std::pair< float, float > pitch () const override
 
std::pair< float, float > pixel (const LocalPoint &p) const override
 
LocalPoint pixelToModuleLocalPoint (const LocalPoint &plp, int channel) const
 
LocalPoint pixelToModuleLocalPoint (const LocalPoint &plp, int row, int col) const
 
 RectangularMTDTopology (int nrows, int ncols, float pitchx, float pitchy, bool upgradeGeometry, int ROWS_PER_ROC, int COLS_PER_ROC, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y, int ROCS_X, int ROCS_Y)
 
int rocsX () const override
 
int rocsY () const override
 
int rowsperroc () const override
 
void setOffset (const int &BIG_PIX_PER_ROC_X, const int &BIG_PIX_PER_ROC_Y, const int &ROWS_PER_ROC, const int &COLS_PER_ROC)
 
float xoffset () const
 
float yoffset () const
 
- Public Member Functions inherited from PixelTopology
virtual float localX (const float mpX, const Topology::LocalTrackPred &) const
 
virtual float localY (const float mpY, const Topology::LocalTrackPred &) const
 
virtual std::pair< float, float > pixel (const LocalPoint &p, const Topology::LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
 ~PixelTopology () override
 
- Public Member Functions inherited from Topology
virtual int channel (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual LocalError localError (const MeasurementPoint &mp, const MeasurementError &me, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual LocalPoint localPosition (const MeasurementPoint &mp, const LocalTrackPred &) const
 conversion taking also the angle from the predicted track state More...
 
virtual MeasurementError measurementError (const LocalPoint &lp, const LocalError &le, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual MeasurementPoint measurementPosition (const LocalPoint &lp, const LocalTrackAngles &) const
 conversion taking also the angle from the track state More...
 
virtual ~Topology ()
 

Private Attributes

int m_COLS_PER_ROC
 
int m_ncols
 
int m_nrows
 
float m_pitchx
 
float m_pitchy
 
int m_ROCS_X
 
int m_ROCS_Y
 
int m_ROWS_PER_ROC
 
bool m_upgradeGeometry
 
float m_xoffset
 
float m_yoffset
 

Additional Inherited Members

- Public Types inherited from Topology
typedef Point2DBase< double, LocalTagLocal2DPoint
 
typedef Vector2D::MathVector MathVector2D
 
typedef Basic2DVector< double > Vector2D
 

Detailed Description

Topology for rectangular pixel detector with BIG pixels.

Definition at line 39 of file RectangularMTDTopology.h.

Constructor & Destructor Documentation

◆ RectangularMTDTopology()

RectangularMTDTopology::RectangularMTDTopology ( int  nrows,
int  ncols,
float  pitchx,
float  pitchy,
bool  upgradeGeometry,
int  ROWS_PER_ROC,
int  COLS_PER_ROC,
int  BIG_PIX_PER_ROC_X,
int  BIG_PIX_PER_ROC_Y,
int  ROCS_X,
int  ROCS_Y 
)
inline

Definition at line 42 of file RectangularMTDTopology.h.

53  : m_pitchx(pitchx),
54  m_pitchy(pitchy),
55  m_nrows(nrows),
56  m_ncols(ncols),
57  m_ROWS_PER_ROC(ROWS_PER_ROC), // Num of Rows per ROC
58  m_COLS_PER_ROC(COLS_PER_ROC), // Num of Cols per ROC
59  m_ROCS_X(ROCS_X), // 2 for SLHC
60  m_ROCS_Y(ROCS_Y), // 8 for SLHC
61  m_upgradeGeometry(upgradeGeometry) {
62  setOffset(BIG_PIX_PER_ROC_X, BIG_PIX_PER_ROC_Y, ROWS_PER_ROC, COLS_PER_ROC);
63  }

References setOffset().

Member Function Documentation

◆ channel()

int RectangularMTDTopology::channel ( const LocalPoint lp) const
inlineoverridevirtual

Implements Topology.

Definition at line 94 of file RectangularMTDTopology.h.

94  {
95  std::pair<float, float> p = pixel(lp);
96  return MTDChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
97  }

References AlCaHLTBitMon_ParallelJobs::p, pixel(), and MTDChannelIdentifier::pixelToChannel().

Referenced by pixelToModuleLocalPoint().

◆ colsperroc()

int RectangularMTDTopology::colsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 175 of file RectangularMTDTopology.h.

175 { return m_COLS_PER_ROC; }

References m_COLS_PER_ROC.

◆ containsBigPixelInX()

bool RectangularMTDTopology::containsBigPixelInX ( int  ixmin,
int  ixmax 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 144 of file RectangularMTDTopology.h.

144  {
145  return m_upgradeGeometry ? false : ((ixmin <= 80) & (ixmax >= 79));
146  }

References funct::false, and m_upgradeGeometry.

◆ containsBigPixelInY()

bool RectangularMTDTopology::containsBigPixelInY ( int  iymin,
int  iymax 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 147 of file RectangularMTDTopology.h.

147  {
148  return m_upgradeGeometry ? false
149  : (isItBigPixelInY(iymin) || isItBigPixelInY(iymax) || (iymin / 52) != (iymax / 52));
150  }

References funct::false, isItBigPixelInY(), and m_upgradeGeometry.

◆ isItBigPixelInX()

bool RectangularMTDTopology::isItBigPixelInX ( const int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 126 of file RectangularMTDTopology.h.

126  {
127  return ((m_upgradeGeometry) ? (false) : ((ixbin == 79) | (ixbin == 80)));
128  }

References m_upgradeGeometry.

Referenced by localError().

◆ isItBigPixelInY()

bool RectangularMTDTopology::isItBigPixelInY ( const int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 130 of file RectangularMTDTopology.h.

130  {
131  if
132  UNLIKELY(m_upgradeGeometry) return false;
133  else {
134  int iybin0 = iybin % 52;
135  return ((iybin0 == 0) | (iybin0 == 51));
136  // constexpr int bigYIndeces[]{0,51,52,103,104,155,156,207,208,259,260,311,312,363,364,415,416,511};
137  // return *std::lower_bound(std::begin(bigYIndeces),std::end(bigYIndeces),iybin) == iybin;
138  }
139  }

References m_upgradeGeometry, and UNLIKELY.

Referenced by containsBigPixelInY(), and localError().

◆ isItEdgePixel()

bool RectangularMTDTopology::isItEdgePixel ( int  ixbin,
int  iybin 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 157 of file RectangularMTDTopology.h.

157  {
158  return (isItEdgePixelInX(ixbin) | isItEdgePixelInY(iybin));
159  }

References isItEdgePixelInX(), and isItEdgePixelInY().

◆ isItEdgePixelInX()

bool RectangularMTDTopology::isItEdgePixelInX ( int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 155 of file RectangularMTDTopology.h.

155 { return ((ixbin == 0) | (ixbin == (m_nrows - 1))); }

References m_nrows.

Referenced by isItEdgePixel().

◆ isItEdgePixelInY()

bool RectangularMTDTopology::isItEdgePixelInY ( int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 156 of file RectangularMTDTopology.h.

156 { return ((iybin == 0) | (iybin == (m_ncols - 1))); }

References m_ncols.

Referenced by isItEdgePixel().

◆ localError()

LocalError RectangularMTDTopology::localError ( const MeasurementPoint mp,
const MeasurementError me 
) const
overridevirtual

Implements Topology.

Definition at line 308 of file RectangularMTDTopology.cc.

308  {
309  float pitchy = m_pitchy;
310  int binoffy = int(mp.y());
311  if (isItBigPixelInY(binoffy))
312  pitchy = 2. * m_pitchy;
313 
314  float pitchx = m_pitchx;
315  int binoffx = int(mp.x());
316  if (isItBigPixelInX(binoffx))
317  pitchx = 2. * m_pitchx;
318 
319  return LocalError(me.uu() * float(pitchx * pitchx), 0, me.vv() * float(pitchy * pitchy));
320 }

References dqmMemoryStats::float, createfilelist::int, isItBigPixelInX(), isItBigPixelInY(), m_pitchx, m_pitchy, hlt_dqm_clientPB-live_cfg::me, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

◆ localPosition()

LocalPoint RectangularMTDTopology::localPosition ( const MeasurementPoint mp) const
overridevirtual

Implements Topology.

Definition at line 172 of file RectangularMTDTopology.cc.

172  {
173  float mpy = mp.y(); // measurements
174  float mpx = mp.x();
175 
176 #ifdef EDM_ML_DEBUG
177 #define EPS 0
178  // check limits
179  std::ostringstream debugstr;
180 
181  if (mpy < 0.) {
182  debugstr << " wrong mp y, fix " << mpy << " " << 0 << "\n";
183  mpy = 0.;
184  }
185  if (mpy >= m_ncols) {
186  debugstr << " wrong mp y, fix " << mpy << " " << m_ncols << "\n";
187  mpy = float(m_ncols) - EPS; // EPS is a small number
188  }
189  if (mpx < 0.) {
190  debugstr << " wrong mp x, fix " << mpx << " " << 0 << "\n";
191  mpx = 0.;
192  }
193  if (mpx >= m_nrows) {
194  debugstr << " wrong mp x, fix " << mpx << " " << m_nrows << "\n";
195  mpx = float(m_nrows) - EPS; // EPS is a small number
196  }
197  if (!debugstr.str().empty())
198  LogDebug("RectangularMTDTopology") << debugstr.str();
199 #endif // EDM_ML_DEBUG
200 
201  float lpY = localY(mpy);
202  float lpX = localX(mpx);
203 
204  // Return it as a LocalPoint
205  return LocalPoint(lpX, lpY);
206 }

References hcal_dqm_sourceclient-live_cfg::debugstr, EPS, dqmMemoryStats::float, localX(), localY(), LogDebug, m_ncols, m_nrows, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

◆ localX()

float RectangularMTDTopology::localX ( const float  mpX) const
overridevirtual

Implements PixelTopology.

Definition at line 212 of file RectangularMTDTopology.cc.

212  {
213  int binoffx = int(mpx); // truncate to int
214  float fractionX = mpx - float(binoffx); // find the fraction
215  float local_pitchx = m_pitchx; // defaultpitch
216 
217  if
219 #ifdef EDM_ML_DEBUG
220  if (binoffx > m_ROWS_PER_ROC * m_ROCS_X) // too large
221  {
222  LogDebug("RectangularMTDTopology")
223  << " very bad, binx " << binoffx << "\n"
224  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " " << m_xoffset << "\n";
225  }
226 #endif
227  }
228  else {
229  if (binoffx > 80) { // ROC 1 - handles x on edge cluster
230  binoffx = binoffx + 2;
231  } else if (binoffx == 80) { // ROC 1
232  binoffx = binoffx + 1;
233  local_pitchx *= 2;
234  } else if (binoffx == 79) { // ROC 0
235  binoffx = binoffx + 0;
236  local_pitchx *= 2;
237  }
238  // else if (binoffx>=0) { // ROC 0
239  // binoffx=binoffx+0;
240  // }
241 
242 #ifdef EDM_ML_DEBUG
243  if (binoffx < 0) // too small
244  LogDebug("RectangularMTDTopology") << " very bad, binx " << binoffx << "\n"
245  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " "
246  << m_xoffset;
247 #endif
248  }
249 
250  // The final position in local coordinates
251  float lpX = float(binoffx * m_pitchx) + fractionX * local_pitchx + m_xoffset;
252 
253 #ifdef EDM_ML_DEBUG
254 
255  if (lpX < m_xoffset || lpX > (-m_xoffset)) {
256  LogDebug("RectangularMTDTopology") << " bad lp x " << lpX << "\n"
257  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " "
258  << m_xoffset;
259  }
260 #endif // EDM_ML_DEBUG
261 
262  return lpX;
263 }

References dqmMemoryStats::float, createfilelist::int, LogDebug, m_pitchx, m_ROCS_X, m_ROWS_PER_ROC, m_upgradeGeometry, m_xoffset, and UNLIKELY.

Referenced by localPosition().

◆ localY()

float RectangularMTDTopology::localY ( const float  mpY) const
overridevirtual

Implements PixelTopology.

Definition at line 267 of file RectangularMTDTopology.cc.

267  {
268  int binoffy = int(mpy); // truncate to int
269  float fractionY = mpy - float(binoffy); // find the fraction
270  float local_pitchy = m_pitchy; // defaultpitch
271 
272  if
274 #ifdef EDM_ML_DEBUG
275  if (binoffy > m_ROCS_Y * m_COLS_PER_ROC) // too large
276  {
277  LogDebug("RectangularMTDTopology")
278  << " very bad, biny " << binoffy << "\n"
279  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " " << m_yoffset;
280  }
281 #endif
282  }
283  else { // 415 is last big pixel, 416 and above do not exists!
284  constexpr int bigYIndeces[]{0, 51, 52, 103, 104, 155, 156, 207, 208, 259, 260, 311, 312, 363, 364, 415, 416, 511};
285  auto const j = std::lower_bound(std::begin(bigYIndeces), std::end(bigYIndeces), binoffy);
286  if (*j == binoffy)
287  local_pitchy *= 2;
288  binoffy += (j - bigYIndeces);
289  }
290 
291  // The final position in local coordinates
292  float lpY = float(binoffy * m_pitchy) + fractionY * local_pitchy + m_yoffset;
293 
294 #ifdef EDM_ML_DEBUG
295 
296  if (lpY < m_yoffset || lpY > (-m_yoffset)) {
297  LogDebug("RectangularMTDTopology") << " bad lp y " << lpY << "\n"
298  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " "
299  << m_yoffset;
300  }
301 #endif // EDM_ML_DEBUG
302 
303  return lpY;
304 }

References mps_fire::end, dqmMemoryStats::float, createfilelist::int, dqmiolumiharvest::j, LogDebug, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, m_COLS_PER_ROC, m_pitchy, m_ROCS_Y, m_upgradeGeometry, m_yoffset, and UNLIKELY.

Referenced by localPosition().

◆ measurementError()

MeasurementError RectangularMTDTopology::measurementError ( const LocalPoint lp,
const LocalError le 
) const
overridevirtual

Implements Topology.

Definition at line 324 of file RectangularMTDTopology.cc.

324  {
325  float pitchy = m_pitchy;
326  float pitchx = m_pitchx;
327 
328  if
330  int iybin = int((lp.y() - m_yoffset) / m_pitchy); //get bin for equal picth
331  int iybin0 = iybin % 54; //This is just to avoid many ifs by using the periodicy
332  //quasi bins 0,1,52,53 fall into larger pixels
333  if ((iybin0 <= 1) | (iybin0 >= 52))
334  pitchy = 2.f * m_pitchy;
335 
336  int ixbin = int((lp.x() - m_xoffset) / m_pitchx); //get bin for equal pitch
337  //quasi bins 79,80,81,82 fall into the 2 larger pixels
338  if ((ixbin >= 79) & (ixbin <= 82))
339  pitchx = 2.f * m_pitchx;
340  }
341 
342  return MeasurementError(le.xx() / float(pitchx * pitchx), 0, le.yy() / float(pitchy * pitchy));
343 }

References dqmMemoryStats::float, createfilelist::int, LIKELY, m_pitchx, m_pitchy, m_upgradeGeometry, m_xoffset, m_yoffset, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

◆ measurementPosition()

MeasurementPoint RectangularMTDTopology::measurementPosition ( const LocalPoint lp) const
inlineoverridevirtual

Implements Topology.

Definition at line 76 of file RectangularMTDTopology.h.

76  {
77  std::pair<float, float> p = pixel(lp);
78  return MeasurementPoint(p.first, p.second);
79  }

References AlCaHLTBitMon_ParallelJobs::p, and pixel().

◆ moduleToPixelLocalPoint()

LocalPoint RectangularMTDTopology::moduleToPixelLocalPoint ( const LocalPoint mlp) const
inline

Definition at line 102 of file RectangularMTDTopology.h.

102  {
103  std::pair<float, float> p = pixel(mlp);
104  return LocalPoint(mlp.x() - (m_xoffset + (int(p.first) + 0.5f) * m_pitchx),
105  mlp.y() - (m_yoffset + (int(p.second) + 0.5f) * m_pitchy),
106  mlp.z());
107  }

References createfilelist::int, m_pitchx, m_pitchy, m_xoffset, m_yoffset, AlCaHLTBitMon_ParallelJobs::p, pixel(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ ncolumns()

int RectangularMTDTopology::ncolumns ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 167 of file RectangularMTDTopology.h.

167 { return (m_ncols); }

References m_ncols.

◆ nrows()

int RectangularMTDTopology::nrows ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 165 of file RectangularMTDTopology.h.

165 { return (m_nrows); }

References m_nrows.

Referenced by MTDThresholdClusterizer::setup().

◆ pitch()

std::pair<float, float> RectangularMTDTopology::pitch ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 163 of file RectangularMTDTopology.h.

163 { return std::pair<float, float>(float(m_pitchx), float(m_pitchy)); }

References m_pitchx, and m_pitchy.

◆ pixel()

std::pair< float, float > RectangularMTDTopology::pixel ( const LocalPoint p) const
overridevirtual

Implements PixelTopology.

Definition at line 33 of file RectangularMTDTopology.cc.

33  {
34  // check limits
35  float py = p.y();
36  float px = p.x();
37 
38  LogDebug("RectangularMTDTopology").log([&](auto& debugstr) {
39 #define EPSCM 0
40 #define EPS 0
41  // This will catch points which are outside the active sensor area.
42  // In the digitizer during the early induce_signal phase non valid
43  // location are passed here. They are cleaned later.
44  debugstr << "py = " << py << ", m_yoffset = " << m_yoffset << "px = " << px << ", m_xoffset = " << m_xoffset
45  << "\n";
46 
47  if (py < m_yoffset) // m_yoffset is negative
48  {
49  debugstr << " wrong lp y " << py << " " << m_yoffset << "\n";
50  py = m_yoffset + EPSCM; // make sure it is in, add an EPS in cm
51  }
52  if (py > -m_yoffset) {
53  debugstr << " wrong lp y " << py << " " << -m_yoffset << "\n";
54  py = -m_yoffset - EPSCM;
55  }
56  if (px < m_xoffset) // m_xoffset is negative
57  {
58  debugstr << " wrong lp x " << px << " " << m_xoffset << "\n";
59  px = m_xoffset + EPSCM;
60  }
61  if (px > -m_xoffset) {
62  debugstr << " wrong lp x " << px << " " << -m_xoffset << "\n";
63  px = -m_xoffset - EPSCM;
64  }
65  });
66 
67  float newybin = (py - m_yoffset) / m_pitchy;
68  int iybin = int(newybin);
69  float fractionY = newybin - iybin;
70 
71  // Normalize it all to 1 ROC
72  int iybin0 = 0;
73  int numROC = 0;
74  float mpY = 0.;
75 
76  if (m_upgradeGeometry) {
77  iybin0 = (iybin % m_COLS_PER_ROC); // 0-51
78  numROC = iybin / m_COLS_PER_ROC; // 0-7
79  mpY = float(numROC * m_COLS_PER_ROC + iybin0) + fractionY;
80 
81 #ifdef EDM_ML_DEBUG
82 
83  if (iybin0 > m_COLS_PER_ROC) {
84  LogDebug("RectangularMTDTopology") << " very bad, newbiny " << iybin0 << "\n"
85  << py << " " << m_yoffset << " " << m_pitchy << " " << newybin << " " << iybin
86  << " " << fractionY << " " << iybin0 << " " << numROC;
87  }
88 #endif // EDM_ML_DEBUG
89 
90  } else {
91  iybin0 = (iybin % 54); // 0-53
92  numROC = iybin / 54; // 0-7
93 
94  if (iybin0 == 53) { // inside big pixel
95  iybin0 = 51;
96  fractionY = (fractionY + 1.) / 2.;
97  } else if (iybin0 == 52) { // inside big pixel
98  iybin0 = 51;
99  fractionY = fractionY / 2.;
100  } else if (iybin0 > 1) { // inside normal pixel
101  iybin0 = iybin0 - 1;
102  } else if (iybin0 == 1) { // inside big pixel
103  iybin0 = 0;
104  fractionY = (fractionY + 1.) / 2.;
105  } else if (iybin0 == 0) { // inside big pixel
106  iybin0 = 0;
107  fractionY = fractionY / 2.;
108  }
109 
110  mpY = float(numROC * 52. + iybin0) + fractionY;
111  }
112 
113 #ifdef EDM_ML_DEBUG
114 
115  if (mpY < 0. || mpY >= 416.) {
116  LogDebug("RectangularMTDTopology") << " bad pix y " << mpY << "\n"
117  << py << " " << m_yoffset << " " << m_pitchy << " " << newybin << " " << iybin
118  << " " << fractionY << " " << iybin0 << " " << numROC;
119  }
120 #endif // EDM_ML_DEBUG
121 
122  // In X
123  float newxbin = (px - m_xoffset) / m_pitchx;
124  int ixbin = int(newxbin);
125  float fractionX = newxbin - ixbin;
126 
127 #ifdef EDM_ML_DEBUG
128 
129  if (ixbin > 161 || ixbin < 0) // ixbin < 0 outside range
130  {
131  LogDebug("RectangularMTDTopology") << " very bad, newbinx " << ixbin << "\n"
132  << px << " " << m_xoffset << " " << m_pitchx << " " << newxbin << " " << ixbin
133  << " " << fractionX;
134  }
135 #endif // EDM_ML_DEBUG
136 
137  if (!m_upgradeGeometry) {
138  if (ixbin > 82) { // inside normal pixel, ROC 1
139  ixbin = ixbin - 2;
140  } else if (ixbin == 82) { // inside bin pixel
141  ixbin = 80;
142  fractionX = (fractionX + 1.) / 2.;
143  } else if (ixbin == 81) { // inside big pixel
144  ixbin = 80;
145  fractionX = fractionX / 2.;
146  } else if (ixbin == 80) { // inside bin pixel, ROC 0
147  ixbin = 79;
148  fractionX = (fractionX + 1.) / 2.;
149  } else if (ixbin == 79) { // inside big pixel
150  ixbin = 79;
151  fractionX = fractionX / 2.;
152  }
153  }
154 
155  float mpX = float(ixbin) + fractionX;
156 
157 #ifdef EDM_ML_DEBUG
158 
159  if (mpX < 0. || mpX >= 160.) {
160  LogDebug("RectangularMTDTopology") << " bad pix x " << mpX << "\n"
161  << px << " " << m_xoffset << " " << m_pitchx << " " << newxbin << " " << ixbin
162  << " " << fractionX;
163  }
164 #endif // EDM_ML_DEBUG
165 
166  return std::pair<float, float>(mpX, mpY);
167 }

References hcal_dqm_sourceclient-live_cfg::debugstr, EPSCM, dqmMemoryStats::float, createfilelist::int, LogDebug, m_COLS_PER_ROC, m_pitchx, m_pitchy, m_upgradeGeometry, m_xoffset, m_yoffset, AlCaHLTBitMon_ParallelJobs::p, multPhiCorr_741_25nsDY_cfi::px, and multPhiCorr_741_25nsDY_cfi::py.

Referenced by channel(), measurementPosition(), and moduleToPixelLocalPoint().

◆ pixelToModuleLocalPoint() [1/2]

LocalPoint RectangularMTDTopology::pixelToModuleLocalPoint ( const LocalPoint plp,
int  channel 
) const
inline

Definition at line 112 of file RectangularMTDTopology.h.

112  {
113  std::pair<int, int> p = MTDChannelIdentifier::channelToPixel(channel);
114  return pixelToModuleLocalPoint(plp, p.first, p.second);
115  }

References channel(), MTDChannelIdentifier::channelToPixel(), AlCaHLTBitMon_ParallelJobs::p, and pixelToModuleLocalPoint().

◆ pixelToModuleLocalPoint() [2/2]

LocalPoint RectangularMTDTopology::pixelToModuleLocalPoint ( const LocalPoint plp,
int  row,
int  col 
) const
inline

Definition at line 108 of file RectangularMTDTopology.h.

108  {
109  return LocalPoint(
110  plp.x() + (m_xoffset + (row + 0.5f) * m_pitchx), plp.y() + (m_yoffset + (col + 0.5f) * m_pitchy), plp.z());
111  }

References cuy::col, m_pitchx, m_pitchy, m_xoffset, m_yoffset, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by pixelToModuleLocalPoint().

◆ rocsX()

int RectangularMTDTopology::rocsX ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 171 of file RectangularMTDTopology.h.

171 { return m_ROCS_X; }

References m_ROCS_X.

◆ rocsY()

int RectangularMTDTopology::rocsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 169 of file RectangularMTDTopology.h.

169 { return m_ROCS_Y; }

References m_ROCS_Y.

◆ rowsperroc()

int RectangularMTDTopology::rowsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 173 of file RectangularMTDTopology.h.

173 { return m_ROWS_PER_ROC; }

References m_ROWS_PER_ROC.

◆ setOffset()

void RectangularMTDTopology::setOffset ( const int &  BIG_PIX_PER_ROC_X,
const int &  BIG_PIX_PER_ROC_Y,
const int &  ROWS_PER_ROC,
const int &  COLS_PER_ROC 
)

Topology for rectangular pixel detector with BIG pixels.

Definition at line 14 of file RectangularMTDTopology.cc.

17  {
18  m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X * m_nrows / ROWS_PER_ROC) / 2. * m_pitchx;
19  m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y * m_ncols / COLS_PER_ROC) / 2. * m_pitchy;
20 
21  LogDebug("RectangularMTDTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx " << m_pitchx
22  << ", pitchy " << m_pitchy << ", xoffset " << m_xoffset << ", yoffset "
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 "
26  << m_ROCS_Y << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X << ", NCOL "
28 }

References LogDebug, m_COLS_PER_ROC, m_ncols, m_nrows, m_pitchx, m_pitchy, m_ROCS_X, m_ROCS_Y, m_ROWS_PER_ROC, m_xoffset, and m_yoffset.

Referenced by RectangularMTDTopology().

◆ xoffset()

float RectangularMTDTopology::xoffset ( ) const
inline

Definition at line 176 of file RectangularMTDTopology.h.

176 { return m_xoffset; }

References m_xoffset.

◆ yoffset()

float RectangularMTDTopology::yoffset ( ) const
inline

Definition at line 177 of file RectangularMTDTopology.h.

177 { return m_yoffset; }

References m_yoffset.

Member Data Documentation

◆ m_COLS_PER_ROC

int RectangularMTDTopology::m_COLS_PER_ROC
private

Definition at line 187 of file RectangularMTDTopology.h.

Referenced by colsperroc(), localY(), pixel(), and setOffset().

◆ m_ncols

int RectangularMTDTopology::m_ncols
private

Definition at line 185 of file RectangularMTDTopology.h.

Referenced by isItEdgePixelInY(), localPosition(), ncolumns(), and setOffset().

◆ m_nrows

int RectangularMTDTopology::m_nrows
private

Definition at line 184 of file RectangularMTDTopology.h.

Referenced by isItEdgePixelInX(), localPosition(), nrows(), and setOffset().

◆ m_pitchx

float RectangularMTDTopology::m_pitchx
private

◆ m_pitchy

float RectangularMTDTopology::m_pitchy
private

◆ m_ROCS_X

int RectangularMTDTopology::m_ROCS_X
private

Definition at line 188 of file RectangularMTDTopology.h.

Referenced by localX(), rocsX(), and setOffset().

◆ m_ROCS_Y

int RectangularMTDTopology::m_ROCS_Y
private

Definition at line 189 of file RectangularMTDTopology.h.

Referenced by localY(), rocsY(), and setOffset().

◆ m_ROWS_PER_ROC

int RectangularMTDTopology::m_ROWS_PER_ROC
private

Definition at line 186 of file RectangularMTDTopology.h.

Referenced by localX(), rowsperroc(), and setOffset().

◆ m_upgradeGeometry

bool RectangularMTDTopology::m_upgradeGeometry
private

◆ m_xoffset

float RectangularMTDTopology::m_xoffset
private

◆ m_yoffset

float RectangularMTDTopology::m_yoffset
private
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:105
RectangularMTDTopology::m_ROCS_Y
int m_ROCS_Y
Definition: RectangularMTDTopology.h:189
RectangularMTDTopology::m_pitchy
float m_pitchy
Definition: RectangularMTDTopology.h:181
RectangularMTDTopology::m_ncols
int m_ncols
Definition: RectangularMTDTopology.h:185
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:29
RectangularMTDTopology::isItBigPixelInX
bool isItBigPixelInX(const int ixbin) const override
Definition: RectangularMTDTopology.h:126
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
EPSCM
#define EPSCM
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cuy.col
col
Definition: cuy.py:1010
RectangularMTDTopology::pixel
std::pair< float, float > pixel(const LocalPoint &p) const override
Definition: RectangularMTDTopology.cc:33
RectangularMTDTopology::nrows
int nrows() const override
Definition: RectangularMTDTopology.h:165
hcal_dqm_sourceclient-live_cfg.debugstr
debugstr
Definition: hcal_dqm_sourceclient-live_cfg.py:18
RectangularMTDTopology::localY
float localY(const float mpY) const override
Definition: RectangularMTDTopology.cc:267
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
EPS
#define EPS
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
RectangularMTDTopology::isItEdgePixelInY
bool isItEdgePixelInY(int iybin) const override
Definition: RectangularMTDTopology.h:156
LocalError::xx
float xx() const
Definition: LocalError.h:22
MTDChannelIdentifier::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: MTDChannelIdentifier.h:22
RectangularMTDTopology::m_xoffset
float m_xoffset
Definition: RectangularMTDTopology.h:182
MeasurementError
Definition: MeasurementError.h:8
mps_fire.end
end
Definition: mps_fire.py:242
RectangularMTDTopology::setOffset
void setOffset(const int &BIG_PIX_PER_ROC_X, const int &BIG_PIX_PER_ROC_Y, const int &ROWS_PER_ROC, const int &COLS_PER_ROC)
Definition: RectangularMTDTopology.cc:14
RectangularMTDTopology::m_upgradeGeometry
bool m_upgradeGeometry
Definition: RectangularMTDTopology.h:190
RectangularMTDTopology::m_pitchx
float m_pitchx
Definition: RectangularMTDTopology.h:180
MeasurementPoint
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Definition: MeasurementPoint.h:12
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
LocalError
Definition: LocalError.h:12
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
createfilelist.int
int
Definition: createfilelist.py:10
RectangularMTDTopology::m_ROCS_X
int m_ROCS_X
Definition: RectangularMTDTopology.h:188
RectangularMTDTopology::isItBigPixelInY
bool isItBigPixelInY(const int iybin) const override
Definition: RectangularMTDTopology.h:130
RectangularMTDTopology::isItEdgePixelInX
bool isItEdgePixelInX(int ixbin) const override
Definition: RectangularMTDTopology.h:155
RectangularMTDTopology::localX
float localX(const float mpX) const override
Definition: RectangularMTDTopology.cc:212
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
RectangularMTDTopology::m_nrows
int m_nrows
Definition: RectangularMTDTopology.h:184
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
RectangularMTDTopology::m_yoffset
float m_yoffset
Definition: RectangularMTDTopology.h:183
RectangularMTDTopology::m_ROWS_PER_ROC
int m_ROWS_PER_ROC
Definition: RectangularMTDTopology.h:186
RectangularMTDTopology::channel
int channel(const LocalPoint &lp) const override
Definition: RectangularMTDTopology.h:94
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
MTDChannelIdentifier::channelToPixel
static std::pair< int, int > channelToPixel(int ch)
Definition: MTDChannelIdentifier.h:16
RectangularMTDTopology::pixelToModuleLocalPoint
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
Definition: RectangularMTDTopology.h:108
LocalError::yy
float yy() const
Definition: LocalError.h:24
RectangularMTDTopology::m_COLS_PER_ROC
int m_COLS_PER_ROC
Definition: RectangularMTDTopology.h:187