CMS 3D CMS Logo

PixelROC.h
Go to the documentation of this file.
1 #ifndef SiPixelObjects_PixelROC_H
2 #define SiPixelObjects_PixelROC_H
3 
5 
9 #include <string>
10 #include <cstdint>
11 
19 //class TrackerTopology;
20 
21 namespace sipixelobjects {
22 
23  class PixelROC {
24  public:
26  PixelROC() : theDetUnit(0), theIdDU(0), theIdLk(0) {}
27 
31  PixelROC(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 
45  LocalPixel toLocal(const GlobalPixel& glo) const {
46  int rocRow = theFrameConverter.row().inverse(glo.row);
47  int rocCol = theFrameConverter.collumn().inverse(glo.col);
48 
49  LocalPixel::RocRowCol rocRowCol = {rocRow, rocCol};
50  return LocalPixel(rocRowCol);
51  }
52 
57  result.col = theFrameConverter.collumn().convert(loc.rocCol());
58  result.row = theFrameConverter.row().convert(loc.rocRow());
59  return result;
60  }
61 
62  // recognise the detector side and layer number
63  // this methods use hardwired constants
64  // if the numberg changes the methods have to be modified
65  int bpixSidePhase0(uint32_t rawId) const;
66  int fpixSidePhase0(uint32_t rawId) const;
67  int bpixSidePhase1(uint32_t rawId) const;
68  int fpixSidePhase1(uint32_t rawId) const;
69  static int bpixLayerPhase1(uint32_t rawId);
70 
72  std::string print(int depth = 0) const;
73 
74  void initFrameConversion();
76  //void initFrameConversion(const TrackerTopology *tt, bool phase1=false);
77  // Frame conversion compatible with CMSSW_9_0_X Monte Carlo samples
79 
80  private:
81  uint32_t theDetUnit;
82  unsigned int theIdDU, theIdLk;
84 
86  };
87 
88 } // namespace sipixelobjects
89 
90 #endif
int bpixSidePhase0(uint32_t rawId) const
Definition: PixelROC.cc:97
int bpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:119
void initFrameConversionPhase1_CMSSW_9_0_X()
Definition: PixelROC.cc:56
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
int fpixSidePhase1(uint32_t rawId) const
Definition: PixelROC.cc:195
const sipixelobjects::LinearConversion & collumn() const
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
FrameConversion theFrameConverter
Definition: PixelROC.h:83
unsigned int theIdLk
Definition: PixelROC.h:82
unsigned int theIdDU
Definition: PixelROC.h:82
std::string print(int depth=0) const
printout for debug
Definition: PixelROC.cc:231
#define COND_TRANSIENT
Definition: Serializable.h:63
static int bpixLayerPhase1(uint32_t rawId)
Definition: PixelROC.cc:142
int fpixSidePhase0(uint32_t rawId) const
Definition: PixelROC.cc:163
row and collumn in ROC representation
Definition: LocalPixel.h:13
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void initFrameConversionPhase1()
Definition: PixelROC.cc:69
LocalPixel toLocal(const GlobalPixel &glo) const
Definition: PixelROC.h:45
unsigned int idInLink() const
id of this ROC in parent Link.
Definition: PixelROC.h:40
const sipixelobjects::LinearConversion & row() const
uint32_t rawId() const
return the DetUnit to which this ROC belongs to.
Definition: PixelROC.h:34
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37