CMS 3D CMS Logo

PXBDetId.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiStripDetId_PXBDetId_H
2 #define DataFormats_SiStripDetId_PXBDetId_H
3 
4 #include <ostream>
7 
12 class PXBDetId;
13 
14 std::ostream& operator<<(std::ostream& os, const PXBDetId& id);
15 
16 class PXBDetId : public DetId {
17 public:
19  PXBDetId();
21  PXBDetId(uint32_t rawid);
23  PXBDetId(const DetId& id);
24 
25  PXBDetId(uint32_t layer, uint32_t ladder, uint32_t module) : DetId(DetId::Tracker, PixelSubdetector::PixelBarrel) {
28  }
29 
31  unsigned int layer() const { return int((id_ >> layerStartBit_) & layerMask_); }
32 
34  unsigned int ladder() const { return ((id_ >> ladderStartBit_) & ladderMask_); }
35 
37  unsigned int module() const { return ((id_ >> moduleStartBit_) & moduleMask_); }
38 
39 private:
41  static const unsigned int layerStartBit_ = 16;
42  static const unsigned int ladderStartBit_ = 8;
43  static const unsigned int moduleStartBit_ = 2;
45  static const unsigned int layerMask_ = 0xF;
46  static const unsigned int ladderMask_ = 0xFF;
47  static const unsigned int moduleMask_ = 0x3F;
48 };
49 
50 #endif
PixelSubdetector
Definition: PixelSubdetector.h:9
PXBDetId::module
unsigned int module() const
det id
Definition: PXBDetId.h:37
PixelSubdetector.h
PXBDetId::ladder
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:34
PXBDetId::PXBDetId
PXBDetId(uint32_t layer, uint32_t ladder, uint32_t module)
Definition: PXBDetId.h:25
PXBDetId::layer
unsigned int layer() const
layer id
Definition: PXBDetId.h:31
DetId
Definition: DetId.h:17
GeomDetEnumerators::PixelBarrel
Definition: GeomDetEnumerators.h:11
PXBDetId::moduleMask_
static const unsigned int moduleMask_
Definition: PXBDetId.h:47
operator<<
std::ostream & operator<<(std::ostream &os, const PXBDetId &id)
Definition: PXBDetId.cc:8
DetId::Tracker
Definition: DetId.h:25
DetId::id_
uint32_t id_
Definition: DetId.h:69
PXBDetId::moduleStartBit_
static const unsigned int moduleStartBit_
Definition: PXBDetId.h:43
PXBDetId::layerStartBit_
static const unsigned int layerStartBit_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: PXBDetId.h:41
createfilelist.int
int
Definition: createfilelist.py:10
module
Definition: vlib.h:198
DetId.h
PXBDetId::layerMask_
static const unsigned int layerMask_
two bits would be enough, but we could use the number "0" as a wildcard
Definition: PXBDetId.h:45
PXBDetId::ladderStartBit_
static const unsigned int ladderStartBit_
Definition: PXBDetId.h:42
PXBDetId
Definition: PXBDetId.h:16
PXBDetId::ladderMask_
static const unsigned int ladderMask_
Definition: PXBDetId.h:46
PXBDetId::PXBDetId
PXBDetId()
Definition: PXBDetId.cc:3