CMS 3D CMS Logo

HcalDetIdRelationship.cc
Go to the documentation of this file.
2 
3 bool hcalEqualDetId(uint32_t id, const DetId& fId) {
4  return ((fId.det() == DetId::Hcal && HcalDetId(id) == HcalDetId(fId)) ||
5  (fId.det() == DetId::Calo && fId.subdetId() == HcalZDCDetId::SubdetectorId &&
6  HcalZDCDetId(id) == HcalZDCDetId(fId)) ||
7  (fId.det() != DetId::Hcal && (fId.det() == DetId::Calo && fId.subdetId() != HcalZDCDetId::SubdetectorId) &&
8  (id == fId.rawId())));
9 }
10 
12  DetId id;
13  if (aid.det() == DetId::Hcal) {
14  HcalDetId hcid(aid);
15  id = HcalDetId(hcid.subdet(), hcid.ieta(), hcid.iphi(), hcid.depth());
16  } else if (aid.det() == DetId::Calo && aid.subdetId() == HcalZDCDetId::SubdetectorId) {
17  HcalZDCDetId hcid(aid);
18  id = HcalZDCDetId(hcid.section(), (hcid.zside() > 0), hcid.channel());
19  } else {
20  id = aid;
21  }
22  return id;
23 }
DetId hcalTransformedId(const DetId &aid)
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
bool hcalEqualDetId(uint32_t id, const DetId &fId)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Definition: DetId.h:48
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr Section section() const
get the section
Definition: HcalZDCDetId.h:84
static constexpr int32_t SubdetectorId
Definition: HcalZDCDetId.h:35
constexpr int32_t channel() const
get the channel
Definition: HcalZDCDetId.h:104
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:82
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164