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:
14  enum SubDetector { TIB=3,TID=4,TOB=5,TEC=6 };
15 
17  StripSubdetector(uint32_t rawid) : DetId(rawid) {}
19  StripSubdetector(const DetId& id) : DetId(id) {}
20 
21 
23 
27  unsigned int glued() const
28  {
29  if(((id_>>sterStartBit_)& sterMask_) == 1){
30  return (id_ -1);
31  }else if(((id_>>sterStartBit_)& sterMask_) == 2){
32  return (id_ -2);
33  }else{
34  return 0;
35  }
36  }
37 
39 
43  unsigned int stereo() const
44  {
45  if(((id_>>sterStartBit_)& sterMask_)==1){
46  return ((id_>>sterStartBit_)& sterMask_);
47  }else{
48  return 0;
49  }
50  }
51 
57  unsigned int partnerDetId() const
58  {
59  if(((id_>>sterStartBit_)& sterMask_)==1){
60  return (id_ + 1);
61  }else if(((id_>>sterStartBit_)& sterMask_)==2){
62  return (id_ - 1);
63  }else{
64  return 0;
65  }
66  }
67 
68  private:
69  static const unsigned int detStartBit_= 2;
70  static const unsigned int sterStartBit_= 0;
71 
72  static const unsigned int detMask_= 0x3;
73  static const unsigned int sterMask_= 0x3;
74 
75 
76 };
77 
78 
79 #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:59
StripSubdetector(const DetId &id)
static const unsigned int detMask_