CMS 3D CMS Logo

LocalPixel.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiPixelObjects_LocalPixel_H
2 #define CondFormats_SiPixelObjects_LocalPixel_H
3 
4 namespace sipixelobjects {
5 
7  class LocalPixel {
8  public:
9  static const int numRowsInRoc = 80;
10  static const int numColsInRoc = 52;
11 
13  struct RocRowCol {
14  int rocRow, rocCol;
15  bool valid() const { return (0 <= rocRow) & (rocRow < numRowsInRoc) & (0 <= rocCol) & (rocCol < numColsInRoc); }
16  };
17 
19  struct DcolPxid {
20  int dcol, pxid;
21  bool valid() const { return ((0 <= dcol) & (dcol < 26) & (2 <= pxid) & (pxid < 162)); }
22  };
23 
25  thePixel.rocRow = numRowsInRoc - pixel.pxid / 2;
26  thePixel.rocCol = pixel.dcol * 2 + pixel.pxid % 2;
27  }
28 
30 
31  int dcol() const { return thePixel.rocCol / 2; }
32  int pxid() const { return 2 * (numRowsInRoc - thePixel.rocRow) + (thePixel.rocCol % 2); }
33 
34  int rocRow() const { return thePixel.rocRow; }
35  int rocCol() const { return thePixel.rocCol; }
36 
37  bool valid() const { return thePixel.valid(); }
38 
39  private:
41  };
42 } // namespace sipixelobjects
43 
44 #endif
identify pixel inside single ROC
Definition: LocalPixel.h:7
static const int numColsInRoc
Definition: LocalPixel.h:10
static const int numRowsInRoc
Definition: LocalPixel.h:9
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:19
LocalPixel(const DcolPxid &pixel)
Definition: LocalPixel.h:24
row and collumn in ROC representation
Definition: LocalPixel.h:13
LocalPixel(const RocRowCol &pixel)
Definition: LocalPixel.h:29