CMS 3D CMS Logo

PixelROC.h
Go to the documentation of this file.
1 #ifndef SiPixelObjects_PixelROC_H
2 #define SiPixelObjects_PixelROC_H
3 
4 
6 
10 #include <boost/cstdint.hpp>
11 #include <string>
12 
20 //class TrackerTopology;
21 
22 namespace sipixelobjects {
23 
24 class PixelROC {
25 public:
26 
28  PixelROC() : theDetUnit(0), theIdDU(0), theIdLk(0) {}
29 
30 
34  PixelROC( uint32_t du, int idInDU, int idLk);
35 
37  uint32_t rawId() const { return theDetUnit; }
38 
40  unsigned int idInDetUnit() const { return theIdDU; }
41 
43  unsigned int idInLink() const { return theIdLk; }
44 
48  LocalPixel toLocal(const GlobalPixel & glo) const {
49  int rocRow = theFrameConverter.row().inverse(glo.row);
50  int rocCol = theFrameConverter.collumn().inverse(glo.col);
51 
52  LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
53  return LocalPixel(rocRowCol);
54 
55  }
56 
61  result.col = theFrameConverter.collumn().convert(loc.rocCol());
62  result.row = theFrameConverter.row().convert(loc.rocRow());
63  return result;
64  }
65 
66  // recognise the detector side and layer number
67  // this methods use hardwired constants
68  // if the numberg changes the methods have to be modified
69  int bpixSidePhase0(uint32_t rawId) const;
70  int fpixSidePhase0(uint32_t rawId) const;
71  int bpixSidePhase1(uint32_t rawId) const;
72  int fpixSidePhase1(uint32_t rawId) const;
73  static int bpixLayerPhase1(uint32_t rawId);
74 
76  std::string print(int depth = 0) const;
77 
78  void initFrameConversion();
80  //void initFrameConversion(const TrackerTopology *tt, bool phase1=false);
81 
82 private:
83  uint32_t theDetUnit;
84  unsigned int theIdDU, theIdLk;
86 
87 
89 };
90 
91 }
92 
93 #endif
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:180
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:43
const sipixelobjects::LinearConversion & row() const
identify pixel inside single ROC
Definition: LocalPixel.h:7
std::string print(int depth=0) const
printout for debug
Definition: PixelROC.cc:216
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
const sipixelobjects::LinearConversion & collumn() const
LocalPixel toLocal(const GlobalPixel &glo) const
Definition: PixelROC.h:48
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:40
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:37
FrameConversion theFrameConverter
Definition: PixelROC.h:85
unsigned int theIdLk
Definition: PixelROC.h:84
unsigned int theIdDU
Definition: PixelROC.h:84
#define COND_TRANSIENT
Definition: Serializable.h:61
int fpixSidePhase0(uint32_t rawId) const
Definition: PixelROC.cc:149
static int bpixLayerPhase1(uint32_t rawId)
Definition: PixelROC.cc:128
row and collumn in ROC representation
Definition: LocalPixel.h:15
#define COND_SERIALIZABLE
Definition: Serializable.h:38
int bpixSidePhase0(uint32_t rawId) const
Definition: PixelROC.cc:85
void initFrameConversionPhase1()
Definition: PixelROC.cc:56
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:59
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:106