CMS 3D CMS Logo

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,
25  uint32_t disk,
26  uint32_t blade,
27  uint32_t panel,
29  id_ |= (side& sideMask_) << sideStartBit_ |
30  (disk& diskMask_) << diskStartBit_ |
31  (blade& bladeMask_) << bladeStartBit_ |
32  (panel& panelMask_) << panelStartBit_ |
33  (module& moduleMask_) << moduleStartBit_ ;
34  }
35 
36 
38  unsigned int side() const{
39  return int((id_>>sideStartBit_) & sideMask_);
40  }
41 
43  unsigned int disk() const{
44  return int((id_>>diskStartBit_) & diskMask_);
45  }
46 
48  unsigned int blade() const
49  { return ((id_>>bladeStartBit_) & bladeMask_) ;}
50 
52  unsigned int panel() const
53  { return ((id_>>panelStartBit_) & panelMask_) ;}
54 
56  unsigned int module() const
57  { return ((id_>>moduleStartBit_) & moduleMask_) ;}
58 
59  private:
61  static const unsigned int sideStartBit_= 23;
62  static const unsigned int diskStartBit_= 16;
63  static const unsigned int bladeStartBit_= 10;
64  static const unsigned int panelStartBit_= 8;
65  static const unsigned int moduleStartBit_= 2;
67 
68  static const unsigned int sideMask_= 0x3;
69  static const unsigned int diskMask_= 0xF;
70  static const unsigned int bladeMask_= 0x3F;
71  static const unsigned int panelMask_= 0x3;
72  static const unsigned int moduleMask_= 0x3F;
73 };
74 
75 #endif
static const unsigned int sideStartBit_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: PXFDetId.h:61
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
static const unsigned int bladeMask_
Definition: PXFDetId.h:70
static const unsigned int diskStartBit_
Definition: PXFDetId.h:62
static const unsigned int panelMask_
Definition: PXFDetId.h:71
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
unsigned int module() const
det id
Definition: PXFDetId.h:56
static const unsigned int panelStartBit_
Definition: PXFDetId.h:64
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
static const unsigned int bladeStartBit_
Definition: PXFDetId.h:63
Definition: DetId.h:18
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:55
PXFDetId()
Definition: PXFDetId.cc:3
static const unsigned int diskMask_
Definition: PXFDetId.h:69
static const unsigned int moduleStartBit_
Definition: PXFDetId.h:65
static const unsigned int moduleMask_
Definition: PXFDetId.h:72
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
static const unsigned int sideMask_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: PXFDetId.h:68
std::ostream & operator<<(std::ostream &os, const PXFDetId &id)
Definition: PXFDetId.cc:11
Definition: vlib.h:208