CMS 3D CMS Logo

HcalDcsDetId.cc
Go to the documentation of this file.
3 #include <ostream>
4 
6 }
7 
8 HcalDcsDetId::HcalDcsDetId(uint32_t rawid) : HcalOtherDetId(rawid) {
9 }
10 
12  if ((subdet()!=HcalDcsBarrel) ||
13  (subdet()!=HcalDcsEndcap) ||
14  (subdet()!=HcalDcsOuter) ||
15  (subdet()!=HcalDcsForward)) {
16  throw cms::Exception("Invalid DetId") << "Cannot intialize HcalDcsDetId from "
17  << std::hex << id_ << std::dec;
18  }
19 }
20 
22  unsigned int slc, DcsType ty,
23  unsigned int subchan) : HcalOtherDetId(subd) {
24  id_ |= ((side_or_ring > 0) ? ((1<<kSideOffset)|(side_or_ring<<kRingOffset)) :
25  ((-side_or_ring)<<kRingOffset));
26  id_ |= (slc & 0x1F)<<kSliceOffset;
27  id_ |= (ty & 0xF)<<kTypeOffset;
28  id_ |= (subchan & 0xF)<<kSubChannelOffset;
29 }
30 
32  int ty(HV);
33  do {
34  if (typeString(HcalDcsDetId::DcsType(ty))==str)
35  return HcalDcsDetId::DcsType(ty);
36  } while (++ty != DCS_MAX);
37  return DCSUNKNOWN;
38 }
39 
41  switch(typ) {
42  case HV : return "HV";
43  case BV : return "BV";
44  case CATH : return "CATH";
45  case DYN7 : return "DYN7";
46  case DYN8 : return "DYN8";
47  case RM_TEMP : return "RM_TEMP";
48  case CCM_TEMP : return "CCM_TEMP";
49  case CALIB_TEMP : return "CALIB_TEMP";
50  case LVTTM_TEMP : return "LVTTM_TEMP";
51  case TEMP : return "TEMP";
52  case QPLL_LOCK : return "QPLL_LOCK";
53  case STATUS : return "STATUS";
54  default: return "DCSUNKNOWN";
55  }
56  return "Invalid";
57 }
58 
59 std::ostream& operator<<(std::ostream& s,const HcalDcsDetId& id) {
60  switch (id.subdet()) {
61  case(HcalDcsBarrel) : return s << "(HB" << id.zside() << ' '
62  << id.slice() << ' ' << id.typeString(id.type())
63  << id.subchannel()
64  << ')';
65  case(HcalDcsEndcap) : return s << "(HE" << id.zside() << ' '
66  << id.slice() << ' ' << id.typeString(id.type())
67  << id.subchannel()
68  << ')';
69  case(HcalDcsOuter) : return s << "(HO" << id.ring() << " "
70  << id.slice() << ' ' << id.typeString(id.type())
71  << id.subchannel()
72  << ')';
73  case(HcalDcsForward) : return s << "(HF" << id.zside() << ' '
74  << ((id.type()<=HcalDcsDetId::DYN8)? "Q" : "")
75  << id.slice() << ' ' << id.typeString(id.type())
76  << id.subchannel()
77  << ')';
78  default : return s << id.rawId();
79  }
80 }
static unsigned int const kSideOffset
Definition: HcalDcsDetId.h:54
std::ostream & operator<<(std::ostream &s, const HcalDcsDetId &id)
Definition: HcalDcsDetId.cc:59
HcalOtherSubdetector
Definition: HcalAssistant.h:32
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
static DcsType DcsTypeFromString(const std::string &str)
Definition: HcalDcsDetId.cc:31
Definition: DetId.h:18
static unsigned int const kRingOffset
Definition: HcalDcsDetId.h:55
HcalOtherSubdetector subdet() const
get the category
uint32_t id_
Definition: DetId.h:59
static std::string typeString(DcsType typ)
Definition: HcalDcsDetId.cc:40
#define str(s)
DcsType type() const
Definition: HcalDcsDetId.h:48