CMS 3D CMS Logo

CTPPSPixelROC.h
Go to the documentation of this file.
1 #ifndef CTPPSReadoutObjects_PixelROC_H
2 #define CTPPSReadoutObjects_PixelROC_H
3 
5 
7 
8 #include <cstdint>
9 #include <string>
10 
20 public:
21 
23  }
24 
26  }
27 
31  CTPPSPixelROC( uint32_t du, int idInDU, int idLk);
32 
34  uint32_t rawId() const { return theDetUnit; }
35 
37  unsigned int idInDetUnit() const { return theIdDU; }
38 
40  unsigned int idInLink() const { return theIdLk; }
41 
42  std::pair<int,int> toLocal(const std::pair<int,int> &modulePixel ) const {
43 
44  int rocPixelRow, rocPixelColumn, idDU;
45  int modulePixelRow = modulePixel.first;
46  int modulePixelColumn = modulePixel.second;
47 
48  theIndices.transformToROC(modulePixelColumn, modulePixelRow, idDU, rocPixelColumn, rocPixelRow);
49 
50  std::pair<int,int> rocPixel;
51  rocPixel = std::make_pair(rocPixelRow, rocPixelColumn);
52 
53  return rocPixel;
54 
55  }
56 
57  std::pair<int,int> toGlobal(const std::pair<int,int> &rocPixel ) const {
58 
59  int modulePixelRow=-1;
60  int modulePixelColumn=-1;
61  int rocPixelRow = rocPixel.first;
62  int rocPixelColumn = rocPixel.second;
63 
64  theIndices.transformToModule(rocPixelColumn, rocPixelRow, theIdDU, modulePixelColumn, modulePixelRow);
65 
66  std::pair<int,int> modulePixel;
67  modulePixel = std::make_pair(modulePixelRow, modulePixelColumn);
68 
69  return modulePixel;
70 
71  }
72 
73  std::pair<int,int> toGlobalfromDcol(const std::pair<int,int> &rocPixel ) const {
74 
75  int modulePixelRow=-1;
76  int modulePixelColumn=-1;
77  int rocDcol = rocPixel.first;
78  int rocPxl = rocPixel.second;
79 
80  int rocPixelRow ;
81  int rocPixelColumn ;
82 
83  theIndices.convertDcolToCol(rocDcol, rocPxl, rocPixelColumn, rocPixelRow);
84 
85  theIndices.transformToModule(rocPixelColumn, rocPixelRow, theIdDU, modulePixelColumn, modulePixelRow);
86 
87  std::pair<int,int> modulePixel;
88  modulePixel = std::make_pair(modulePixelRow, modulePixelColumn);
89 
90  return modulePixel;
91 
92  }
93 
94 
95 
96 
97 
99  std::string print(int depth = 0) const;
100 
101 
102 private:
103  uint32_t theDetUnit;
104  unsigned int theIdDU, theIdLk;
105 
107 
109 };
110 
111 
112 
113 #endif
static int convertDcolToCol(const int dcol, const int pix, int &colROC, int &rowROC)
std::string print(int depth=0) const
printout for debug
unsigned int theIdDU
std::pair< int, int > toLocal(const std::pair< int, int > &modulePixel) const
Definition: CTPPSPixelROC.h:42
std::pair< int, int > toGlobal(const std::pair< int, int > &rocPixel) const
Definition: CTPPSPixelROC.h:57
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: CTPPSPixelROC.h:34
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: CTPPSPixelROC.h:40
unsigned int theIdLk
int transformToModule(const int colROC, const int rowROC, const int rocId, int &col, int &row) const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
std::pair< int, int > toGlobalfromDcol(const std::pair< int, int > &rocPixel) const
Definition: CTPPSPixelROC.h:73
int transformToROC(const int col, const int row, int &rocId, int &colROC, int &rowROC) const
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: CTPPSPixelROC.h:37
CTPPSPixelIndices theIndices
uint32_t theDetUnit