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
 
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
 
 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
 
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 40 of file RectangularMTDTopology.h.

Constructor & Destructor Documentation

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 45 of file RectangularMTDTopology.h.

References localPosition(), 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.

52  : m_pitchx( pitchx ),
53  m_pitchy( pitchy ),
54  m_nrows( nrows ),
55  m_ncols( ncols ),
56  m_ROWS_PER_ROC( ROWS_PER_ROC ), // Num of Rows per ROC
57  m_COLS_PER_ROC( COLS_PER_ROC ), // Num of Cols per ROC
58  m_ROCS_X( ROCS_X ), // 2 for SLHC
59  m_ROCS_Y( ROCS_Y ), // 8 for SLHC
60  m_upgradeGeometry( upgradeGeometry )
61  {
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. *
66  m_pitchx;
67  m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y*m_ncols/COLS_PER_ROC)/2. *
68  m_pitchy;
69 
70  LogDebug("RectangularMTDTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx "
71  << m_pitchx << ", pitchy " << m_pitchy << ", xoffset "
72  << m_xoffset << ", yoffset " << m_yoffset << ", BIG_PIX_PER_ROC_X "
73  << BIG_PIX_PER_ROC_X << ", 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 << ", ROCS_Y " << ROCS_Y
75  << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y;
76  }
#define LogDebug(id)
int nrows() const override

Member Function Documentation

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

Implements Topology.

Definition at line 104 of file RectangularMTDTopology.h.

References localX(), localY(), pixel(), and PixelChannelIdentifier::pixelToChannel().

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

Implements PixelTopology.

Definition at line 185 of file RectangularMTDTopology.h.

References m_COLS_PER_ROC.

185  {
186  return m_COLS_PER_ROC;
187  }
bool RectangularMTDTopology::containsBigPixelInX ( int  ixmin,
int  ixmax 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 136 of file RectangularMTDTopology.h.

References m_upgradeGeometry.

136  {
137  return m_upgradeGeometry ? false :( (ixmin<=80) & (ixmax>=79) );
138  }
bool RectangularMTDTopology::containsBigPixelInY ( int  iymin,
int  iymax 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 139 of file RectangularMTDTopology.h.

References isItBigPixelInY(), and m_upgradeGeometry.

139  {
140  return m_upgradeGeometry ? false :
141  ( isItBigPixelInY( iymin ) || isItBigPixelInY( iymax ) || (iymin/52) != (iymax/52) )
142  ;
143  }
bool isItBigPixelInY(const int iybin) const override
bool RectangularMTDTopology::isItBigPixelInX ( const int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 119 of file RectangularMTDTopology.h.

References m_upgradeGeometry.

Referenced by localError().

119  {
120  return (( m_upgradeGeometry )?(false):(( ixbin == 79 ) | ( ixbin == 80 )));
121  }
bool RectangularMTDTopology::isItBigPixelInY ( const int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 123 of file RectangularMTDTopology.h.

References m_upgradeGeometry, and UNLIKELY.

Referenced by containsBigPixelInY(), and localError().

123  {
125  else {
126  int iybin0 = iybin%52;
127  return(( iybin0 == 0 ) | ( iybin0 == 51 ));
128  // constexpr int bigYIndeces[]{0,51,52,103,104,155,156,207,208,259,260,311,312,363,364,415,416,511};
129  // return *std::lower_bound(std::begin(bigYIndeces),std::end(bigYIndeces),iybin) == iybin;
130  }
131  }
return((rh^lh)&mask)
#define UNLIKELY(x)
bool RectangularMTDTopology::isItEdgePixel ( int  ixbin,
int  iybin 
) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 155 of file RectangularMTDTopology.h.

References isItEdgePixelInX(), and isItEdgePixelInY().

155  {
156  return ( isItEdgePixelInX( ixbin ) | isItEdgePixelInY( iybin ) );
157  }
bool isItEdgePixelInX(int ixbin) const override
bool isItEdgePixelInY(int iybin) const override
bool RectangularMTDTopology::isItEdgePixelInX ( int  ixbin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 149 of file RectangularMTDTopology.h.

References m_nrows.

Referenced by isItEdgePixel().

149  {
150  return ( (ixbin == 0) | (ixbin == (m_nrows-1)) );
151  }
bool RectangularMTDTopology::isItEdgePixelInY ( int  iybin) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 152 of file RectangularMTDTopology.h.

References m_ncols.

Referenced by isItEdgePixel().

152  {
153  return ( (iybin == 0) | (iybin == (m_ncols-1)) );
154  }
LocalError RectangularMTDTopology::localError ( const MeasurementPoint mp,
const MeasurementError me 
) const
overridevirtual

Implements Topology.

Definition at line 309 of file RectangularMTDTopology.cc.

References objects.autophobj::float, createfilelist::int, isItBigPixelInX(), isItBigPixelInY(), m_pitchx, m_pitchy, MeasurementError::uu(), MeasurementError::vv(), PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by measurementPosition().

311 {
312  float pitchy=m_pitchy;
313  int binoffy=int(mp.y());
314  if( isItBigPixelInY(binoffy) )pitchy = 2.*m_pitchy;
315 
316  float pitchx=m_pitchx;
317  int binoffx=int(mp.x());
318  if( isItBigPixelInX(binoffx) )pitchx = 2.*m_pitchx;
319 
320  return LocalError( me.uu()*float(pitchx*pitchx), 0,
321  me.vv()*float(pitchy*pitchy));
322 }
float vv() const
T y() const
Definition: PV2DBase.h:46
bool isItBigPixelInX(const int ixbin) const override
bool isItBigPixelInY(const int iybin) const override
float uu() const
T x() const
Definition: PV2DBase.h:45
LocalPoint RectangularMTDTopology::localPosition ( const MeasurementPoint mp) const
overridevirtual

Implements Topology.

Definition at line 166 of file RectangularMTDTopology.cc.

References EPS, objects.autophobj::float, localX(), localY(), LogDebug, m_ncols, m_nrows, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by RectangularMTDTopology().

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

Implements PixelTopology.

Definition at line 212 of file RectangularMTDTopology.cc.

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

Referenced by channel(), and localPosition().

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

Implements PixelTopology.

Definition at line 268 of file RectangularMTDTopology.cc.

References begin, constexpr, end, objects.autophobj::float, createfilelist::int, LogDebug, m_COLS_PER_ROC, m_pitchy, m_ROCS_Y, m_upgradeGeometry, m_yoffset, and UNLIKELY.

Referenced by channel(), and localPosition().

269 {
270  int binoffy = int( mpy ); // truncate to int
271  float fractionY = mpy - float(binoffy); // find the fraction
272  float local_pitchy = m_pitchy; // defaultpitch
273 
275  #ifdef EDM_ML_DEBUG
276  if( binoffy > m_ROCS_Y * m_COLS_PER_ROC ) // too large
277  {
278  LogDebug( "RectangularMTDTopology" ) << " very bad, biny " << binoffy << "\n"
279  << mpy << " " << binoffy << " " << fractionY
280  << " " << local_pitchy << " " << m_yoffset;
281  }
282 #endif
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) local_pitchy *= 2 ;
287  binoffy += (j-bigYIndeces);
288  }
289 
290  // The final position in local coordinates
291  float lpY = float(binoffy*m_pitchy) + fractionY*local_pitchy + m_yoffset;
292 
293 #ifdef EDM_ML_DEBUG
294 
295  if( lpY < m_yoffset || lpY > ( -m_yoffset ))
296  {
297  LogDebug( "RectangularMTDTopology" ) << " bad lp y " << lpY << "\n"
298  << mpy << " " << binoffy << " "
299  << fractionY << " " << local_pitchy << " " << m_yoffset;
300  }
301 #endif // EDM_ML_DEBUG
302 
303  return lpY;
304 }
#define LogDebug(id)
#define constexpr
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
#define UNLIKELY(x)
MeasurementError RectangularMTDTopology::measurementError ( const LocalPoint lp,
const LocalError le 
) const
overridevirtual

Implements Topology.

Definition at line 327 of file RectangularMTDTopology.cc.

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

Referenced by measurementPosition().

329 {
330  float pitchy=m_pitchy;
331  float pitchx=m_pitchx;
332 
333  if LIKELY( !m_upgradeGeometry ) {
334  int iybin = int( (lp.y() - m_yoffset)/m_pitchy ); //get bin for equal picth
335  int iybin0 = iybin%54; //This is just to avoid many ifs by using the periodicy
336  //quasi bins 0,1,52,53 fall into larger pixels
337  if( (iybin0<=1) | (iybin0>=52) )
338  pitchy = 2.f * m_pitchy;
339 
340  int ixbin = int( (lp.x() - m_xoffset)/m_pitchx ); //get bin for equal pitch
341  //quasi bins 79,80,81,82 fall into the 2 larger pixels
342  if( (ixbin>=79) & (ixbin<=82) ) pitchx = 2.f * m_pitchx;
343  }
344 
345  return MeasurementError( le.xx()/float(pitchx*pitchx), 0,
346  le.yy()/float(pitchy*pitchy));
347 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
float yy() const
Definition: LocalError.h:26
#define LIKELY(x)
T x() const
Definition: PV3DBase.h:62
MeasurementPoint RectangularMTDTopology::measurementPosition ( const LocalPoint lp) const
inlineoverridevirtual

Implements Topology.

Definition at line 83 of file RectangularMTDTopology.h.

References localError(), measurementError(), AlCaHLTBitMon_ParallelJobs::p, and pixel().

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

Implements PixelTopology.

Definition at line 169 of file RectangularMTDTopology.h.

References m_ncols.

169  {
170  return ( m_ncols );
171  }
int RectangularMTDTopology::nrows ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 165 of file RectangularMTDTopology.h.

References m_nrows.

165  {
166  return ( m_nrows );
167  }
std::pair<float,float> RectangularMTDTopology::pitch ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 161 of file RectangularMTDTopology.h.

References objects.autophobj::float, m_pitchx, and m_pitchy.

161  {
162  return std::pair<float,float>( float(m_pitchx), float(m_pitchy));
163  }
std::pair< float, float > RectangularMTDTopology::pixel ( const LocalPoint p) const
overridevirtual

Topology for rectangular pixel detector with BIG pixels.

Implements PixelTopology.

Definition at line 14 of file RectangularMTDTopology.cc.

References EPSCM, objects.autophobj::float, createfilelist::int, LogDebug, m_COLS_PER_ROC, m_pitchx, m_pitchy, m_upgradeGeometry, m_xoffset, m_yoffset, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by channel(), and measurementPosition().

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

Implements PixelTopology.

Definition at line 177 of file RectangularMTDTopology.h.

References m_ROCS_X.

177  {
178  return m_ROCS_X;
179  }
int RectangularMTDTopology::rocsY ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 173 of file RectangularMTDTopology.h.

References m_ROCS_Y.

173  {
174  return m_ROCS_Y;
175  }
int RectangularMTDTopology::rowsperroc ( ) const
inlineoverridevirtual

Implements PixelTopology.

Definition at line 181 of file RectangularMTDTopology.h.

References m_ROWS_PER_ROC.

181  {
182  return m_ROWS_PER_ROC;
183  }
float RectangularMTDTopology::xoffset ( ) const
inline

Definition at line 188 of file RectangularMTDTopology.h.

References m_xoffset.

188  {
189  return m_xoffset;
190  }
float RectangularMTDTopology::yoffset ( ) const
inline

Definition at line 191 of file RectangularMTDTopology.h.

References m_yoffset.

191  {
192  return m_yoffset;
193  }

Member Data Documentation

int RectangularMTDTopology::m_COLS_PER_ROC
private

Definition at line 205 of file RectangularMTDTopology.h.

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

int RectangularMTDTopology::m_ncols
private
int RectangularMTDTopology::m_nrows
private
float RectangularMTDTopology::m_pitchx
private
float RectangularMTDTopology::m_pitchy
private
int RectangularMTDTopology::m_ROCS_X
private

Definition at line 206 of file RectangularMTDTopology.h.

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

int RectangularMTDTopology::m_ROCS_Y
private

Definition at line 207 of file RectangularMTDTopology.h.

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

int RectangularMTDTopology::m_ROWS_PER_ROC
private

Definition at line 204 of file RectangularMTDTopology.h.

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

bool RectangularMTDTopology::m_upgradeGeometry
private
float RectangularMTDTopology::m_xoffset
private
float RectangularMTDTopology::m_yoffset
private