CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
RectangularPixelTopology Class Reference

#include <RectangularPixelTopology.h>

Inheritance diagram for RectangularPixelTopology:
PixelTopology Topology

Public Member Functions

virtual int channel (const LocalPoint &lp) const
 
bool containsBigPixelInX (const int &ixmin, const int &ixmax) const
 
bool containsBigPixelInY (const int &iymin, const int &iymax) const
 
virtual bool isItBigPixelInX (const int ixbin) const
 
virtual bool isItBigPixelInY (const int iybin) const
 
bool isItEdgePixel (int ixbin, int iybin) const
 
bool isItEdgePixelInX (int ixbin) const
 
bool isItEdgePixelInY (int iybin) const
 
virtual LocalError localError (const MeasurementPoint &, const MeasurementError &) const
 
virtual LocalPoint localPosition (const MeasurementPoint &mp) const
 
virtual float localX (const float mpX) const
 
virtual float localY (const float mpY) const
 
virtual MeasurementError measurementError (const LocalPoint &, const LocalError &) const
 
virtual MeasurementPoint measurementPosition (const LocalPoint &lp) const
 
virtual int ncolumns () const
 
virtual int nrows () const
 
virtual std::pair< float, float > pitch () const
 
virtual std::pair< float, float > pixel (const LocalPoint &p) const
 
 RectangularPixelTopology (int nrows, int ncols, float pitchx, float pitchy)
 
- 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...
 
virtual ~PixelTopology ()
 
- 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_ncols
 
int m_nrows
 
float m_pitchx
 
float m_pitchy
 
float m_xoffset
 
float m_yoffset
 

Static Private Attributes

static const int BIG_PIX_PER_ROC_X = 1
 
static const int BIG_PIX_PER_ROC_Y = 2
 
static const int COLS_PER_ROC = 52
 
static const int ROWS_PER_ROC = 80
 

Additional Inherited Members

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

Detailed Description

Definition at line 46 of file RectangularPixelTopology.h.

Constructor & Destructor Documentation

RectangularPixelTopology::RectangularPixelTopology ( int  nrows,
int  ncols,
float  pitchx,
float  pitchy 
)
inline

Definition at line 57 of file RectangularPixelTopology.h.

References BIG_PIX_PER_ROC_X, BIG_PIX_PER_ROC_Y, COLS_PER_ROC, gather_cfg::cout, m_ncols, m_nrows, m_pitchx, m_pitchy, m_xoffset, m_yoffset, ROWS_PER_ROC, and TP_DEBUG.

58  :
59  m_nrows(nrows), m_ncols(ncols),
60  m_pitchx(pitchx), m_pitchy(pitchy) {
61 
62  //using std::cout;
63  //using std::endl;
64 
65  // Calculate the edge of the active sensor with respect to the center,
66  // that is simply the half-size.
67  // Take into account large pixels
69  m_pitchx;
71  m_pitchy;
72 
73  if(TP_DEBUG) std::cout<<" RectangularPixelTopology: "
74  <<m_nrows<<" "<<m_ncols<<" "
75  <<m_pitchx<<" "<<m_pitchy<<" "<<m_xoffset<<" "<<m_yoffset
77  <<ROWS_PER_ROC<<" "<<COLS_PER_ROC<<std::endl;
78  }
#define TP_DEBUG
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

virtual int RectangularPixelTopology::channel ( const LocalPoint lp) const
inlinevirtual

Implements Topology.

Definition at line 105 of file RectangularPixelTopology.h.

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

105  {
106  std::pair<float,float> p = pixel(lp);
107  return PixelChannelIdentifier::pixelToChannel( int(p.first),
108  int(p.second));
109  }
virtual std::pair< float, float > pixel(const LocalPoint &p) const
static int pixelToChannel(int row, int col)
bool RectangularPixelTopology::containsBigPixelInX ( const int &  ixmin,
const int &  ixmax 
) const
virtual

Implements PixelTopology.

Definition at line 516 of file RectangularPixelTopology.cc.

References i, and isItBigPixelInX().

516  {
517  bool big = false;
518  for(int i=ixmin; i!=ixmax+1; i++) {
519  if(isItBigPixelInX(i) && big==false) big=true;
520  }
521  return big;
522 }
int i
Definition: DBlmapReader.cc:9
Definition: big.h:6
virtual bool isItBigPixelInX(const int ixbin) const
bool RectangularPixelTopology::containsBigPixelInY ( const int &  iymin,
const int &  iymax 
) const
virtual

Implements PixelTopology.

Definition at line 524 of file RectangularPixelTopology.cc.

References i, and isItBigPixelInY().

524  {
525  bool big = false;
526  for(int i=iymin; i!=iymax+1; i++) {
527  if(isItBigPixelInY(i) && big==false) big=true;
528  }
529  return big;
530 }
int i
Definition: DBlmapReader.cc:9
virtual bool isItBigPixelInY(const int iybin) const
Definition: big.h:6
virtual bool RectangularPixelTopology::isItBigPixelInX ( const int  ixbin) const
inlinevirtual

Implements PixelTopology.

Definition at line 119 of file RectangularPixelTopology.h.

Referenced by containsBigPixelInX(), and localError().

119  {
120  return ( (ixbin == 79) || (ixbin == 80));
121  }
virtual bool RectangularPixelTopology::isItBigPixelInY ( const int  iybin) const
inlinevirtual

Implements PixelTopology.

Definition at line 122 of file RectangularPixelTopology.h.

Referenced by containsBigPixelInY(), and localError().

122  {
123  int iybin0 = iybin%52;
124  return ( (iybin0 == 0) || (iybin0 == 51));
125  }
bool RectangularPixelTopology::isItEdgePixel ( int  ixbin,
int  iybin 
) const
inlinevirtual

Implements PixelTopology.

Definition at line 140 of file RectangularPixelTopology.h.

References isItEdgePixelInX(), and isItEdgePixelInY().

140  {
141  return ( isItEdgePixelInX( ixbin ) || isItEdgePixelInY( iybin ) );
142  }
bool isItEdgePixelInY(int iybin) const
bool isItEdgePixelInX(int ixbin) const
bool RectangularPixelTopology::isItEdgePixelInX ( int  ixbin) const
inlinevirtual

Implements PixelTopology.

Definition at line 134 of file RectangularPixelTopology.h.

References m_nrows.

Referenced by isItEdgePixel().

134  {
135  return ( (ixbin == 0) || (ixbin == (m_nrows-1)) );
136  }
bool RectangularPixelTopology::isItEdgePixelInY ( int  iybin) const
inlinevirtual

Implements PixelTopology.

Definition at line 137 of file RectangularPixelTopology.h.

References m_ncols.

Referenced by isItEdgePixel().

137  {
138  return ( (iybin == 0) || (iybin == (m_ncols-1)) );
139  }
LocalError RectangularPixelTopology::localError ( const MeasurementPoint mp,
const MeasurementError me 
) const
virtual

Implements Topology.

Definition at line 480 of file RectangularPixelTopology.cc.

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

482  {
483  float pitchy=m_pitchy;
484  int binoffy=int(mp.y());
485  if( isItBigPixelInY(binoffy) )pitchy = 2.*m_pitchy;
486 
487  float pitchx=m_pitchx;
488  int binoffx=int(mp.x());
489  if( isItBigPixelInX(binoffx) )pitchx = 2.*m_pitchx;
490 
491  return LocalError( me.uu()*float(pitchx*pitchx), 0,
492  me.vv()*float(pitchy*pitchy));
493 }
float vv() const
T y() const
Definition: PV2DBase.h:45
virtual bool isItBigPixelInY(const int iybin) const
float uu() const
virtual bool isItBigPixelInX(const int ixbin) const
T x() const
Definition: PV2DBase.h:44
LocalPoint RectangularPixelTopology::localPosition ( const MeasurementPoint mp) const
virtual

Implements Topology.

Definition at line 141 of file RectangularPixelTopology.cc.

References gather_cfg::cout, EPS, localX(), localY(), m_ncols, m_nrows, TP_DEBUG, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

142  {
143  using std::cout;
144  using std::endl;
145 
146  float mpy = mp.y(); // measurements
147  float mpx = mp.x();
148 
149  // check limits
150  if(TP_DEBUG) {
151  if( mpy<0.) { //
152  cout<<" wrong mp y, fix "<<mpy<<" "
153  <<0<<endl;
154  mpy = 0.;
155  }
156  if( mpy>=m_ncols) {
157  cout<<" wrong mp y, fix "<<mpy<<" "
158  <<m_ncols<<endl;
159  mpy = float(m_ncols) - EPS; // EPS is a small number
160  }
161  if( mpx<0.) { //
162  cout<<" wrong mp x, fix "<<mpx<<" "
163  <<0<<endl;
164  mpx = 0.;
165  }
166  if( mpx>=m_nrows) {
167  cout<<" wrong mp x, fix "<<mpx<<" "
168  <<m_nrows<<endl;
169  mpx = float(m_nrows) - EPS; // EPS is a small number
170  }
171  } // if TP_DEBUG
172 
173 
174  // IF IT WORKS OK REPLACE THE CODE BELOW BY A CALL TO localY()
175  float lpY = localY(mpy);
176 
177 // // Start with Y
178 // int binoffy = int(mpy); // truncate to int
179 // float fractionY = mpy - binoffy; // find the fraction
180 // float local_pitchy = m_pitchy; // defaultpitch
181 // //if(fractionY<0.) cout<<" fractiony m "<<fractionY<<" "<<mpy<<endl;
182 
183 // if (binoffy>415) { // too large
184 // if(TP_DEBUG) {
185 // cout<<" very bad, biny "<<binoffy<<endl;
186 // cout<<mpy<<" "<<binoffy<<" "
187 // <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
188 // }
189 // } else if (binoffy==415) { // ROC 7, last big pixel
190 // binoffy=binoffy+15;
191 // local_pitchy = 2 * m_pitchy;
192 // } else if (binoffy>364) { // ROC 7
193 // binoffy=binoffy+15;
194 // } else if (binoffy==364) { // ROC 7
195 // binoffy=binoffy+14;
196 // local_pitchy = 2 * m_pitchy;
197 
198 // } else if (binoffy==363) { // ROC 6
199 // binoffy=binoffy+13;
200 // local_pitchy = 2 * m_pitchy;
201 // } else if (binoffy>312) { // ROC 6
202 // binoffy=binoffy+13;
203 // } else if (binoffy==312) { // ROC 6
204 // binoffy=binoffy+12;
205 // local_pitchy = 2 * m_pitchy;
206 
207 // } else if (binoffy==311) { // ROC 5
208 // binoffy=binoffy+11;
209 // local_pitchy = 2 * m_pitchy;
210 // } else if (binoffy>260) { // ROC 5
211 // binoffy=binoffy+11;
212 // } else if (binoffy==260) { // ROC 5
213 // binoffy=binoffy+10;
214 // local_pitchy = 2 * m_pitchy;
215 
216 // } else if (binoffy==259) { // ROC 4
217 // binoffy=binoffy+9;
218 // local_pitchy = 2 * m_pitchy;
219 // } else if (binoffy>208) { // ROC 4
220 // binoffy=binoffy+9;
221 // } else if (binoffy==208) { // ROC 4
222 // binoffy=binoffy+8;
223 // local_pitchy = 2 * m_pitchy;
224 
225 // } else if (binoffy==207) { // ROC 3
226 // binoffy=binoffy+7;
227 // local_pitchy = 2 * m_pitchy;
228 // } else if (binoffy>156) { // ROC 3
229 // binoffy=binoffy+7;
230 // } else if (binoffy==156) { // ROC 3
231 // binoffy=binoffy+6;
232 // local_pitchy = 2 * m_pitchy;
233 
234 // } else if (binoffy==155) { // ROC 2
235 // binoffy=binoffy+5;
236 // local_pitchy = 2 * m_pitchy;
237 // } else if (binoffy>104) { // ROC 2
238 // binoffy=binoffy+5;
239 // } else if (binoffy==104) { // ROC 2
240 // binoffy=binoffy+4;
241 // local_pitchy = 2 * m_pitchy;
242 
243 // } else if (binoffy==103) { // ROC 1
244 // binoffy=binoffy+3;
245 // local_pitchy = 2 * m_pitchy;
246 // } else if (binoffy>52) { // ROC 1
247 // binoffy=binoffy+3;
248 // } else if (binoffy==52) { // ROC 1
249 // binoffy=binoffy+2;
250 // local_pitchy = 2 * m_pitchy;
251 
252 // } else if (binoffy==51) { // ROC 0
253 // binoffy=binoffy+1;
254 // local_pitchy = 2 * m_pitchy;
255 // } else if (binoffy>0) { // ROC 0
256 // binoffy=binoffy+1;
257 // } else if (binoffy==0) { // ROC 0
258 // binoffy=binoffy+0;
259 // local_pitchy = 2 * m_pitchy;
260 // } else { // too small
261 // if(TP_DEBUG) {
262 // cout<<" very bad, biny "<<binoffy<<endl;
263 // cout<<mpy<<" "<<binoffy<<" "
264 // <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
265 // }
266 // }
267 
268 // // The final position in local coordinates
269 // float lpY = float(binoffy*m_pitchy) + fractionY*local_pitchy +
270 // m_yoffset;
271 // if(TP_DEBUG && (lpY<m_yoffset || lpY>(-m_yoffset)) ) {
272 // cout<<" bad lp y "<<lpY<<endl;
273 // cout<<mpy<<" "<<binoffy<<" "
274 // <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
275 // }
276 
277 
278  // IF IT WORKS OK REPLACE THE CODE BELOW BY A CALL TO localX()
279  float lpX = localX(mpx);
280 
281 // // Do the X
282 // int binoffx=int(mpx); // truncate to int
283 // float fractionX = mpx - binoffx; // find the fraction
284 // float local_pitchx = m_pitchx; // defaultpitch
285 // //if(fractionX<0.) cout<<" fractionx m "<<fractionX<<" "<<mpx<<endl;
286 
287 // if (binoffx>159) { // too large
288 // if(TP_DEBUG) {
289 // cout<<" very bad, binx "<<binoffx<<endl;
290 // cout<<mpx<<" "<<binoffx<<" "
291 // <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
292 // }
293 // } else if (binoffx>80) { // ROC 1
294 // binoffx=binoffx+2;
295 // } else if (binoffx==80) { // ROC 1
296 // binoffx=binoffx+1;
297 // local_pitchx = 2 * m_pitchx;
298 
299 // } else if (binoffx==79) { // ROC 0
300 // binoffx=binoffx+0;
301 // local_pitchx = 2 * m_pitchx;
302 // } else if (binoffx>=0) { // ROC 0
303 // binoffx=binoffx+0;
304 
305 // } else { // too small
306 // if(TP_DEBUG) {
307 // cout<<" very bad, binx "<<binoffx<<endl;
308 // cout<<mpx<<" "<<binoffx<<" "
309 // <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
310 // }
311 // }
312 
313 // // The final position in local coordinates
314 // float lpX = float(binoffx*m_pitchx) + fractionX*local_pitchx +
315 // m_xoffset;
316 
317 // if(TP_DEBUG && (lpX<m_xoffset || lpX>(-m_xoffset)) ) {
318 // cout<<" bad lp x "<<lpX<<endl;
319 // cout<<mpx<<" "<<binoffx<<" "
320 // <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
321 // }
322 
323  // Return it as a LocalPoint
324  return LocalPoint( lpX, lpY);
325 }
T y() const
Definition: PV2DBase.h:45
virtual float localY(const float mpY) const
#define EPS
#define TP_DEBUG
virtual float localX(const float mpX) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV2DBase.h:44
float RectangularPixelTopology::localX ( const float  mpX) const
virtual

Implements PixelTopology.

Definition at line 330 of file RectangularPixelTopology.cc.

References gather_cfg::cout, m_pitchx, m_xoffset, and TP_DEBUG.

Referenced by localPosition().

330  {
331  using std::cout;
332  using std::endl;
333 
334  int binoffx=int(mpx); // truncate to int
335  float fractionX = mpx - binoffx; // find the fraction
336  float local_pitchx = m_pitchx; // defaultpitch
337  //if(fractionX<0.) cout<<" fractionx m "<<fractionX<<" "<<mpx<<endl;
338 
339  if (binoffx>80) { // ROC 1 - handles x on edge cluster
340  binoffx=binoffx+2;
341  } else if (binoffx==80) { // ROC 1
342  binoffx=binoffx+1;
343  local_pitchx = 2 * m_pitchx;
344 
345  } else if (binoffx==79) { // ROC 0
346  binoffx=binoffx+0;
347  local_pitchx = 2 * m_pitchx;
348  } else if (binoffx>=0) { // ROC 0
349  binoffx=binoffx+0;
350 
351  } else { // too small
352  if(TP_DEBUG) {
353  cout<<" very bad, binx "<<binoffx<<endl;
354  cout<<mpx<<" "<<binoffx<<" "
355  <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
356  }
357  }
358 
359  // The final position in local coordinates
360  float lpX = float(binoffx*m_pitchx) + fractionX*local_pitchx +
361  m_xoffset;
362 
363  if(TP_DEBUG && (lpX<m_xoffset || lpX>(-m_xoffset)) ) {
364  cout<<" bad lp x "<<lpX<<endl;
365  cout<<mpx<<" "<<binoffx<<" "
366  <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
367  }
368 
369  return lpX;
370 }
#define TP_DEBUG
tuple cout
Definition: gather_cfg.py:121
float RectangularPixelTopology::localY ( const float  mpY) const
virtual

Implements PixelTopology.

Definition at line 374 of file RectangularPixelTopology.cc.

References gather_cfg::cout, m_pitchy, m_yoffset, and TP_DEBUG.

Referenced by localPosition().

374  {
375  using std::cout;
376  using std::endl;
377  int binoffy = int(mpy); // truncate to int
378  float fractionY = mpy - binoffy; // find the fraction
379  float local_pitchy = m_pitchy; // defaultpitch
380  //if(fractionY<0.) cout<<" fractiony m "<<fractionY<<" "<<mpy<<endl;
381 
382  if (binoffy>416) { // ROC 8, not real ROC
383  binoffy=binoffy+17;
384  } else if (binoffy==416) { // ROC 8
385  binoffy=binoffy+16;
386  local_pitchy = 2 * m_pitchy;
387 
388  } else if (binoffy==415) { // ROC 7, last big pixel
389  binoffy=binoffy+15;
390  local_pitchy = 2 * m_pitchy;
391  } else if (binoffy>364) { // ROC 7
392  binoffy=binoffy+15;
393  } else if (binoffy==364) { // ROC 7
394  binoffy=binoffy+14;
395  local_pitchy = 2 * m_pitchy;
396 
397  } else if (binoffy==363) { // ROC 6
398  binoffy=binoffy+13;
399  local_pitchy = 2 * m_pitchy;
400  } else if (binoffy>312) { // ROC 6
401  binoffy=binoffy+13;
402  } else if (binoffy==312) { // ROC 6
403  binoffy=binoffy+12;
404  local_pitchy = 2 * m_pitchy;
405 
406  } else if (binoffy==311) { // ROC 5
407  binoffy=binoffy+11;
408  local_pitchy = 2 * m_pitchy;
409  } else if (binoffy>260) { // ROC 5
410  binoffy=binoffy+11;
411  } else if (binoffy==260) { // ROC 5
412  binoffy=binoffy+10;
413  local_pitchy = 2 * m_pitchy;
414 
415  } else if (binoffy==259) { // ROC 4
416  binoffy=binoffy+9;
417  local_pitchy = 2 * m_pitchy;
418  } else if (binoffy>208) { // ROC 4
419  binoffy=binoffy+9;
420  } else if (binoffy==208) { // ROC 4
421  binoffy=binoffy+8;
422  local_pitchy = 2 * m_pitchy;
423 
424  } else if (binoffy==207) { // ROC 3
425  binoffy=binoffy+7;
426  local_pitchy = 2 * m_pitchy;
427  } else if (binoffy>156) { // ROC 3
428  binoffy=binoffy+7;
429  } else if (binoffy==156) { // ROC 3
430  binoffy=binoffy+6;
431  local_pitchy = 2 * m_pitchy;
432 
433  } else if (binoffy==155) { // ROC 2
434  binoffy=binoffy+5;
435  local_pitchy = 2 * m_pitchy;
436  } else if (binoffy>104) { // ROC 2
437  binoffy=binoffy+5;
438  } else if (binoffy==104) { // ROC 2
439  binoffy=binoffy+4;
440  local_pitchy = 2 * m_pitchy;
441 
442  } else if (binoffy==103) { // ROC 1
443  binoffy=binoffy+3;
444  local_pitchy = 2 * m_pitchy;
445  } else if (binoffy>52) { // ROC 1
446  binoffy=binoffy+3;
447  } else if (binoffy==52) { // ROC 1
448  binoffy=binoffy+2;
449  local_pitchy = 2 * m_pitchy;
450 
451  } else if (binoffy==51) { // ROC 0
452  binoffy=binoffy+1;
453  local_pitchy = 2 * m_pitchy;
454  } else if (binoffy>0) { // ROC 0
455  binoffy=binoffy+1;
456  } else if (binoffy==0) { // ROC 0
457  binoffy=binoffy+0;
458  local_pitchy = 2 * m_pitchy;
459  } else { // too small
460  if(TP_DEBUG) {
461  cout<<" very bad, biny "<<binoffy<<endl;
462  cout<<mpy<<" "<<binoffy<<" "
463  <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
464  }
465  }
466 
467  // The final position in local coordinates
468  float lpY = float(binoffy*m_pitchy) + fractionY*local_pitchy +
469  m_yoffset;
470  if(TP_DEBUG && (lpY<m_yoffset || lpY>(-m_yoffset)) ) {
471  cout<<" bad lp y "<<lpY<<endl;
472  cout<<mpy<<" "<<binoffy<<" "
473  <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
474  }
475 
476  return lpY;
477 }
#define TP_DEBUG
tuple cout
Definition: gather_cfg.py:121
MeasurementError RectangularPixelTopology::measurementError ( const LocalPoint lp,
const LocalError le 
) const
virtual

Implements Topology.

Definition at line 496 of file RectangularPixelTopology.cc.

References m_pitchx, m_pitchy, m_xoffset, m_yoffset, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

498  {
499 
500  float pitchy=m_pitchy;
501  int iybin = int( (lp.y() - m_yoffset)/m_pitchy ); //get bin for equal picth
502  int iybin0 = iybin%54; //This is just to avoid many ifs by using the periodicy
503  //quasi bins 0,1,52,53 fall into larger pixels
504  if(iybin0==0 || iybin0==1 || iybin0==52 || iybin0==53 )
505  pitchy = 2. * m_pitchy;
506 
507  float pitchx=m_pitchx;
508  int ixbin = int( (lp.x() - m_xoffset)/m_pitchx ); //get bin for equal pitch
509  //quasi bins 79,80,81,82 fall into the 2 larger pixels
510  if(ixbin>=79 && ixbin<=82) pitchx = 2. * m_pitchx;
511 
512  return MeasurementError( le.xx()/float(pitchx*pitchx), 0,
513  le.yy()/float(pitchy*pitchy));
514 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:62
float yy() const
Definition: LocalError.h:26
T x() const
Definition: PV3DBase.h:61
virtual MeasurementPoint RectangularPixelTopology::measurementPosition ( const LocalPoint lp) const
inlinevirtual

Implements Topology.

Definition at line 85 of file RectangularPixelTopology.h.

References AlCaHLTBitMon_ParallelJobs::p, and pixel().

86  {
87  std::pair<float,float> p = pixel(lp);
88  return MeasurementPoint( p.first, p.second);
89  }
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual std::pair< float, float > pixel(const LocalPoint &p) const
virtual int RectangularPixelTopology::ncolumns ( ) const
inlinevirtual

Implements PixelTopology.

Definition at line 154 of file RectangularPixelTopology.h.

References m_ncols.

154  {
155  return m_ncols;
156  }
virtual int RectangularPixelTopology::nrows ( ) const
inlinevirtual

Implements PixelTopology.

Definition at line 150 of file RectangularPixelTopology.h.

References m_nrows.

150  {
151  return m_nrows;
152  }
virtual std::pair<float,float> RectangularPixelTopology::pitch ( ) const
inlinevirtual

Implements PixelTopology.

Definition at line 146 of file RectangularPixelTopology.h.

References m_pitchx, and m_pitchy.

146  {
147  return std::pair<float,float>( float(m_pitchx), float(m_pitchy));
148  }
std::pair< float, float > RectangularPixelTopology::pixel ( const LocalPoint p) const
virtual

Topology for rectangular pixel detector with BIG pixels.

Implements PixelTopology.

Definition at line 13 of file RectangularPixelTopology.cc.

References gather_cfg::cout, m_pitchx, m_pitchy, m_xoffset, m_yoffset, TP_DEBUG, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by channel(), and measurementPosition().

14  {
15  using std::cout;
16  using std::endl;
17 
18  // check limits
19  float py = p.y();
20  float px = p.x();
21 
22  if(TP_DEBUG) {
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  if( py<m_yoffset ) { // m_yoffset is negative
27  cout<<" wrong lp y "<<py<<" "<<m_yoffset<<endl;
28  py = m_yoffset + EPSCM; // make sure it is in, add an EPS in cm
29  }
30  if( py>-m_yoffset ) {
31  cout<<" wrong lp y "<<py<<" "<<-m_yoffset<<endl;
32  py = -m_yoffset - EPSCM;
33  }
34  if( px<m_xoffset ) { // m_xoffset is negative
35  cout<<" wrong lp x "<<px<<" "<<m_xoffset<<endl;
36  px = m_xoffset + EPSCM;
37  }
38  if( px>-m_xoffset ) {
39  cout<<" wrong lp x "<<px<<" "<<-m_xoffset<<endl;
40  px = -m_xoffset - EPSCM;
41  }
42  } // end TP_DEBUG
43 
44  float newybin=(py - m_yoffset)/m_pitchy;
45  int iybin = int(newybin);
46  float fractionY = newybin - iybin;
47  //if(fractionY<0.) cout<<" fractiony "<<fractionY<<" "<<newybin<<endl;
48 
49  // Normalize it all to 1 ROC
50  int iybin0 = (iybin%54); // 0-53
51  int numROC = iybin/54; // 0-7
52 
53  if (iybin0>53) {
54  if(TP_DEBUG) {
55  cout<<" very bad, newbiny "<<iybin0<<endl;
56  cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
57  <<newybin<<" "<<iybin<<" "<<fractionY<<" "<<iybin0<<" "
58  <<numROC<<endl;
59  }
60  } else if (iybin0==53) { // inside big pixel
61  iybin0=51;
62  fractionY = (fractionY+1.)/2.;
63  } else if (iybin0==52) { // inside big pixel
64  iybin0=51;
65  fractionY = fractionY/2.;
66  } else if (iybin0>1) { // inside normal pixel
67  iybin0=iybin0-1;
68  } else if (iybin0==1) { // inside big pixel
69  iybin0=0;
70  fractionY = (fractionY+1.)/2.;
71  } else if (iybin0==0) { // inside big pixel
72  iybin0=0;
73  fractionY = fractionY/2.;
74  } else {
75  if(TP_DEBUG) {
76  cout<<" very bad, newbiny "<<newybin<<endl;
77  cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
78  <<newybin<<" "<<iybin<<" "<<fractionY<<" "
79  <<iybin0<<" "<<numROC<<endl;
80  }
81  }
82  float mpY = float(numROC*52. + iybin0) + fractionY;
83  if(TP_DEBUG && (mpY<0. || mpY>=416.)) {
84  cout<<" bad pix y "<<mpY<<endl;
85  cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
86  <<newybin<<" "<<iybin<<" "<<fractionY<<" "
87  <<iybin0<<" "<<numROC<<endl;
88  }
89 
90  // In X
91  float newxbin=(px - m_xoffset) / m_pitchx;
92  int ixbin = int(newxbin);
93  float fractionX = newxbin - ixbin;
94  // if(fractionX<0.) {
95  // cout<<" fractionx "<<fractionX<<" "<<newxbin<<" "<<ixbin<<" ";
96  // cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
97  // <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
98  // }
99 
100  if (ixbin>161) {
101  if(TP_DEBUG) {
102  cout<<" very bad, newbinx "<<ixbin<<endl;
103  cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
104  <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
105  }
106  } else if (ixbin>82) { // inside normal pixel, ROC 1
107  ixbin=ixbin-2;
108  } else if (ixbin==82) { // inside bin pixel
109  ixbin=80;
110  fractionX = (fractionX+1.)/2.;
111  } else if (ixbin==81) { // inside big pixel
112  ixbin=80;
113  fractionX = fractionX/2.;
114  } else if (ixbin==80) { // inside bin pixel, ROC 0
115  ixbin=79;
116  fractionX = (fractionX+1.)/2.;
117  } else if (ixbin==79) { // inside big pixel
118  ixbin=79;
119  fractionX = fractionX/2.;
120  } else if (ixbin<0) { // outside range
121  if(TP_DEBUG) {
122  cout<<" very bad, newbinx "<<ixbin<<endl;
123  cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
124  <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
125  }
126  }
127 
128  float mpX = float(ixbin) + fractionX;
129 
130  if(TP_DEBUG && (mpX<0. || mpX>=160.) ) {
131  cout<<" bad pix x "<<mpX<<" "<<endl;
132  cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
133  <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
134  }
135 
136  return std::pair<float,float>(mpX,mpY);
137 }
T y() const
Definition: PV3DBase.h:62
#define TP_DEBUG
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:61

Member Data Documentation

const int RectangularPixelTopology::BIG_PIX_PER_ROC_X = 1
staticprivate

Definition at line 51 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

const int RectangularPixelTopology::BIG_PIX_PER_ROC_Y = 2
staticprivate

Definition at line 52 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

const int RectangularPixelTopology::COLS_PER_ROC = 52
staticprivate

Definition at line 50 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

int RectangularPixelTopology::m_ncols
private
int RectangularPixelTopology::m_nrows
private
float RectangularPixelTopology::m_pitchx
private
float RectangularPixelTopology::m_pitchy
private
float RectangularPixelTopology::m_xoffset
private
float RectangularPixelTopology::m_yoffset
private
const int RectangularPixelTopology::ROWS_PER_ROC = 80
staticprivate

Definition at line 49 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().