CMS 3D CMS Logo

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

#include <RectangularPixelPhase2Topology.h>

Inheritance diagram for RectangularPixelPhase2Topology:
PixelTopology Topology

Public Member Functions

bool bigpixelsX () const override
 
bool bigpixelsY () const override
 
int bigpixperrocX () const
 
int bigpixperrocY () const
 
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
 
float pitchbigpixelX () const
 
float pitchbigpixelY () const
 
std::pair< float, float > pixel (const LocalPoint &p) const override
 
float pixelFractionInX (const int ixbin) const override
 
float pixelFractionInY (const int iybin) const override
 
 RectangularPixelPhase2Topology (int nrows, int ncols, float pitchx, float pitchy, int ROWS_PER_ROC, int COLS_PER_ROC, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y, float BIG_PIX_PITCH_X, float BIG_PIX_PITCH_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 Member Functions

bool containsBigPixel (int iMin, int iMax, int nPxTot, int nPxBigPerROC) const
 

Private Attributes

int m_BIG_PIX_PER_ROC_X
 
int m_BIG_PIX_PER_ROC_Y
 
float m_BIG_PIX_PITCH_X
 
float m_BIG_PIX_PITCH_Y
 
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
 
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 26 of file RectangularPixelPhase2Topology.h.

Constructor & Destructor Documentation

◆ RectangularPixelPhase2Topology()

RectangularPixelPhase2Topology::RectangularPixelPhase2Topology ( int  nrows,
int  ncols,
float  pitchx,
float  pitchy,
int  ROWS_PER_ROC,
int  COLS_PER_ROC,
int  BIG_PIX_PER_ROC_X,
int  BIG_PIX_PER_ROC_Y,
float  BIG_PIX_PITCH_X,
float  BIG_PIX_PITCH_Y,
int  ROCS_X,
int  ROCS_Y 
)
inline

Definition at line 29 of file RectangularPixelPhase2Topology.h.

References LogDebug, m_BIG_PIX_PER_ROC_X, m_BIG_PIX_PER_ROC_Y, m_BIG_PIX_PITCH_X, m_BIG_PIX_PITCH_Y, 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.

41  : m_pitchx(pitchx),
42  m_pitchy(pitchy),
43  m_nrows(nrows),
44  m_ncols(ncols),
45  m_ROWS_PER_ROC(ROWS_PER_ROC), // Num of Rows per ROC
46  m_COLS_PER_ROC(COLS_PER_ROC), // Num of Cols per ROC
47  m_BIG_PIX_PER_ROC_X(BIG_PIX_PER_ROC_X), //
48  m_BIG_PIX_PER_ROC_Y(BIG_PIX_PER_ROC_Y), //
49  m_BIG_PIX_PITCH_X(BIG_PIX_PITCH_X),
50  m_BIG_PIX_PITCH_Y(BIG_PIX_PITCH_Y),
51  m_ROCS_X(ROCS_X), //
52  m_ROCS_Y(ROCS_Y) //
53  {
54  // Calculate the edge of the active sensor with respect to the center,
55  // that is simply the half-size.
56  // Take into account large pixels
57  m_xoffset = -(
60  m_BIG_PIX_PITCH_X); // assuming the big pixel pitch is well computed it gets always in the middle regardless the number of big pixel. Quad is 670*0.025 + 2*0.0875; double is 336* 0.025; 3D is 336*0.025; old geom is 672*faxe x pitch
62 
63  LogDebug("RectangularPixelPhase2Topology")
64  << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx " << m_pitchx << ", pitchy " << m_pitchy
65  << ", xoffset " << m_xoffset << ", yoffset " << m_yoffset << ", BIG_PIX_PER_ROC_X " << BIG_PIX_PER_ROC_X
66  << ", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y << ", BIG_PIX_PITCH_X " << BIG_PIX_PITCH_X
67  << ", BIG_PIX_PITCH_Y " << BIG_PIX_PITCH_Y << ", ROWS_PER_ROC " << ROWS_PER_ROC << ", COLS_PER_ROC "
68  << COLS_PER_ROC << ", ROCS_X " << ROCS_X << ", ROCS_Y " << ROCS_Y << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X
69  << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y;
70  }
#define LogDebug(id)

Member Function Documentation

◆ bigpixelsX()

bool RectangularPixelPhase2Topology::bigpixelsX ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 165 of file RectangularPixelPhase2Topology.h.

165 { return false; }

◆ bigpixelsY()

bool RectangularPixelPhase2Topology::bigpixelsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 166 of file RectangularPixelPhase2Topology.h.

166 { return false; }

◆ bigpixperrocX()

int RectangularPixelPhase2Topology::bigpixperrocX ( ) const
inline

◆ bigpixperrocY()

int RectangularPixelPhase2Topology::bigpixperrocY ( ) const
inline

◆ channel()

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

Implements Topology.

Definition at line 95 of file RectangularPixelPhase2Topology.h.

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

95  {
96  std::pair<float, float> p = pixel(lp);
97  return PixelChannelIdentifier::pixelToChannel(int(p.first), int(p.second));
98  }
std::pair< float, float > pixel(const LocalPoint &p) const override
static int pixelToChannel(int row, int col)

◆ colsperroc()

int RectangularPixelPhase2Topology::colsperroc ( ) const
inlineoverridevirtual

◆ containsBigPixel()

bool RectangularPixelPhase2Topology::containsBigPixel ( int  iMin,
int  iMax,
int  nPxTot,
int  nPxBigPerROC 
) const
inlineprivate

Definition at line 215 of file RectangularPixelPhase2Topology.h.

Referenced by containsBigPixelInX(), and containsBigPixelInY().

215  {
216  // nPxTot/2 should lie in the upper half of the dimension
217  auto firstBigPixel = nPxTot / 2 - nPxBigPerROC;
218  auto lastBigPixel = nPxTot / 2 - 1 + nPxBigPerROC;
219 
220  // the interval contains no big pixel when either of the following is met:
221  // - there are no big pixels
222  // - the whole interval lies to the right of the big pixel chunk
223  // - the whole interval lies to the left of the big pixel chunk
224  bool noBigPixel = (nPxBigPerROC == 0) || (iMin > lastBigPixel) || (iMax < firstBigPixel);
225 
226  return !noBigPixel;
227  }

◆ containsBigPixelInX()

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

Implements PixelTopology.

Definition at line 157 of file RectangularPixelPhase2Topology.h.

References containsBigPixel(), m_BIG_PIX_PER_ROC_X, and m_nrows.

157  {
158  return containsBigPixel(ixmin, ixmax, m_nrows, m_BIG_PIX_PER_ROC_X);
159  }
bool containsBigPixel(int iMin, int iMax, int nPxTot, int nPxBigPerROC) const

◆ containsBigPixelInY()

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

Implements PixelTopology.

Definition at line 161 of file RectangularPixelPhase2Topology.h.

References containsBigPixel(), m_BIG_PIX_PER_ROC_Y, and m_ncols.

161  {
162  return containsBigPixel(iymin, iymax, m_ncols, m_BIG_PIX_PER_ROC_Y);
163  }
bool containsBigPixel(int iMin, int iMax, int nPxTot, int nPxBigPerROC) const

◆ isItBigPixelInX()

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

Implements PixelTopology.

Definition at line 109 of file RectangularPixelPhase2Topology.h.

References funct::abs(), m_BIG_PIX_PER_ROC_X, and m_nrows.

Referenced by localError().

109  {
110  bool no_big_pixel = (m_BIG_PIX_PER_ROC_X == 0);
111  if (!no_big_pixel)
112  no_big_pixel = std::abs((ixbin - m_nrows / 2) + 0.5) > m_BIG_PIX_PER_ROC_X;
113 
114  return !no_big_pixel;
115  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isItBigPixelInY()

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

Implements PixelTopology.

Definition at line 117 of file RectangularPixelPhase2Topology.h.

References funct::abs(), m_BIG_PIX_PER_ROC_Y, and m_ncols.

Referenced by localError().

117  {
118  bool no_big_pixel = (m_BIG_PIX_PER_ROC_Y == 0);
119  if (!no_big_pixel)
120  no_big_pixel = std::abs((iybin - m_ncols / 2) + 0.5) > m_BIG_PIX_PER_ROC_Y;
121 
122  return !no_big_pixel;
123  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isItEdgePixel()

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

Implements PixelTopology.

Definition at line 173 of file RectangularPixelPhase2Topology.h.

References isItEdgePixelInX(), and isItEdgePixelInY().

173  {
174  return (isItEdgePixelInX(ixbin) || isItEdgePixelInY(iybin));
175  }
bool isItEdgePixelInX(int ixbin) const override
bool isItEdgePixelInY(int iybin) const override

◆ isItEdgePixelInX()

bool RectangularPixelPhase2Topology::isItEdgePixelInX ( int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 171 of file RectangularPixelPhase2Topology.h.

References m_nrows.

Referenced by isItEdgePixel().

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

◆ isItEdgePixelInY()

bool RectangularPixelPhase2Topology::isItEdgePixelInY ( int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 172 of file RectangularPixelPhase2Topology.h.

References m_ncols.

Referenced by isItEdgePixel().

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

◆ localError()

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

Implements Topology.

Definition at line 281 of file RectangularPixelPhase2Topology.cc.

References nano_mu_digi_cff::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().

281  {
282  float pitchy = m_pitchy;
283  int binoffy = int(mp.y());
284  if (isItBigPixelInY(binoffy))
285  pitchy = 2. * m_pitchy;
286 
287  float pitchx = m_pitchx;
288  int binoffx = int(mp.x());
289  if (isItBigPixelInX(binoffx))
290  pitchx = 2. * m_pitchx;
291 
292  return LocalError(me.uu() * float(pitchx * pitchx), 0, me.vv() * float(pitchy * pitchy));
293 }
bool isItBigPixelInY(const int iybin) const override
T x() const
Definition: PV2DBase.h:43
T y() const
Definition: PV2DBase.h:44
bool isItBigPixelInX(const int ixbin) const override

◆ localPosition()

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

Implements Topology.

Definition at line 157 of file RectangularPixelPhase2Topology.cc.

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

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

◆ localX()

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

Implements PixelTopology.

Definition at line 197 of file RectangularPixelPhase2Topology.cc.

References nano_mu_digi_cff::float, createfilelist::int, LogDebug, m_BIG_PIX_PITCH_X, m_nrows, m_pitchx, m_ROCS_X, m_ROWS_PER_ROC, and m_xoffset.

Referenced by localPosition().

197  {
198  int binoffx = int(mpx); // truncate to int
199  float fractionX = mpx - float(binoffx); // find the fraction
200  float local_pitchx = m_pitchx; // defaultpitch
201  int ispix_secondhalf_x = 0;
202 
203  if (binoffx >= (m_nrows / 2 - 2 + 2 * m_nrows / m_ROWS_PER_ROC)) { // ROC 1 - handles x on edge cluster
204  binoffx = binoffx - 2 * m_nrows / m_ROWS_PER_ROC;
205  ispix_secondhalf_x = 1;
206  } else if (((m_nrows / 2 - 2) <= binoffx) && (binoffx < (m_nrows / 2 - 2 + 2 * m_nrows / m_ROWS_PER_ROC))) { // ROC 1
207  binoffx = m_nrows / 2 - 2;
208  fractionX = mpx - float(m_nrows / 2 - 2);
209  local_pitchx = m_BIG_PIX_PITCH_X;
210  }
211 
212 #ifdef EDM_ML_DEBUG
213  if (binoffx > m_ROWS_PER_ROC * m_ROCS_X) // too large
214  {
215  LogDebug("RectangularPixelPhase2Topology")
216  << " very bad, binx " << binoffx << "\n"
217  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " " << m_xoffset << "\n";
218  }
219 #endif
220 
221  // The final position in local coordinates
222  float lpX = float(binoffx * m_pitchx) + fractionX * local_pitchx +
223  ispix_secondhalf_x * 2 * m_BIG_PIX_PITCH_X * m_nrows / m_ROWS_PER_ROC + m_xoffset;
224 
225 #ifdef EDM_ML_DEBUG
226 
227  if (lpX < m_xoffset || lpX > (-m_xoffset)) {
228  LogDebug("RectangularPixelPhase2Topology")
229  << " bad lp x " << lpX << "\n"
230  << mpx << " " << binoffx << " " << fractionX << " " << local_pitchx << " " << m_xoffset;
231  }
232 #endif // EDM_ML_DEBUG
233 
234  return lpX;
235 }
#define LogDebug(id)

◆ localY()

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

Implements PixelTopology.

Definition at line 239 of file RectangularPixelPhase2Topology.cc.

References nano_mu_digi_cff::float, createfilelist::int, LogDebug, m_BIG_PIX_PITCH_Y, m_COLS_PER_ROC, m_ncols, m_pitchy, m_ROCS_Y, and m_yoffset.

Referenced by localPosition().

239  {
240  int binoffy = int(mpy); // truncate to int
241  float fractionY = mpy - float(binoffy); // find the fraction
242  float local_pitchy = m_pitchy; // defaultpitch
243  int ispix_secondhalf_y = 0;
244 
245  if (binoffy >= (m_ncols / 2 - 1 + m_ncols / m_COLS_PER_ROC)) { // ROC 1 - handles x on edge cluster
246  binoffy = binoffy - m_ncols / m_COLS_PER_ROC;
247  ispix_secondhalf_y = 1;
248  } else if (((m_ncols / 2 - 1) <= binoffy) && (binoffy < (m_ncols / 2 - 1 + m_ncols / m_COLS_PER_ROC))) { // ROC 1
249  binoffy = m_ncols / 2 - 1;
250  fractionY = mpy - float(m_ncols / 2 - 1);
251  local_pitchy = m_BIG_PIX_PITCH_Y;
252  }
253 
254 #ifdef EDM_ML_DEBUG
255  if (binoffy > m_ROCS_Y * m_COLS_PER_ROC) // too large
256  {
257  LogDebug("RectangularPixelPhase2Topology")
258  << " very bad, biny " << binoffy << "\n"
259  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " " << m_yoffset;
260  }
261 #endif
262 
263  // The final position in local coordinates // using an int to switch first or second half of the module.
264  float lpY = float(binoffy * m_pitchy) + fractionY * local_pitchy +
265  ispix_secondhalf_y * m_BIG_PIX_PITCH_Y * m_ncols / m_COLS_PER_ROC + m_yoffset;
266 
267 #ifdef EDM_ML_DEBUG
268 
269  if (lpY < m_yoffset || lpY > (-m_yoffset)) {
270  LogDebug("RectangularPixelPhase2Topology")
271  << " bad lp y " << lpY << "\n"
272  << mpy << " " << binoffy << " " << fractionY << " " << local_pitchy << " " << m_yoffset;
273  }
274 #endif // EDM_ML_DEBUG
275 
276  return lpY;
277 }
#define LogDebug(id)

◆ measurementError()

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

Implements Topology.

Definition at line 297 of file RectangularPixelPhase2Topology.cc.

References nano_mu_digi_cff::float, m_pitchx, m_pitchy, LocalError::xx(), and LocalError::yy().

297  {
298  float pitchy = m_pitchy;
299  float pitchx = m_pitchx;
300 
301  return MeasurementError(le.xx() / float(pitchx * pitchx), 0, le.yy() / float(pitchy * pitchy));
302 }
float yy() const
Definition: LocalError.h:24
float xx() const
Definition: LocalError.h:22

◆ measurementPosition()

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

Implements Topology.

Definition at line 77 of file RectangularPixelPhase2Topology.h.

References AlCaHLTBitMon_ParallelJobs::p, and pixel().

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

◆ ncolumns()

int RectangularPixelPhase2Topology::ncolumns ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 183 of file RectangularPixelPhase2Topology.h.

References m_ncols.

◆ nrows()

int RectangularPixelPhase2Topology::nrows ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 181 of file RectangularPixelPhase2Topology.h.

References m_nrows.

◆ pitch()

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

◆ pitchbigpixelX()

float RectangularPixelPhase2Topology::pitchbigpixelX ( ) const
inline

◆ pitchbigpixelY()

float RectangularPixelPhase2Topology::pitchbigpixelY ( ) const
inline

◆ pixel()

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

Topology for rectangular pixel detector with BIG pixels.

Implements PixelTopology.

Definition at line 13 of file RectangularPixelPhase2Topology.cc.

References hcal_dqm_sourceclient-live_cfg::debugstr, createfilelist::int, LogDebug, m_BIG_PIX_PER_ROC_X, m_BIG_PIX_PER_ROC_Y, m_BIG_PIX_PITCH_X, m_BIG_PIX_PITCH_Y, m_COLS_PER_ROC, m_ncols, m_nrows, m_pitchx, m_pitchy, m_ROWS_PER_ROC, 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("RectangularPixelPhase2Topology") << debugstr.str();
49 #endif // EDM_ML_DEBUG
50 
51  float newybin = py - m_yoffset; // m_pitchy;
52  int iybin = 0; //int(newybin);
53  float fractionY = 0; //newybin - iybin;
54  int iybin0 = 0;
55  float mpY = 0.;
56 
57  if ((newybin >= m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y)) &&
58  (newybin < (m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y) +
60  iybin = m_ncols / 2 - m_BIG_PIX_PER_ROC_Y;
61  iybin0 = iybin;
62  fractionY = (newybin - m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y)) / m_BIG_PIX_PITCH_Y;
63  } else if ((newybin >= (m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y) +
65  iybin = int((newybin - (m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y) +
67  m_pitchy) +
69  iybin0 = iybin - m_ncols / 2;
70  fractionY = (newybin - (m_pitchy * (m_ncols / 2 - m_BIG_PIX_PER_ROC_Y) +
72  (iybin0 - m_BIG_PIX_PER_ROC_Y) * m_pitchy)) /
73  m_pitchy;
74  } else {
75  iybin = int(newybin / m_pitchy);
76  iybin0 = iybin;
77  fractionY = newybin / m_pitchy - iybin;
78  }
79 
80  mpY = fractionY + iybin;
81 #ifdef EDM_ML_DEBUG
82 
83  if (iybin0 > m_COLS_PER_ROC) {
84  LogDebug("RectangularPixelPhase2Topology") << " very bad, newbiny " << iybin0 << "\n"
85  << py << " " << m_yoffset << " " << m_pitchy << " " << newybin << " "
86  << iybin << " " << fractionY << " " << iybin0 << " " << m_COLS_PER_ROC;
87  }
88 #endif // EDM_ML_DEBUG
89 
90 #ifdef EDM_ML_DEBUG
91 
92  if (mpY < 0. || mpY >= 2 * m_COLS_PER_ROC) {
93  LogDebug("RectangularPixelPhase2Topology")
94  << " bad pix y " << mpY << "\n"
95  << py << " " << m_yoffset << " " << m_pitchy << " " << newybin << " " << iybin << " " << fractionY << " "
96  << iybin0 << " " << 2 * m_COLS_PER_ROC;
97  }
98 #endif // EDM_ML_DEBUG
99 
100  // In X
101  float newxbin = (px - m_xoffset);
102  int ixbin = 0;
103  float fractionX = 0;
104  int ixbin0 = 0;
105  float mpX = 0.;
106 
107  if ((newxbin >= m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X)) &&
108  (newxbin < (m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X) +
110  ixbin = m_nrows / 2 - m_BIG_PIX_PER_ROC_X;
111  ixbin0 = ixbin;
112  fractionX = (newxbin - m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X)) / m_BIG_PIX_PITCH_X;
113  } else if ((newxbin >= (m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X) +
115  ixbin = int((newxbin - (m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X) +
117  m_pitchx) +
119  ixbin0 = ixbin - m_nrows / 2;
120  fractionX = (newxbin - (m_pitchx * (m_nrows / 2 - m_BIG_PIX_PER_ROC_X) +
122  (ixbin0 - m_BIG_PIX_PER_ROC_X) * m_pitchx)) /
123  m_pitchx;
124  } else {
125  ixbin = int(newxbin / m_pitchx);
126  ixbin0 = ixbin;
127  fractionX = newxbin / m_pitchx - ixbin;
128  }
129 
130  mpX = fractionX + ixbin;
131 
132 #ifdef EDM_ML_DEBUG
133 
134  if (ixbin0 > m_ROWS_PER_ROC || ixbin0 < 0) // ixbin < 0 outside range
135  {
136  LogDebug("RectangularPixelPhase2Topology")
137  << " very bad, newbinx " << ixbin << "\n"
138  << px << " " << m_xoffset << " " << m_pitchx << " " << newxbin << " " << ixbin << " " << fractionX;
139  }
140 #endif // EDM_ML_DEBUG
141 
142 #ifdef EDM_ML_DEBUG
143 
144  if (mpX < 0. || mpX >= 2 * m_ROWS_PER_ROC) {
145  LogDebug("RectangularPixelPhase2Topology")
146  << " bad pix x " << mpX << "\n"
147  << px << " " << m_xoffset << " " << m_pitchx << " " << newxbin << " " << ixbin << " " << fractionX;
148  }
149 #endif // EDM_ML_DEBUG
150 
151  return std::pair<float, float>(mpX, mpY);
152 }
#define LogDebug(id)

◆ pixelFractionInX()

float RectangularPixelPhase2Topology::pixelFractionInX ( const int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 125 of file RectangularPixelPhase2Topology.h.

References nano_mu_digi_cff::float, m_BIG_PIX_PER_ROC_X, m_BIG_PIX_PITCH_X, m_nrows, m_pitchx, and m_ROWS_PER_ROC.

125  {
126  bool no_big_pixel = (m_BIG_PIX_PER_ROC_X == 0);
127 
128  if (no_big_pixel) {
129  return 1.0f;
130  } else {
131  if (((m_nrows / 2 - m_BIG_PIX_PER_ROC_X) <= ixbin) &&
133  return float(m_BIG_PIX_PITCH_X / m_pitchx);
134  } else {
135  return 1.0f;
136  }
137  }
138  }

◆ pixelFractionInY()

float RectangularPixelPhase2Topology::pixelFractionInY ( const int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 140 of file RectangularPixelPhase2Topology.h.

References nano_mu_digi_cff::float, m_BIG_PIX_PER_ROC_Y, m_BIG_PIX_PITCH_Y, m_COLS_PER_ROC, m_ncols, and m_pitchy.

140  {
141  bool no_big_pixel = (m_BIG_PIX_PER_ROC_Y == 0);
142  if (no_big_pixel) {
143  return 1.0f;
144  } else {
145  if (((m_ncols / 2 - m_BIG_PIX_PER_ROC_Y) <= iybin) &&
147  return float(m_BIG_PIX_PITCH_Y / m_pitchy);
148  } else {
149  return 1.0f;
150  }
151  }
152  }

◆ rocsX()

int RectangularPixelPhase2Topology::rocsX ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 187 of file RectangularPixelPhase2Topology.h.

References m_ROCS_X.

◆ rocsY()

int RectangularPixelPhase2Topology::rocsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 185 of file RectangularPixelPhase2Topology.h.

References m_ROCS_Y.

◆ rowsperroc()

int RectangularPixelPhase2Topology::rowsperroc ( ) const
inlineoverridevirtual

◆ xoffset()

float RectangularPixelPhase2Topology::xoffset ( ) const
inline

Definition at line 194 of file RectangularPixelPhase2Topology.h.

References m_xoffset.

◆ yoffset()

float RectangularPixelPhase2Topology::yoffset ( ) const
inline

Definition at line 195 of file RectangularPixelPhase2Topology.h.

References m_yoffset.

Member Data Documentation

◆ m_BIG_PIX_PER_ROC_X

int RectangularPixelPhase2Topology::m_BIG_PIX_PER_ROC_X
private

◆ m_BIG_PIX_PER_ROC_Y

int RectangularPixelPhase2Topology::m_BIG_PIX_PER_ROC_Y
private

◆ m_BIG_PIX_PITCH_X

float RectangularPixelPhase2Topology::m_BIG_PIX_PITCH_X
private

◆ m_BIG_PIX_PITCH_Y

float RectangularPixelPhase2Topology::m_BIG_PIX_PITCH_Y
private

◆ m_COLS_PER_ROC

int RectangularPixelPhase2Topology::m_COLS_PER_ROC
private

◆ m_ncols

int RectangularPixelPhase2Topology::m_ncols
private

◆ m_nrows

int RectangularPixelPhase2Topology::m_nrows
private

◆ m_pitchx

float RectangularPixelPhase2Topology::m_pitchx
private

◆ m_pitchy

float RectangularPixelPhase2Topology::m_pitchy
private

◆ m_ROCS_X

int RectangularPixelPhase2Topology::m_ROCS_X
private

Definition at line 212 of file RectangularPixelPhase2Topology.h.

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

◆ m_ROCS_Y

int RectangularPixelPhase2Topology::m_ROCS_Y
private

Definition at line 213 of file RectangularPixelPhase2Topology.h.

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

◆ m_ROWS_PER_ROC

int RectangularPixelPhase2Topology::m_ROWS_PER_ROC
private

◆ m_xoffset

float RectangularPixelPhase2Topology::m_xoffset
private

◆ m_yoffset

float RectangularPixelPhase2Topology::m_yoffset
private