CMS 3D CMS Logo

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