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 
10 
11 class StripSubdetector : public DetId {
12 public:
13  enum SubDetector { TIB = 3, TID = 4, TOB = 5, TEC = 6 };
14 
16  StripSubdetector(uint32_t rawid) : DetId(rawid) {}
18  StripSubdetector(const DetId &id) : DetId(id) {}
19 
21 
25  unsigned int glued() const {
26  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
27  return (id_ - 1);
28  } else if (((id_ >> sterStartBit_) & sterMask_) == 2) {
29  return (id_ - 2);
30  } else {
31  return 0;
32  }
33  }
34 
36 
40  unsigned int stereo() const {
41  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
42  return ((id_ >> sterStartBit_) & sterMask_);
43  } else {
44  return 0;
45  }
46  }
47 
53  unsigned int partnerDetId() const {
54  if (((id_ >> sterStartBit_) & sterMask_) == 1) {
55  return (id_ + 1);
56  } else if (((id_ >> sterStartBit_) & sterMask_) == 2) {
57  return (id_ - 1);
58  } else {
59  return 0;
60  }
61  }
62 
63 private:
64  static const unsigned int detStartBit_ = 2;
65  static const unsigned int sterStartBit_ = 0;
66 
67  static const unsigned int detMask_ = 0x3;
68  static const unsigned int sterMask_ = 0x3;
69 };
70 
71 #endif
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_
Definition: DetId.h:18
unsigned int stereo() const
stereo
uint32_t id_
Definition: DetId.h:62
StripSubdetector(const DetId &id)
static const unsigned int detMask_