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)) ||
6  (fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (id == fId.rawId())));
7 }
8 
10  DetId id;
11  if (aid.det()==DetId::Hcal) {
12  HcalDetId hcid(aid);
13  id = HcalDetId(hcid.subdet(),hcid.ieta(),hcid.iphi(),hcid.depth());
14  } else if (aid.det()==DetId::Calo && aid.subdetId()==HcalZDCDetId::SubdetectorId) {
15  HcalZDCDetId hcid(aid);
16  id = HcalZDCDetId(hcid.section(),(hcid.zside()>0),hcid.channel());
17  } else {
18  id = aid;
19  }
20  return id;
21 }
22 
DetId hcalTransformedId(const DetId &aid)
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
int depth() const
get the tower depth
Definition: HcalDetId.h:166
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
Definition: DetId.h:41
bool hcalEqualDetId(uint32_t id, const DetId &fId)
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
Definition: DetId.h:18
static const int SubdetectorId
Definition: HcalZDCDetId.h:25
int channel() const
get the channel
Definition: HcalZDCDetId.cc:62
Section section() const
get the section
Definition: HcalZDCDetId.cc:47
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:39