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 
30  uint32_t rawId() const { return theDetUnit; }
31 
33  unsigned int idInDetUnit() const { return theIdDU; }
34 
36  unsigned int idInLink() const { return theIdLk; }
37 
38  std::pair<int, int> toLocal(const std::pair<int, int> &modulePixel) const {
39  int rocPixelRow, rocPixelColumn, idDU;
40  int modulePixelRow = modulePixel.first;
41  int modulePixelColumn = modulePixel.second;
42 
43  theIndices.transformToROC(modulePixelColumn, modulePixelRow, idDU, rocPixelColumn, rocPixelRow);
44 
45  std::pair<int, int> rocPixel;
46  rocPixel = std::make_pair(rocPixelRow, rocPixelColumn);
47 
48  return rocPixel;
49  }
50 
51  std::pair<int, int> toGlobal(const std::pair<int, int> &rocPixel) const {
52  int modulePixelRow = -1;
53  int modulePixelColumn = -1;
54  int rocPixelRow = rocPixel.first;
55  int rocPixelColumn = rocPixel.second;
56 
57  theIndices.transformToModule(rocPixelColumn, rocPixelRow, theIdDU, modulePixelColumn, modulePixelRow);
58 
59  std::pair<int, int> modulePixel;
60  modulePixel = std::make_pair(modulePixelRow, modulePixelColumn);
61 
62  return modulePixel;
63  }
64 
65  std::pair<int, int> toGlobalfromDcol(const std::pair<int, int> &rocPixel) const {
66  int modulePixelRow = -1;
67  int modulePixelColumn = -1;
68  int rocDcol = rocPixel.first;
69  int rocPxl = rocPixel.second;
70 
71  int rocPixelRow;
72  int rocPixelColumn;
73 
74  theIndices.convertDcolToCol(rocDcol, rocPxl, rocPixelColumn, rocPixelRow);
75 
76  theIndices.transformToModule(rocPixelColumn, rocPixelRow, theIdDU, modulePixelColumn, modulePixelRow);
77 
78  std::pair<int, int> modulePixel;
79  modulePixel = std::make_pair(modulePixelRow, modulePixelColumn);
80 
81  return modulePixel;
82  }
83 
85  std::string print(int depth = 0) const;
86 
87 private:
88  uint32_t theDetUnit;
89  unsigned int theIdDU, theIdLk;
90 
92 
94 };
95 
96 #endif
static int convertDcolToCol(const int dcol, const int pix, int &colROC, int &rowROC)
unsigned int theIdDU
Definition: CTPPSPixelROC.h:89
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:33
unsigned int theIdLk
Definition: CTPPSPixelROC.h:89
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:30
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: CTPPSPixelROC.h:36
std::pair< int, int > toLocal(const std::pair< int, int > &modulePixel) const
Definition: CTPPSPixelROC.h:38
#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:91
std::pair< int, int > toGlobalfromDcol(const std::pair< int, int > &rocPixel) const
Definition: CTPPSPixelROC.h:65
uint32_t theDetUnit
Definition: CTPPSPixelROC.h:88
std::pair< int, int > toGlobal(const std::pair< int, int > &rocPixel) const
Definition: CTPPSPixelROC.h:51