Skip to content

Commit

Permalink
Merge pull request #39921 from bsunanda/Run3-hcx336
Browse files Browse the repository at this point in the history
Run3-hcx336 Backport #39920 to 12_5_X to protect against wrong ieta values which happens for wrong mixing of signal and PU SIM results
  • Loading branch information
cmsbuild committed Nov 1, 2022
2 parents c19c2f9 + 8cf6650 commit fc52d5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CondFormats/GeometryObjects/interface/HcalParameters.h
Expand Up @@ -5,8 +5,8 @@

class HcalParameters {
public:
HcalParameters(void) {}
~HcalParameters(void) {}
HcalParameters(void) = default;
~HcalParameters(void) = default;

struct LayerItem {
unsigned int layer;
Expand Down Expand Up @@ -63,6 +63,7 @@ class HcalParameters {
std::vector<LayerItem> layerGroupEtaSim, layerGroupEtaRec;
int topologyMode;

uint32_t etaMaxHBHE() const { return static_cast<uint32_t>(etagroup.size()); }
COND_SERIALIZABLE;
};

Expand Down
7 changes: 6 additions & 1 deletion Geometry/HcalCommonData/src/HcalDDDRecConstants.cc
Expand Up @@ -160,8 +160,13 @@ std::pair<double, double> HcalDDDRecConstants::getEtaPhi(const int& subdet, cons
}

HcalDDDRecConstants::HcalID HcalDDDRecConstants::getHCID(int subdet, int keta, int iphi, int lay, int idepth) const {
int ieta = (keta > 0) ? keta : -keta;
uint32_t ieta = (keta > 0) ? keta : -keta;
int zside = (keta > 0) ? 1 : -1;
if ((ieta > hpar->etaMaxHBHE()) &&
((subdet == static_cast<int>(HcalOuter)) || (subdet == static_cast<int>(HcalBarrel)) ||
(subdet == static_cast<int>(HcalEndcap))))
throw cms::Exception("HcalDDDRecConstants")
<< "getHCID: receives an eta value " << ieta << " outside the limit (1:" << hpar->etaMaxHBHE() << ")";
int eta(ieta), phi(iphi), depth(idepth);
if ((subdet == static_cast<int>(HcalOuter)) ||
((subdet == static_cast<int>(HcalBarrel)) && (lay > maxLayerHB_ + 1))) {
Expand Down

0 comments on commit fc52d5f

Please sign in to comment.