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 }
HcalOther
Definition: HcalAssistant.h:38
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalCalibDetId
Definition: HcalCalibDetId.h:45
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
HcalGenericDetId::HcalGenEmpty
Definition: HcalGenericDetId.h:18
DetId::Hcal
Definition: DetId.h:28
HcalGenericDetId::HcalGenEndcap
Definition: HcalGenericDetId.h:20
HcalGenericDetId.h
HcalCastorDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalCastorDetId.h:28
HcalGenericDetId::HcalGenCastor
Definition: HcalGenericDetId.h:26
HcalBarrel
Definition: HcalAssistant.h:33
HcalZDCDetId.h
DetId::Calo
Definition: DetId.h:29
HcalOtherEmpty
Definition: HcalAssistant.h:40
HcalGenericDetId::isHcalZDCDetId
bool isHcalZDCDetId() const
Definition: HcalGenericDetId.cc:79
HcalGenericDetId::HcalGenZDC
Definition: HcalGenericDetId.h:24
HcalZDCDetId
Definition: HcalZDCDetId.h:16
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalGenericDetId::isHcalCalibDetId
bool isHcalCalibDetId() const
Definition: HcalGenericDetId.cc:69
HcalGenericDetId::HcalGenUnknown
Definition: HcalGenericDetId.h:27
HcalOuter
Definition: HcalAssistant.h:35
HcalCalibDetId.h
HcalCalibration
Definition: HcalAssistant.h:40
HcalZDCDetId::SubdetectorId
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
HcalCastorDetId
Definition: HcalCastorDetId.h:23
HcalTrigTowerDetId.h
HcalGenericDetId::isHcalTrigTowerDetId
bool isHcalTrigTowerDetId() const
Definition: HcalGenericDetId.cc:74
HcalOtherSubdetector
HcalOtherSubdetector
Definition: HcalAssistant.h:40
HcalGenericDetId::HcalGenericSubdetector
HcalGenericSubdetector
Definition: HcalGenericDetId.h:17
HcalDetId.h
HcalGenericDetId::HcalGenTriggerTower
Definition: HcalGenericDetId.h:23
HcalDetId
Definition: HcalDetId.h:12
HcalGenericDetId::otherSubdet
HcalOtherSubdetector otherSubdet() const
Definition: HcalGenericDetId.cc:15
HcalGenericDetId::HcalGenBarrel
Definition: HcalGenericDetId.h:19
HcalGenericDetId::isHcalCastorDetId
bool isHcalCastorDetId() const
Definition: HcalGenericDetId.cc:84
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition: HcalGenericDetId.cc:64
HcalEndcap
Definition: HcalAssistant.h:34
operator<<
std::ostream & operator<<(std::ostream &s, const HcalGenericDetId &id)
Definition: HcalGenericDetId.cc:89
HcalGenericDetId::genericSubdet
HcalGenericSubdetector genericSubdet() const
Definition: HcalGenericDetId.cc:21
HcalTriggerTower
Definition: HcalAssistant.h:37
HcalGenericDetId::HcalGenOuter
Definition: HcalGenericDetId.h:21
HcalCastorDetId.h
HcalGenericDetId::HcalGenForward
Definition: HcalGenericDetId.h:22
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
HcalGenericDetId::HcalGenCalibration
Definition: HcalGenericDetId.h:25
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14