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:
15  static constexpr auto UNKNOWN = SiStripSubdetector::UNKNOWN;
16  static constexpr auto TIB = SiStripSubdetector::TIB;
17  static constexpr auto TID = SiStripSubdetector::TID;
18  static constexpr auto TOB = SiStripSubdetector::TOB;
19  static constexpr auto TEC = SiStripSubdetector::TEC;
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
StripSubdetector::glued
unsigned int glued() const
glued
Definition: StripSubdetector.h:31
StripSubdetector::stereo
unsigned int stereo() const
stereo
Definition: StripSubdetector.h:46
StripSubdetector
Definition: StripSubdetector.h:12
StripSubdetector::detMask_
static const unsigned int detMask_
Definition: StripSubdetector.h:73
StripSubdetector::detStartBit_
static const unsigned int detStartBit_
Definition: StripSubdetector.h:70
SiStripSubdetector::TEC
Definition: SiStripEnums.h:5
SiStripSubdetector::TOB
Definition: SiStripEnums.h:5
DetId
Definition: DetId.h:17
StripSubdetector::sterMask_
static const unsigned int sterMask_
Definition: StripSubdetector.h:74
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
DetId::id_
uint32_t id_
Definition: DetId.h:69
StripSubdetector::UNKNOWN
static constexpr auto UNKNOWN
Definition: StripSubdetector.h:15
SiStripSubdetector::TIB
Definition: SiStripEnums.h:5
SiStripSubdetector::UNKNOWN
Definition: SiStripEnums.h:5
SiStripEnums.h
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
DetId.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
StripSubdetector::partnerDetId
unsigned int partnerDetId() const
Definition: StripSubdetector.h:59
StripSubdetector::StripSubdetector
StripSubdetector(const DetId &id)
Definition: StripSubdetector.h:24
StripSubdetector::sterStartBit_
static const unsigned int sterStartBit_
Definition: StripSubdetector.h:71
SiStripSubdetector::Subdetector
Subdetector
Definition: SiStripEnums.h:5
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
SiStripSubdetector::TID
Definition: SiStripEnums.h:5
StripSubdetector::StripSubdetector
StripSubdetector(uint32_t rawid)
Definition: StripSubdetector.h:22