CMS 3D CMS Logo

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

#include <RectangularPixelTopology.h>

Inheritance diagram for RectangularPixelTopology:
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 isBricked () 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
 
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
 
 RectangularPixelTopology (int nrows, int ncols, float pitchx, float pitchy, bool upgradeGeometry, bool isBricked, 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
 
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
 
bool m_isBricked
 
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 RectangularPixelTopology.h.

Constructor & Destructor Documentation

◆ RectangularPixelTopology()

RectangularPixelTopology::RectangularPixelTopology ( int  nrows,
int  ncols,
float  pitchx,
float  pitchy,
bool  upgradeGeometry,
bool  isBricked,
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 RectangularPixelTopology.h.

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

54  : m_pitchx(pitchx),
55  m_pitchy(pitchy),
56  m_nrows(nrows),
57  m_ncols(ncols),
58  m_ROWS_PER_ROC(ROWS_PER_ROC), // Num of Rows per ROC
59  m_COLS_PER_ROC(COLS_PER_ROC), // Num of Cols per ROC
60  m_ROCS_X(ROCS_X), // 2 for SLHC
61  m_ROCS_Y(ROCS_Y), // 8 for SLHC
62  m_upgradeGeometry(upgradeGeometry),
64  // Calculate the edge of the active sensor with respect to the center,
65  // that is simply the half-size.
66  // Take into account large pixels
67  m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X * m_nrows / ROWS_PER_ROC) / 2. * m_pitchx;
68  m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y * m_ncols / COLS_PER_ROC) / 2. * m_pitchy;
69 
70  LogDebug("RectangularPixelTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx " << m_pitchx
71  << ", pitchy " << m_pitchy << ", xoffset " << m_xoffset << ", yoffset "
72  << m_yoffset << ", BIG_PIX_PER_ROC_X " << BIG_PIX_PER_ROC_X
73  << ", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y << ", ROWS_PER_ROC "
74  << ROWS_PER_ROC << ", COLS_PER_ROC " << COLS_PER_ROC << ", ROCS_X " << ROCS_X
75  << ", ROCS_Y " << ROCS_Y << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X
76  << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y << ", isBricked " << m_isBricked;
77  }
#define LogDebug(id)

Member Function Documentation

◆ channel()

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

Implements Topology.

Definition at line 102 of file RectangularPixelTopology.h.

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

102  {
103  std::pair<float, float> p = pixel(lp);
104  return PixelChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
105  }
std::pair< float, float > pixel(const LocalPoint &p) const override
static int pixelToChannel(int row, int col)

◆ colsperroc()

int RectangularPixelTopology::colsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 165 of file RectangularPixelTopology.h.

References m_COLS_PER_ROC.

◆ containsBigPixelInX()

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

Implements PixelTopology.

Definition at line 134 of file RectangularPixelTopology.h.

References funct::false, and m_upgradeGeometry.

Referenced by PixelCPEGenericBase::initializeLocalErrorVariables(), PixelCPEBase::setTheClu(), and PixelTemplateSmearerBase::smearHit().

134  {
135  return m_upgradeGeometry ? false : ((ixmin <= 80) & (ixmax >= 79));
136  }

◆ containsBigPixelInY()

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

Implements PixelTopology.

Definition at line 137 of file RectangularPixelTopology.h.

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

Referenced by PixelCPEGenericBase::initializeLocalErrorVariables(), PixelCPEBase::setTheClu(), and PixelTemplateSmearerBase::smearHit().

137  {
138  return m_upgradeGeometry ? false
139  : (isItBigPixelInY(iymin) || isItBigPixelInY(iymax) || (iymin / 52) != (iymax / 52));
140  }
bool isItBigPixelInY(const int iybin) const override

◆ isBricked()

bool RectangularPixelTopology::isBricked ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 168 of file RectangularPixelTopology.h.

References m_isBricked.

◆ isItBigPixelInX()

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

◆ isItBigPixelInY()

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

Implements PixelTopology.

Definition at line 120 of file RectangularPixelTopology.h.

References m_upgradeGeometry, and UNLIKELY.

Referenced by containsBigPixelInY(), PixelCPEGeneric::localError(), localError(), PixelCPEGenericForBricked::localPosition(), PixelCPEGeneric::localPosition(), PixelCPEClusterRepair::localPosition(), PixelCPETemplateReco::localPosition(), and PixelTemplateSmearerBase::smearHit().

120  {
122  return false;
123  else {
124  int iybin0 = iybin % 52;
125  return ((iybin0 == 0) | (iybin0 == 51));
126  // constexpr int bigYIndeces[]{0,51,52,103,104,155,156,207,208,259,260,311,312,363,364,415,416,511};
127  // return *std::lower_bound(std::begin(bigYIndeces),std::end(bigYIndeces),iybin) == iybin;
128  }
129  }
#define UNLIKELY(x)
Definition: Likely.h:21

◆ isItEdgePixel()

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

Implements PixelTopology.

Definition at line 147 of file RectangularPixelTopology.h.

References isItEdgePixelInX(), and isItEdgePixelInY().

147  {
148  return (isItEdgePixelInX(ixbin) | isItEdgePixelInY(iybin));
149  }
bool isItEdgePixelInY(int iybin) const override
bool isItEdgePixelInX(int ixbin) const override

◆ isItEdgePixelInX()

bool RectangularPixelTopology::isItEdgePixelInX ( int  ixbin) const
inlineoverridevirtual

◆ isItEdgePixelInY()

bool RectangularPixelTopology::isItEdgePixelInY ( int  iybin) const
inlineoverridevirtual

◆ localError()

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

Implements Topology.

Definition at line 288 of file RectangularPixelTopology.cc.

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().

288  {
289  float pitchy = m_pitchy;
290  int binoffy = int(mp.y());
291  if (isItBigPixelInY(binoffy))
292  pitchy = 2. * m_pitchy;
293 
294  float pitchx = m_pitchx;
295  int binoffx = int(mp.x());
296  if (isItBigPixelInX(binoffx))
297  pitchx = 2. * m_pitchx;
298 
299  return LocalError(me.uu() * float(pitchx * pitchx), 0, me.vv() * float(pitchy * pitchy));
300 }
T x() const
Definition: PV2DBase.h:43
T y() const
Definition: PV2DBase.h:44
bool isItBigPixelInX(const int ixbin) const override
bool isItBigPixelInY(const int iybin) const override

◆ localPosition()

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

Implements Topology.

Definition at line 156 of file RectangularPixelTopology.cc.

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().

Referenced by PixelTemplateSmearerBase::smearHit().

156  {
157  float mpy = mp.y(); // measurements
158  float mpx = mp.x();
159 
160 #ifdef EDM_ML_DEBUG
161 #define EPS 0
162  // check limits
163  std::ostringstream debugstr;
164 
165  if (mpy < 0.) {
166  debugstr << " wrong mp y, fix " << mpy << " " << 0 << "\n";
167  mpy = 0.;
168  }
169  if (mpy >= m_ncols) {
170  debugstr << " wrong mp y, fix " << mpy << " " << m_ncols << "\n";
171  mpy = float(m_ncols) - EPS; // EPS is a small number
172  }
173  if (mpx < 0.) {
174  debugstr << " wrong mp x, fix " << mpx << " " << 0 << "\n";
175  mpx = 0.;
176  }
177  if (mpx >= m_nrows) {
178  debugstr << " wrong mp x, fix " << mpx << " " << m_nrows << "\n";
179  mpx = float(m_nrows) - EPS; // EPS is a small number
180  }
181  if (!debugstr.str().empty())
182  LogDebug("RectangularPixelTopology") << debugstr.str();
183 #endif // EDM_ML_DEBUG
184 
185  float lpY = localY(mpy);
186  float lpX = localX(mpx);
187 
188  // Return it as a LocalPoint
189  return LocalPoint(lpX, lpY);
190 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
#define EPS
T x() const
Definition: PV2DBase.h:43
T y() const
Definition: PV2DBase.h:44
float localY(const float mpY) const override
float localX(const float mpX) const override
#define LogDebug(id)

◆ localX()

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

Implements PixelTopology.

Definition at line 196 of file RectangularPixelTopology.cc.

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

Referenced by localPosition().

196  {
197  int binoffx = int(mpx); // truncate to int
198  float fractionX = mpx - float(binoffx); // find the fraction
199  float local_pitchx = m_pitchx; // defaultpitch
200 
202 #ifdef EDM_ML_DEBUG
203  if (binoffx > m_ROWS_PER_ROC * m_ROCS_X) // too large
204  {
205  LogDebug("RectangularPixelTopology")
206  << " very bad, binx " << binoffx << "\n"
207  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " " << m_xoffset << "\n";
208  }
209 #endif
210  } else {
211  if (binoffx > 80) { // ROC 1 - handles x on edge cluster
212  binoffx = binoffx + 2;
213  } else if (binoffx == 80) { // ROC 1
214  binoffx = binoffx + 1;
215  local_pitchx *= 2;
216  } else if (binoffx == 79) { // ROC 0
217  binoffx = binoffx + 0;
218  local_pitchx *= 2;
219  }
220  // else if (binoffx>=0) { // ROC 0
221  // binoffx=binoffx+0;
222  // }
223 
224 #ifdef EDM_ML_DEBUG
225  if (binoffx < 0) // too small
226  LogDebug("RectangularPixelTopology")
227  << " very bad, binx " << binoffx << "\n"
228  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " " << m_xoffset;
229 #endif
230  }
231 
232  // The final position in local coordinates
233  float lpX = float(binoffx * m_pitchx) + fractionX * local_pitchx + m_xoffset;
234 
235 #ifdef EDM_ML_DEBUG
236 
237  if (lpX < m_xoffset || lpX > (-m_xoffset)) {
238  LogDebug("RectangularPixelTopology") << " bad lp x " << lpX << "\n"
239  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " "
240  << m_xoffset;
241  }
242 #endif // EDM_ML_DEBUG
243 
244  return lpX;
245 }
#define UNLIKELY(x)
Definition: Likely.h:21
#define LogDebug(id)

◆ localY()

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

Implements PixelTopology.

Definition at line 249 of file RectangularPixelTopology.cc.

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().

249  {
250  int binoffy = int(mpy); // truncate to int
251  float fractionY = mpy - float(binoffy); // find the fraction
252  float local_pitchy = m_pitchy; // defaultpitch
253 
255 #ifdef EDM_ML_DEBUG
256  if (binoffy > m_ROCS_Y * m_COLS_PER_ROC) // too large
257  {
258  LogDebug("RectangularPixelTopology")
259  << " very bad, biny " << binoffy << "\n"
260  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " " << m_yoffset;
261  }
262 #endif
263  } else { // 415 is last big pixel, 416 and above do not exists!
264  constexpr int bigYIndeces[]{0, 51, 52, 103, 104, 155, 156, 207, 208, 259, 260, 311, 312, 363, 364, 415, 416, 511};
265  auto const j = std::lower_bound(std::begin(bigYIndeces), std::end(bigYIndeces), binoffy);
266  if (*j == binoffy)
267  local_pitchy *= 2;
268  binoffy += (j - bigYIndeces);
269  }
270 
271  // The final position in local coordinates
272  float lpY = float(binoffy * m_pitchy) + fractionY * local_pitchy + m_yoffset;
273 
274 #ifdef EDM_ML_DEBUG
275 
276  if (lpY < m_yoffset || lpY > (-m_yoffset)) {
277  LogDebug("RectangularPixelTopology") << " bad lp y " << lpY << "\n"
278  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " "
279  << m_yoffset;
280  }
281 #endif // EDM_ML_DEBUG
282 
283  return lpY;
284 }
#define UNLIKELY(x)
Definition: Likely.h:21
#define LogDebug(id)

◆ measurementError()

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

Implements Topology.

Definition at line 304 of file RectangularPixelTopology.cc.

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().

304  {
305  float pitchy = m_pitchy;
306  float pitchx = m_pitchx;
307 
308  if LIKELY (!m_upgradeGeometry) {
309  int iybin = int((lp.y() - m_yoffset) / m_pitchy); //get bin for equal picth
310  int iybin0 = iybin % 54; //This is just to avoid many ifs by using the periodicy
311  //quasi bins 0,1,52,53 fall into larger pixels
312  if ((iybin0 <= 1) | (iybin0 >= 52))
313  pitchy = 2.f * m_pitchy;
314 
315  int ixbin = int((lp.x() - m_xoffset) / m_pitchx); //get bin for equal pitch
316  //quasi bins 79,80,81,82 fall into the 2 larger pixels
317  if ((ixbin >= 79) & (ixbin <= 82))
318  pitchx = 2.f * m_pitchx;
319  }
320 
321  return MeasurementError(le.xx() / float(pitchx * pitchx), 0, le.yy() / float(pitchy * pitchy));
322 }
#define LIKELY(x)
Definition: Likely.h:20
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
float xx() const
Definition: LocalError.h:22

◆ measurementPosition()

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

Implements Topology.

Definition at line 84 of file RectangularPixelTopology.h.

References AlCaHLTBitMon_ParallelJobs::p, and pixel().

Referenced by PixelTemplateSmearerBase::smearHit().

84  {
85  std::pair<float, float> p = pixel(lp);
86  return MeasurementPoint(p.first, p.second);
87  }
std::pair< float, float > pixel(const LocalPoint &p) const override
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.

◆ ncolumns()

int RectangularPixelTopology::ncolumns ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 157 of file RectangularPixelTopology.h.

References m_ncols.

Referenced by PixelCPEBase::setTheClu().

◆ nrows()

int RectangularPixelTopology::nrows ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 155 of file RectangularPixelTopology.h.

References m_nrows.

Referenced by PixelCPEBase::setTheClu().

◆ pitch()

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

Implements PixelTopology.

Definition at line 153 of file RectangularPixelTopology.h.

References dqmMemoryStats::float, m_pitchx, and m_pitchy.

◆ pixel()

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

Topology for rectangular pixel detector with BIG pixels.

Implements PixelTopology.

Definition at line 13 of file RectangularPixelTopology.cc.

References hcal_dqm_sourceclient-live_cfg::debugstr, 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(), and measurementPosition().

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

◆ rocsX()

int RectangularPixelTopology::rocsX ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 161 of file RectangularPixelTopology.h.

References m_ROCS_X.

◆ rocsY()

int RectangularPixelTopology::rocsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 159 of file RectangularPixelTopology.h.

References m_ROCS_Y.

◆ rowsperroc()

int RectangularPixelTopology::rowsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 163 of file RectangularPixelTopology.h.

References m_ROWS_PER_ROC.

◆ xoffset()

float RectangularPixelTopology::xoffset ( ) const
inline

Definition at line 166 of file RectangularPixelTopology.h.

References m_xoffset.

◆ yoffset()

float RectangularPixelTopology::yoffset ( ) const
inline

Definition at line 167 of file RectangularPixelTopology.h.

References m_yoffset.

Member Data Documentation

◆ m_COLS_PER_ROC

int RectangularPixelTopology::m_COLS_PER_ROC
private

Definition at line 178 of file RectangularPixelTopology.h.

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

◆ m_isBricked

bool RectangularPixelTopology::m_isBricked
private

Definition at line 182 of file RectangularPixelTopology.h.

Referenced by isBricked(), and RectangularPixelTopology().

◆ m_ncols

int RectangularPixelTopology::m_ncols
private

◆ m_nrows

int RectangularPixelTopology::m_nrows
private

◆ m_pitchx

float RectangularPixelTopology::m_pitchx
private

◆ m_pitchy

float RectangularPixelTopology::m_pitchy
private

◆ m_ROCS_X

int RectangularPixelTopology::m_ROCS_X
private

Definition at line 179 of file RectangularPixelTopology.h.

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

◆ m_ROCS_Y

int RectangularPixelTopology::m_ROCS_Y
private

Definition at line 180 of file RectangularPixelTopology.h.

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

◆ m_ROWS_PER_ROC

int RectangularPixelTopology::m_ROWS_PER_ROC
private

Definition at line 177 of file RectangularPixelTopology.h.

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

◆ m_upgradeGeometry

bool RectangularPixelTopology::m_upgradeGeometry
private

◆ m_xoffset

float RectangularPixelTopology::m_xoffset
private

◆ m_yoffset

float RectangularPixelTopology::m_yoffset
private