CMS 3D CMS Logo

HcalDcsDetId.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef DataFormats_HcalDetId_HcalDcsDetId_h
3 #define DataFormats_HcalDetId_HcalDcsDetId_h
4 
5 #include <iosfwd>
6 //#include <string>
9 
27 class HcalDcsDetId : public HcalOtherDetId {
28 public :
29 
30  enum DcsType{ HV = 1, BV = 2, CATH = 3, DYN7 = 4, DYN8 = 5,
31  RM_TEMP = 6, CCM_TEMP = 7, CALIB_TEMP = 8, LVTTM_TEMP = 9,
32  TEMP = 10, QPLL_LOCK = 11, STATUS = 12, DCSUNKNOWN = 15,
33  DCS_MAX = 16 };
34 
35  HcalDcsDetId ();
36  HcalDcsDetId(uint32_t rawid);
37  HcalDcsDetId(const DetId& id);
38  HcalDcsDetId(HcalOtherSubdetector subd, int side_or_ring, unsigned int slc,
39  DcsType ty, unsigned int subchan);
40 
41  static DcsType DcsTypeFromString(const std::string& str );
42  static std::string typeString (DcsType typ);
43 
44 
45  int zside() const { return (((id_>>kSideOffset)&0x1)? 1 : -1); }
46  int ring() const { return zside()*((id_>>kRingOffset)&0x3); }
47  int slice() const { return ((id_>>kSliceOffset)&0x1F); }
48  DcsType type() const { return DcsType((id_>>kTypeOffset)&0xF); }
49  int subchannel() const { return ((id_>>kSubChannelOffset)&0xF); }
50 
51  static const int maxLinearIndex = 0x16800;
52 
53 protected :
54  static unsigned int const kSideOffset = 19;
55  static unsigned int const kRingOffset = 17;
56  static unsigned int const kSliceOffset = 12;
57  static unsigned int const kTypeOffset = 8;
58  static unsigned int const kSubChannelOffset = 4;
59 };
60 
61 std::ostream& operator<<(std::ostream&,const HcalDcsDetId& id);
62 
63 #endif
int subchannel() const
Definition: HcalDcsDetId.h:49
static const int maxLinearIndex
Definition: HcalDcsDetId.h:51
static unsigned int const kSideOffset
Definition: HcalDcsDetId.h:54
HcalOtherSubdetector
Definition: HcalAssistant.h:32
std::ostream & operator<<(std::ostream &, const HcalDcsDetId &id)
Definition: HcalDcsDetId.cc:59
static unsigned int const kTypeOffset
Definition: HcalDcsDetId.h:57
static unsigned int const kSliceOffset
Definition: HcalDcsDetId.h:56
static unsigned int const kSubChannelOffset
Definition: HcalDcsDetId.h:58
int zside() const
Definition: HcalDcsDetId.h:45
static DcsType DcsTypeFromString(const std::string &str)
Definition: HcalDcsDetId.cc:31
Definition: DetId.h:18
static unsigned int const kRingOffset
Definition: HcalDcsDetId.h:55
uint32_t id_
Definition: DetId.h:62
int slice() const
Definition: HcalDcsDetId.h:47
static std::string typeString(DcsType typ)
Definition: HcalDcsDetId.cc:40
#define str(s)
int ring() const
Definition: HcalDcsDetId.h:46
DcsType type() const
Definition: HcalDcsDetId.h:48