test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
9  public:
10 
11  static const int numRowsInRoc = 80;
12  static const int numColsInRoc = 52;
13 
15  struct RocRowCol {
16  int rocRow, rocCol;
17  bool valid() const { return (0 <= rocRow) & (rocRow < numRowsInRoc)
18  & (0 <= rocCol) & (rocCol < numColsInRoc); }
19  };
20 
22  struct DcolPxid {
23  int dcol, pxid;
24  bool valid() const { return ( (0 <= dcol) & (dcol < 26) & (2 <= pxid) & (pxid < 162) ); }
25  };
26 
27  LocalPixel( const DcolPxid & pixel) {
28  thePixel.rocRow = numRowsInRoc - pixel.pxid/2;
29  thePixel.rocCol = pixel.dcol*2 + pixel.pxid%2;
30  }
31 
32  LocalPixel( const RocRowCol & pixel) : thePixel(pixel) {}
33 
34  int dcol() const { return thePixel.rocCol/2; }
35  int pxid() const { return 2*(numRowsInRoc-thePixel.rocRow)+ (thePixel.rocCol%2); }
36 
37  int rocRow() const { return thePixel.rocRow; }
38  int rocCol() const { return thePixel.rocCol; }
39 
40  bool valid() const { return thePixel.valid(); }
41  private:
43  };
44 }
45 
46 #endif
identify pixel inside single ROC
Definition: LocalPixel.h:7
static const int numColsInRoc
Definition: LocalPixel.h:12
static const int numRowsInRoc
Definition: LocalPixel.h:11
double collumn and pixel ID in double collumn representation
Definition: LocalPixel.h:22
LocalPixel(const DcolPxid &pixel)
Definition: LocalPixel.h:27
row and collumn in ROC representation
Definition: LocalPixel.h:15
LocalPixel(const RocRowCol &pixel)
Definition: LocalPixel.h:32