CMS 3D CMS Logo

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