CMS 3D CMS Logo

TECDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiStripDetId_TECDetId_H
2 #define DataFormats_SiStripDetId_TECDetId_H
3 
4 #include <ostream>
5 #include <vector>
8 
12 class TECDetId;
13 
14 std::ostream& operator<<(std::ostream& s,const TECDetId& id);
15 
16 class TECDetId : public SiStripDetId {
17  public:
19  TECDetId();
21  TECDetId(uint32_t rawid);
23  TECDetId(const DetId& id);
24 
25  TECDetId(uint32_t side,
26  uint32_t wheel,
27  uint32_t petal_fw_bw,
28  uint32_t petal,
29  uint32_t ring,
30  uint32_t module,
31  uint32_t ster) : SiStripDetId(DetId::Tracker,StripSubdetector::TEC){
32  id_ |= (side& sideMask_) << sideStartBit_ |
33  (wheel& wheelMask_) << wheelStartBit_ |
34  (petal_fw_bw& petal_fw_bwMask_) << petal_fw_bwStartBit_ |
35  (petal& petalMask_) << petalStartBit_ |
36  (ring& ringMask_) << ringStartBit_ |
37  (module& moduleMask_) << moduleStartBit_ |
38  (ster& sterMask_) << sterStartBit_ ;
39  }
40 
41 
43 
47  unsigned int side() const{
48  return int((id_>>sideStartBit_) & sideMask_);
49  }
50 
52  unsigned int wheel() const
53  { return ((id_>>wheelStartBit_) & wheelMask_) ;}
54 
56 
61  std::vector<unsigned int> petal() const
62  { std::vector<unsigned int> num;
63  num.push_back(order());
64  num.push_back(petalNumber());
65  return num ;}
66 
67  unsigned int order() const
68  { return ((id_>>petal_fw_bwStartBit_) & petal_fw_bwMask_);}
69 
71  unsigned int ring() const
72  { return ((id_>>ringStartBit_) & ringMask_) ;}
73 
75  unsigned int module() const
76  { return ((id_>>moduleStartBit_) & moduleMask_);}
77 
79  bool isDoubleSide() const;
80 
82  bool isZPlusSide() const
83  { return (!isZMinusSide());}
84 
86  bool isZMinusSide() const
87  { return (side()==1);}
88 
90  unsigned int wheelNumber() const
91  { return wheel();}
92 
94  unsigned int petalNumber() const
95  { return ((id_>>petalStartBit_) & petalMask_);}
96 
98  unsigned int ringNumber() const
99  { return ring();}
100 
102  unsigned int moduleNumber() const
103  { return module();}
104 
106  bool isBackPetal() const
107  { return (order()==1);}
108 
110  bool isFrontPetal() const
111  { return (!isBackPetal());}
112 
114  bool isRPhi()
115  { return (stereo() == 0 && !isDoubleSide());}
116 
118  bool isStereo()
119  { return (stereo() != 0 && !isDoubleSide());}
120 
121 private:
123  static const unsigned int sideStartBit_= 18;
124  static const unsigned int wheelStartBit_= 14;
125  static const unsigned int petal_fw_bwStartBit_= 12;
126  static const unsigned int petalStartBit_= 8;
127  static const unsigned int ringStartBit_= 5;
128  static const unsigned int moduleStartBit_= 2;
129  static const unsigned int sterStartBit_= 0;
131  static const unsigned int sideMask_= 0x3;
132  static const unsigned int wheelMask_= 0xF;
133  static const unsigned int petal_fw_bwMask_= 0x3;
134  static const unsigned int petalMask_= 0xF;
135  static const unsigned int ringMask_= 0x7;
136  static const unsigned int moduleMask_= 0x7;
137  static const unsigned int sterMask_= 0x3;
138 };
139 
140 
141 inline
143 }
144 inline
145 TECDetId::TECDetId(uint32_t rawid) : SiStripDetId(rawid) {
146 }
147 inline
149 }
150 
151 inline
153  // Double Side: only rings 1, 2 and 5
154  return this->glued() == 0 && ( this->ring() == 1 || this->ring() == 2 || this->ring() == 5 ) ;
155 }
156 
157 
158 #endif
bool isDoubleSide() const
Definition: TECDetId.h:152
static const unsigned int sideStartBit_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: TECDetId.h:123
unsigned int petalNumber() const
Definition: TECDetId.h:94
static const unsigned int wheelStartBit_
Definition: TECDetId.h:124
uint32_t stereo() const
Definition: SiStripDetId.h:160
static const unsigned int petalMask_
Definition: TECDetId.h:134
TECDetId(uint32_t side, uint32_t wheel, uint32_t petal_fw_bw, uint32_t petal, uint32_t ring, uint32_t module, uint32_t ster)
Definition: TECDetId.h:25
unsigned int wheelNumber() const
Definition: TECDetId.h:90
unsigned int module() const
det id
Definition: TECDetId.h:75
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
unsigned int order() const
Definition: TECDetId.h:67
static const unsigned int petal_fw_bwStartBit_
Definition: TECDetId.h:125
std::vector< unsigned int > petal() const
petal id
Definition: TECDetId.h:61
bool isZMinusSide() const
Definition: TECDetId.h:86
static const unsigned int ringMask_
Definition: TECDetId.h:135
bool isStereo()
Definition: TECDetId.h:118
bool isZPlusSide() const
Definition: TECDetId.h:82
static const unsigned int wheelMask_
Definition: TECDetId.h:132
static const unsigned int sideMask_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: TECDetId.h:131
unsigned int moduleNumber() const
Definition: TECDetId.h:102
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18
uint32_t glued() const
Definition: SiStripDetId.h:155
static const unsigned int moduleStartBit_
Definition: TECDetId.h:128
bool isBackPetal() const
Definition: TECDetId.h:106
TECDetId()
Definition: TECDetId.h:142
uint32_t id_
Definition: DetId.h:55
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
static const unsigned int sterStartBit_
Definition: TECDetId.h:129
static const unsigned int petal_fw_bwMask_
Definition: TECDetId.h:133
unsigned int ringNumber() const
Definition: TECDetId.h:98
unsigned int ring() const
ring id
Definition: TECDetId.h:71
static const unsigned int moduleMask_
Definition: TECDetId.h:136
bool isFrontPetal() const
Definition: TECDetId.h:110
std::ostream & operator<<(std::ostream &s, const TECDetId &id)
Definition: TECDetId.cc:6
Definition: vlib.h:208
static const unsigned int sterMask_
Definition: TECDetId.h:137
bool isRPhi()
Definition: TECDetId.h:114
static const unsigned int petalStartBit_
Definition: TECDetId.h:126
static const unsigned int ringStartBit_
Definition: TECDetId.h:127