CMS 3D CMS Logo

HcalGenericDetId.cc
Go to the documentation of this file.
1 
12 #include <iostream>
13 #include <cstdlib>
14 
17  return HcalOtherEmpty;
18  return HcalOtherSubdetector((rawId() >> 20) & 0x1F);
19 }
20 
22  if (null())
23  return HcalGenEmpty;
24  switch (det()) {
25  case Calo:
26  switch (subdetId()) {
28  return HcalGenZDC;
30  return HcalGenCastor;
31  default:
32  return HcalGenUnknown;
33  }
34  case Hcal:
35  switch (HcalSubdetector(subdetId())) {
36  case 0:
37  return HcalGenEmpty;
38  case HcalBarrel:
39  return HcalGenBarrel;
40  case HcalEndcap:
41  return HcalGenEndcap;
42  case HcalOuter:
43  return HcalGenOuter;
44  case HcalForward:
45  return HcalGenForward;
46  case HcalTriggerTower:
47  return HcalGenTriggerTower;
48  case HcalOther:
49  switch (otherSubdet()) {
50  case HcalCalibration:
51  return HcalGenCalibration;
52  default:
53  return HcalGenUnknown;
54  }
55  default:
56  return HcalGenUnknown;
57  }
58  default:
59  return HcalGenUnknown;
60  }
61  return HcalGenUnknown;
62 }
63 
66  return subdet == HcalGenBarrel || subdet == HcalGenEndcap || subdet == HcalGenOuter || subdet == HcalGenForward;
67 }
68 
71  return subdet == HcalGenCalibration;
72 }
73 
76  return subdet == HcalGenTriggerTower;
77 }
78 
81  return subdet == HcalGenZDC;
82 }
83 
86  return subdet == HcalGenCastor;
87 }
88 
89 std::ostream& operator<<(std::ostream& s, const HcalGenericDetId& id) {
90  if (id.null())
91  s << "(Null Id)";
92  else
93  switch (id.genericSubdet()) {
98  s << HcalDetId(id);
99  break;
101  s << HcalTrigTowerDetId(id);
102  break;
104  s << HcalZDCDetId(id);
105  break;
107  s << HcalCastorDetId(id);
108  break;
110  s << HcalCalibDetId(id);
111  break;
112  default:
113  s << "(Hcal Unknown Id: 0x" << std::hex << id.rawId() << std::dec << ')';
114  }
115  return s;
116 }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr bool null() const
is this a null id ?
Definition: DetId.h:59
bool isHcalDetId() const
HcalOtherSubdetector
Definition: HcalAssistant.h:40
HcalSubdetector
Definition: HcalAssistant.h:31
bool isHcalCastorDetId() const
std::ostream & operator<<(std::ostream &s, const HcalGenericDetId &id)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static const int SubdetectorId
bool isHcalCalibDetId() const
HcalGenericSubdetector genericSubdet() const
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
bool isHcalZDCDetId() const
bool isHcalTrigTowerDetId() const
HcalOtherSubdetector otherSubdet() const