CMS 3D CMS Logo

StripSubdetector.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiStripDetId_StripSubdetector_H
2 #define DataFormats_SiStripDetId_StripSubdetector_H
3 
11 
12 class StripSubdetector : public DetId {
13 public:
20 
22  StripSubdetector(uint32_t rawid) : DetId(rawid) {}
24  StripSubdetector(const DetId &id) : DetId(id) {}
25 
27 
31  unsigned int glued() const {
32  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
33  return (id_ - 1);
34  } else if (((id_ >> sterStartBit_) & sterMask_) == 2) {
35  return (id_ - 2);
36  } else {
37  return 0;
38  }
39  }
40 
42 
46  unsigned int stereo() const {
47  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
48  return ((id_ >> sterStartBit_) & sterMask_);
49  } else {
50  return 0;
51  }
52  }
53 
59  unsigned int partnerDetId() const {
60  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
61  return (id_ + 1);
62  } else if (((id_ >> sterStartBit_) & sterMask_) == 2) {
63  return (id_ - 1);
64  } else {
65  return 0;
66  }
67  }
68 
69 private:
70  static const unsigned int detStartBit_ = 2;
71  static const unsigned int sterStartBit_ = 0;
72 
73  static const unsigned int detMask_ = 0x3;
74  static const unsigned int sterMask_ = 0x3;
75 };
76 
77 #endif
static constexpr auto TEC
static const unsigned int detStartBit_
StripSubdetector(uint32_t rawid)
static const unsigned int sterStartBit_
unsigned int partnerDetId() const
unsigned int glued() const
glued
static const unsigned int sterMask_
static constexpr auto TOB
Definition: DetId.h:17
unsigned int stereo() const
stereo
static constexpr auto TIB
uint32_t id_
Definition: DetId.h:69
static constexpr auto UNKNOWN
StripSubdetector(const DetId &id)
static constexpr auto TID
#define constexpr
static const unsigned int detMask_