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 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, 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
 
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,
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.

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  // Calculate the edge of the active sensor with respect to the center,
63  // that is simply the half-size.
64  // Take into account large pixels
65  m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X * m_nrows / ROWS_PER_ROC) / 2. * m_pitchx;
66  m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y * m_ncols / COLS_PER_ROC) / 2. * m_pitchy;
67 
68  LogDebug("RectangularPixelTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx " << m_pitchx
69  << ", pitchy " << m_pitchy << ", xoffset " << m_xoffset << ", yoffset "
70  << m_yoffset << ", BIG_PIX_PER_ROC_X " << BIG_PIX_PER_ROC_X
71  << ", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y << ", ROWS_PER_ROC "
72  << ROWS_PER_ROC << ", COLS_PER_ROC " << COLS_PER_ROC << ", ROCS_X " << ROCS_X
73  << ", ROCS_Y " << ROCS_Y << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X
74  << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y;
75  }

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.

Member Function Documentation

◆ channel()

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

Implements Topology.

Definition at line 100 of file RectangularPixelTopology.h.

100  {
101  std::pair<float, float> p = pixel(lp);
102  return PixelChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
103  }

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

◆ colsperroc()

int RectangularPixelTopology::colsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 163 of file RectangularPixelTopology.h.

163 { return m_COLS_PER_ROC; }

References m_COLS_PER_ROC.

◆ containsBigPixelInX()

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

Implements PixelTopology.

Definition at line 132 of file RectangularPixelTopology.h.

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

References funct::false, and m_upgradeGeometry.

Referenced by PixelCPEFast::localError(), PixelCPEGeneric::localError(), PixelCPEBase::setTheClu(), and PixelTemplateSmearerBase::smearHit().

◆ containsBigPixelInY()

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

Implements PixelTopology.

Definition at line 135 of file RectangularPixelTopology.h.

135  {
136  return m_upgradeGeometry ? false
137  : (isItBigPixelInY(iymin) || isItBigPixelInY(iymax) || (iymin / 52) != (iymax / 52));
138  }

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

Referenced by PixelCPEFast::localError(), PixelCPEGeneric::localError(), PixelCPEBase::setTheClu(), and PixelTemplateSmearerBase::smearHit().

◆ isItBigPixelInX()

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

◆ isItBigPixelInY()

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

Implements PixelTopology.

Definition at line 118 of file RectangularPixelTopology.h.

118  {
120  return false;
121  else {
122  int iybin0 = iybin % 52;
123  return ((iybin0 == 0) | (iybin0 == 51));
124  // constexpr int bigYIndeces[]{0,51,52,103,104,155,156,207,208,259,260,311,312,363,364,415,416,511};
125  // return *std::lower_bound(std::begin(bigYIndeces),std::end(bigYIndeces),iybin) == iybin;
126  }
127  }

References m_upgradeGeometry, and UNLIKELY.

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

◆ isItEdgePixel()

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

Implements PixelTopology.

Definition at line 145 of file RectangularPixelTopology.h.

145  {
146  return (isItEdgePixelInX(ixbin) | isItEdgePixelInY(iybin));
147  }

References isItEdgePixelInX(), and isItEdgePixelInY().

◆ isItEdgePixelInX()

bool RectangularPixelTopology::isItEdgePixelInX ( int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 143 of file RectangularPixelTopology.h.

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

References m_nrows.

Referenced by isItEdgePixel(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localError(), and PixelTemplateSmearerBase::smearHit().

◆ isItEdgePixelInY()

bool RectangularPixelTopology::isItEdgePixelInY ( int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 144 of file RectangularPixelTopology.h.

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

References m_ncols.

Referenced by isItEdgePixel(), PixelCPETemplateReco::localError(), PixelCPEGeneric::localError(), and PixelTemplateSmearerBase::smearHit().

◆ localError()

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

Implements Topology.

Definition at line 288 of file RectangularPixelTopology.cc.

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 }

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 RectangularPixelTopology::localPosition ( const MeasurementPoint mp) const
overridevirtual

Implements Topology.

Definition at line 156 of file RectangularPixelTopology.cc.

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 }

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

◆ localX()

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

Implements PixelTopology.

Definition at line 196 of file RectangularPixelTopology.cc.

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 }

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 RectangularPixelTopology::localY ( const float  mpY) const
overridevirtual

Implements PixelTopology.

Definition at line 249 of file RectangularPixelTopology.cc.

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 }

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 RectangularPixelTopology::measurementError ( const LocalPoint lp,
const LocalError le 
) const
overridevirtual

Implements Topology.

Definition at line 304 of file RectangularPixelTopology.cc.

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 }

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 RectangularPixelTopology::measurementPosition ( const LocalPoint lp) const
inlineoverridevirtual

Implements Topology.

Definition at line 82 of file RectangularPixelTopology.h.

82  {
83  std::pair<float, float> p = pixel(lp);
84  return MeasurementPoint(p.first, p.second);
85  }

References AlCaHLTBitMon_ParallelJobs::p, and pixel().

Referenced by PixelTemplateSmearerBase::smearHit().

◆ ncolumns()

int RectangularPixelTopology::ncolumns ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 155 of file RectangularPixelTopology.h.

155 { return (m_ncols); }

References m_ncols.

Referenced by PixelCPEBase::setTheClu().

◆ nrows()

int RectangularPixelTopology::nrows ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 153 of file RectangularPixelTopology.h.

153 { return (m_nrows); }

References m_nrows.

Referenced by PixelCPEBase::setTheClu().

◆ pitch()

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

Implements PixelTopology.

Definition at line 151 of file RectangularPixelTopology.h.

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

References 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.

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 }

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

◆ rocsX()

int RectangularPixelTopology::rocsX ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 159 of file RectangularPixelTopology.h.

159 { return m_ROCS_X; }

References m_ROCS_X.

◆ rocsY()

int RectangularPixelTopology::rocsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 157 of file RectangularPixelTopology.h.

157 { return m_ROCS_Y; }

References m_ROCS_Y.

◆ rowsperroc()

int RectangularPixelTopology::rowsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 161 of file RectangularPixelTopology.h.

161 { return m_ROWS_PER_ROC; }

References m_ROWS_PER_ROC.

◆ xoffset()

float RectangularPixelTopology::xoffset ( ) const
inline

Definition at line 164 of file RectangularPixelTopology.h.

164 { return m_xoffset; }

References m_xoffset.

◆ yoffset()

float RectangularPixelTopology::yoffset ( ) const
inline

Definition at line 165 of file RectangularPixelTopology.h.

165 { return m_yoffset; }

References m_yoffset.

Member Data Documentation

◆ m_COLS_PER_ROC

int RectangularPixelTopology::m_COLS_PER_ROC
private

Definition at line 175 of file RectangularPixelTopology.h.

Referenced by colsperroc(), localY(), pixel(), 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 176 of file RectangularPixelTopology.h.

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

◆ m_ROCS_Y

int RectangularPixelTopology::m_ROCS_Y
private

Definition at line 177 of file RectangularPixelTopology.h.

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

◆ m_ROWS_PER_ROC

int RectangularPixelTopology::m_ROWS_PER_ROC
private

Definition at line 174 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
RectangularPixelTopology::m_nrows
int m_nrows
Definition: RectangularPixelTopology.h:172
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:105
RectangularPixelTopology::m_COLS_PER_ROC
int m_COLS_PER_ROC
Definition: RectangularPixelTopology.h:175
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
funct::false
false
Definition: Factorize.h:29
RectangularPixelTopology::m_yoffset
float m_yoffset
Definition: RectangularPixelTopology.h:171
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
RectangularPixelTopology::m_ROCS_X
int m_ROCS_X
Definition: RectangularPixelTopology.h:176
hcal_dqm_sourceclient-live_cfg.debugstr
debugstr
Definition: hcal_dqm_sourceclient-live_cfg.py:18
RectangularPixelTopology::m_ROWS_PER_ROC
int m_ROWS_PER_ROC
Definition: RectangularPixelTopology.h:174
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
RectangularPixelTopology::m_pitchx
float m_pitchx
Definition: RectangularPixelTopology.h:168
RectangularPixelTopology::isItBigPixelInY
bool isItBigPixelInY(const int iybin) const override
Definition: RectangularPixelTopology.h:118
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
PixelChannelIdentifier::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: PixelChannelIdentifier.h:65
RectangularPixelTopology::isItBigPixelInX
bool isItBigPixelInX(const int ixbin) const override
Definition: RectangularPixelTopology.h:114
LocalError::xx
float xx() const
Definition: LocalError.h:22
MeasurementError
Definition: MeasurementError.h:8
mps_fire.end
end
Definition: mps_fire.py:242
EPS
#define EPS
Definition: GammaContinuedFraction.cc:6
RectangularPixelTopology::nrows
int nrows() const override
Definition: RectangularPixelTopology.h:153
RectangularPixelTopology::isItEdgePixelInX
bool isItEdgePixelInX(int ixbin) const override
Definition: RectangularPixelTopology.h:143
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:233
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
RectangularPixelTopology::m_ROCS_Y
int m_ROCS_Y
Definition: RectangularPixelTopology.h:177
createfilelist.int
int
Definition: createfilelist.py:10
RectangularPixelTopology::pixel
std::pair< float, float > pixel(const LocalPoint &p) const override
Definition: RectangularPixelTopology.cc:13
RectangularPixelTopology::m_ncols
int m_ncols
Definition: RectangularPixelTopology.h:173
RectangularPixelTopology::m_upgradeGeometry
bool m_upgradeGeometry
Definition: RectangularPixelTopology.h:178
RectangularPixelTopology::m_xoffset
float m_xoffset
Definition: RectangularPixelTopology.h:170
RectangularPixelTopology::localY
float localY(const float mpY) const override
Definition: RectangularPixelTopology.cc:249
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
RectangularPixelTopology::localX
float localX(const float mpX) const override
Definition: RectangularPixelTopology.cc:196
RectangularPixelTopology::isItEdgePixelInY
bool isItEdgePixelInY(int iybin) const override
Definition: RectangularPixelTopology.h:144
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
RectangularPixelTopology::m_pitchy
float m_pitchy
Definition: RectangularPixelTopology.h:169
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
LocalError::yy
float yy() const
Definition: LocalError.h:24