Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-hcx335 Add protection to eta values for phase2 scenario in HCAL geometry #39920

Merged
merged 1 commit into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CondFormats/GeometryObjects/interface/HcalParameters.h
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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