Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:11

0001 #include "CondFormats/HcalObjects/interface/HcalDetIdRelationship.h"
0002 
0003 bool hcalEqualDetId(uint32_t id, const DetId& fId) {
0004   return ((fId.det() == DetId::Hcal && HcalDetId(id) == HcalDetId(fId)) ||
0005           (fId.det() == DetId::Calo && fId.subdetId() == HcalZDCDetId::SubdetectorId &&
0006            HcalZDCDetId(id) == HcalZDCDetId(fId)) ||
0007           (fId.det() != DetId::Hcal && (fId.det() == DetId::Calo && fId.subdetId() != HcalZDCDetId::SubdetectorId) &&
0008            (id == fId.rawId())));
0009 }
0010 
0011 DetId hcalTransformedId(const DetId& aid) {
0012   DetId id;
0013   if (aid.det() == DetId::Hcal) {
0014     HcalDetId hcid(aid);
0015     id = HcalDetId(hcid.subdet(), hcid.ieta(), hcid.iphi(), hcid.depth());
0016   } else if (aid.det() == DetId::Calo && aid.subdetId() == HcalZDCDetId::SubdetectorId) {
0017     HcalZDCDetId hcid(aid);
0018     id = HcalZDCDetId(hcid.section(), (hcid.zside() > 0), hcid.channel());
0019   } else {
0020     id = aid;
0021   }
0022   return id;
0023 }