CMS 3D CMS Logo

TIDDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiStripDetId_TIDDetId_H
2 #define DataFormats_SiStripDetId_TIDDetId_H
3 
4 #include <ostream>
5 #include <vector>
8 
12 class TIDDetId;
13 
14 std::ostream& operator<<(std::ostream& os,const TIDDetId& id);
15 
16 class TIDDetId : public SiStripDetId {
17  public:
19  TIDDetId();
21  TIDDetId(uint32_t rawid);
23  TIDDetId(const DetId& id);
24 
25  TIDDetId(uint32_t side,
26  uint32_t wheel,
27  uint32_t ring,
28  uint32_t module_fw_bw,
29  uint32_t module,
30  uint32_t ster) : SiStripDetId(DetId::Tracker,StripSubdetector::TID){
31  id_ |= (side& sideMask_) << sideStartBit_ |
32  (wheel& wheelMask_) << wheelStartBit_ |
33  (ring& ringMask_) << ringStartBit_ |
34  (module_fw_bw& module_fw_bwMask_) << module_fw_bwStartBit_ |
35  (module& moduleMask_) << moduleStartBit_ |
36  (ster& sterMask_) << sterStartBit_ ;
37  }
38 
39 
41 
45  unsigned int side() const{
46  return int((id_>>sideStartBit_) & sideMask_);
47  }
48 
50  unsigned int wheel() const{
51  return int((id_>>wheelStartBit_) & wheelMask_);
52  }
53 
55  unsigned int ring() const
56  { return ((id_>>ringStartBit_) & ringMask_) ;}
57 
59 
64  std::vector<unsigned int> module() const
65  { std::vector<unsigned int> num;
66  num.push_back( order() );
67  num.push_back( moduleNumber() );
68  return num ;}
69 
70  unsigned int order() const
72 
74  bool isDoubleSide() const;
75 
77  bool isZPlusSide() const
78  { return (!isZMinusSide());}
79 
81  bool isZMinusSide() const
82  { return (side()==1);}
83 
85  bool isBackRing() const
86  { return (order()==1);}
87 
89  bool isFrontRing() const
90  { return (!isBackRing());}
91 
93  unsigned int diskNumber() const
94  { return wheel();}
95 
97  unsigned int ringNumber() const
98  { return ring();}
99 
101  unsigned int moduleNumber() const
102  { return ((id_>>moduleStartBit_) & moduleMask_);}
103 
105  bool isRPhi()
106  { return (stereo() == 0 && !isDoubleSide());}
107 
109  bool isStereo()
110  { return (stereo() != 0 && !isDoubleSide());}
111 
112 private:
114  static const unsigned int sideStartBit_= 13;
115  static const unsigned int wheelStartBit_= 11;
116  static const unsigned int ringStartBit_= 9;
117  static const unsigned int module_fw_bwStartBit_= 7;
118  static const unsigned int moduleStartBit_= 2;
119  static const unsigned int sterStartBit_= 0;
121  static const unsigned int sideMask_= 0x3;
122  static const unsigned int wheelMask_= 0x3;
123  static const unsigned int ringMask_= 0x3;
124  static const unsigned int module_fw_bwMask_= 0x3;
125  static const unsigned int moduleMask_= 0x1F;
126  static const unsigned int sterMask_= 0x3;
127 };
128 
129 
130 inline
132 }
133 inline
134 TIDDetId::TIDDetId(uint32_t rawid) : SiStripDetId(rawid) {
135 }
136 inline
138 }
139 inline
141  // Double Side: only rings 1 and 2
142  return this->glued() == 0 && ( this->ring() == 1 || this->ring() == 2 );
143 }
144 
145 
146 
147 
148 #endif
149 
150 
std::ostream & operator<<(std::ostream &os, const TIDDetId &id)
Definition: TIDDetId.cc:4
unsigned int order() const
Definition: TIDDetId.h:70
uint32_t stereo() const
Definition: SiStripDetId.h:160
bool isStereo()
Definition: TIDDetId.h:109
static const unsigned int moduleStartBit_
Definition: TIDDetId.h:118
bool isBackRing() const
Definition: TIDDetId.h:85
unsigned int ringNumber() const
Definition: TIDDetId.h:97
static const unsigned int wheelMask_
Definition: TIDDetId.h:122
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
TIDDetId()
Definition: TIDDetId.h:131
unsigned int ring() const
ring id
Definition: TIDDetId.h:55
bool isRPhi()
Definition: TIDDetId.h:105
std::vector< unsigned int > module() const
det id
Definition: TIDDetId.h:64
static const unsigned int sideMask_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: TIDDetId.h:121
TIDDetId(uint32_t side, uint32_t wheel, uint32_t ring, uint32_t module_fw_bw, uint32_t module, uint32_t ster)
Definition: TIDDetId.h:25
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
uint32_t glued() const
Definition: SiStripDetId.h:155
bool isZMinusSide() const
Definition: TIDDetId.h:81
static const unsigned int module_fw_bwMask_
Definition: TIDDetId.h:124
static const unsigned int sterStartBit_
Definition: TIDDetId.h:119
static const unsigned int sideStartBit_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: TIDDetId.h:114
unsigned int side() const
positive or negative id
Definition: TIDDetId.h:45
uint32_t id_
Definition: DetId.h:55
static const unsigned int module_fw_bwStartBit_
Definition: TIDDetId.h:117
bool isZPlusSide() const
Definition: TIDDetId.h:77
static const unsigned int sterMask_
Definition: TIDDetId.h:126
static const unsigned int ringStartBit_
Definition: TIDDetId.h:116
static const unsigned int ringMask_
Definition: TIDDetId.h:123
static const unsigned int moduleMask_
Definition: TIDDetId.h:125
unsigned int moduleNumber() const
Definition: TIDDetId.h:101
Definition: vlib.h:208
static const unsigned int wheelStartBit_
Definition: TIDDetId.h:115
bool isFrontRing() const
Definition: TIDDetId.h:89
bool isDoubleSide() const
Definition: TIDDetId.h:140
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50
unsigned int diskNumber() const
Definition: TIDDetId.h:93