CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PXFDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiStripDetId_PXFDetId_H
2 #define DataFormats_SiStripDetId_PXFDetId_H
3 
4 #include <ostream>
7 
11 class PXFDetId;
12 
13 std::ostream& operator<<(std::ostream& os, const PXFDetId& id);
14 
15 class PXFDetId : public DetId {
16 public:
18  PXFDetId();
20  PXFDetId(uint32_t rawid);
22  PXFDetId(const DetId& id);
23 
24  PXFDetId(uint32_t side, uint32_t disk, uint32_t blade, uint32_t panel, uint32_t module)
26  id_ |= (side & sideMask_) << sideStartBit_ | (disk & diskMask_) << diskStartBit_ |
27  (blade & bladeMask_) << bladeStartBit_ | (panel & panelMask_) << panelStartBit_ |
28  (module & moduleMask_) << moduleStartBit_;
29  }
30 
32  unsigned int side() const { return int((id_ >> sideStartBit_) & sideMask_); }
33 
35  unsigned int disk() const { return int((id_ >> diskStartBit_) & diskMask_); }
36 
38  unsigned int blade() const { return ((id_ >> bladeStartBit_) & bladeMask_); }
39 
41  unsigned int panel() const { return ((id_ >> panelStartBit_) & panelMask_); }
42 
44  unsigned int module() const { return ((id_ >> moduleStartBit_) & moduleMask_); }
45 
46 private:
48  static const unsigned int sideStartBit_ = 23;
49  static const unsigned int diskStartBit_ = 16;
50  static const unsigned int bladeStartBit_ = 10;
51  static const unsigned int panelStartBit_ = 8;
52  static const unsigned int moduleStartBit_ = 2;
54 
55  static const unsigned int sideMask_ = 0x3;
56  static const unsigned int diskMask_ = 0xF;
57  static const unsigned int bladeMask_ = 0x3F;
58  static const unsigned int panelMask_ = 0x3;
59  static const unsigned int moduleMask_ = 0x3F;
60 };
61 
62 #endif
static const unsigned int sideStartBit_
two bits would be enough, but we could use the number &quot;0&quot; as a wildcard
Definition: PXFDetId.h:48
unsigned int panel() const
panel id
Definition: PXFDetId.h:41
static const unsigned int bladeMask_
Definition: PXFDetId.h:57
static const unsigned int diskStartBit_
Definition: PXFDetId.h:49
static const unsigned int panelMask_
Definition: PXFDetId.h:58
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
unsigned int blade() const
blade id
Definition: PXFDetId.h:38
unsigned int module() const
det id
Definition: PXFDetId.h:44
static const unsigned int panelStartBit_
Definition: PXFDetId.h:51
unsigned int disk() const
disk id
Definition: PXFDetId.h:35
static const unsigned int bladeStartBit_
Definition: PXFDetId.h:50
Definition: DetId.h:17
PXFDetId(uint32_t side, uint32_t disk, uint32_t blade, uint32_t panel, uint32_t module)
Definition: PXFDetId.h:24
uint32_t id_
Definition: DetId.h:69
PXFDetId()
Definition: PXFDetId.cc:3
static const unsigned int diskMask_
Definition: PXFDetId.h:56
static const unsigned int moduleStartBit_
Definition: PXFDetId.h:52
static const unsigned int moduleMask_
Definition: PXFDetId.h:59
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:32
static const unsigned int sideMask_
two bits would be enough, but we could use the number &quot;0&quot; as a wildcard
Definition: PXFDetId.h:55