Skip to content

Commit

Permalink
Merge CMSSW_9_4_X into CMSSW_9_4_AN_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Jul 4, 2018
2 parents 17de035 + d325d4f commit a08ffc8
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions DataFormats/HcalDetId/src/HcalDetId.cc
Expand Up @@ -8,18 +8,7 @@ const HcalDetId HcalDetId::Undefined(HcalEmpty,0,0,0);
HcalDetId::HcalDetId() : DetId() {
}

HcalDetId::HcalDetId(uint32_t rawid) {
if ((DetId::Detector(rawid>>DetId::kDetOffset)&0xF) != Hcal) {
id_ = rawid;
} else {
HcalSubdetector subdet = (HcalSubdetector)((rawid>>DetId::kSubdetOffset)&0x7);
if ((subdet==HcalBarrel) || (subdet==HcalEndcap) ||
(subdet==HcalOuter) || (subdet==HcalForward)) {
id_ = newForm(rawid);
} else {
id_ = rawid;
}
}
HcalDetId::HcalDetId(uint32_t rawid) : DetId(newForm(rawid)) {
}

HcalDetId::HcalDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int depth) : DetId(Hcal,subdet) {
Expand All @@ -38,12 +27,7 @@ HcalDetId::HcalDetId(const DetId& gen) {
subdet!=HcalTriggerTower && subdet!=HcalOther)) {
throw cms::Exception("Invalid DetId") << "Cannot initialize HcalDetId from " << std::hex << gen.rawId() << std::dec;
}
if ((subdet==HcalBarrel) || (subdet==HcalEndcap) ||
(subdet==HcalOuter) || (subdet==HcalForward)) {
id_ = newForm(gen.rawId());
} else {
id_ = gen.rawId();
}
id_ = newForm(gen.rawId());
} else {
id_ = gen.rawId();
}
Expand All @@ -58,12 +42,7 @@ HcalDetId& HcalDetId::operator=(const DetId& gen) {
subdet!=HcalTriggerTower && subdet!=HcalOther)) {
throw cms::Exception("Invalid DetId") << "Cannot assign HcalDetId from " << std::hex << gen.rawId() << std::dec;
}
if ((subdet==HcalBarrel) || (subdet==HcalEndcap) ||
(subdet==HcalOuter) || (subdet==HcalForward)) {
id_ = newForm(gen.rawId());
} else {
id_ = gen.rawId();
}
id_ = newForm(gen.rawId());
} else {
id_ = gen.rawId();
}
Expand Down Expand Up @@ -257,7 +236,7 @@ std::ostream& operator<<(std::ostream& s,const HcalDetId& id) {
case(HcalForward) : return s << "(HF " << id.ieta() << ',' << id.iphi() << ',' << id.depth() << ')';
case(HcalOuter) : return s << "(HO " << id.ieta() << ',' << id.iphi() << ')';
case(HcalTriggerTower) : return s << "(HT " << id.ieta() << ',' << id.iphi() << ')';
default : return s << std::hex << id.rawId() << std::dec;
default : return s << id.rawId();
}
}

Expand Down

0 comments on commit a08ffc8

Please sign in to comment.