Skip to content

Commit

Permalink
Merge pull request #12057 from bsunanda/Run2-hcx44
Browse files Browse the repository at this point in the history
bsunanda:Run2-hcx44 Add protection to HcalTopology
  • Loading branch information
davidlange6 committed Oct 27, 2015
2 parents a7a0ed3 + 32f380f commit 6895a28
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Geometry/CaloTopology/src/HcalTopology.cc
Expand Up @@ -840,18 +840,20 @@ double HcalTopology::etaMax(HcalSubdetector subdet) const {
return eta;
}
std::pair<double,double> HcalTopology::etaRange(HcalSubdetector subdet,
int ieta) const {

int keta) const {
int ieta = (keta > 0) ? keta : -keta;
if (subdet == HcalForward) {
unsigned int ii = (unsigned int)(ieta-firstHFRing_);
return std::pair<double,double>(etaTableHF[ii],etaTableHF[ii+1]);
} else {
if (mode_==HcalTopologyMode::LHC && ieta == lastHERing_-1) {
return std::pair<double,double>(etaTable[ieta-1],etaTable[ieta+1]);
} else {
return std::pair<double,double>(etaTable[ieta-1],etaTable[ieta]);
if (ieta >= firstHFRing_) {
unsigned int ii = (unsigned int)(ieta-firstHFRing_);
if (ii+1 < etaTableHF.size())
return std::pair<double,double>(etaTableHF[ii],etaTableHF[ii+1]);
}
} else {
int ietal = (mode_==HcalTopologyMode::LHC && ieta == lastHERing_-1) ? (ieta+1) : ieta;
if ((ietal < (int)(etaTable.size())) && (ieta > 0))
return std::pair<double,double>(etaTable[ieta-1],etaTable[ietal]);
}
return std::pair<double,double>(0,0);
}

unsigned int HcalTopology::detId2denseIdPreLS1 (const DetId& id) const {
Expand Down Expand Up @@ -972,7 +974,7 @@ unsigned int HcalTopology::detId2denseIdHT(const DetId& id) const {

unsigned int HcalTopology::detId2denseIdCALIB(const DetId& id) const {
HcalCalibDetId tid(id);
int channel = tid.cboxChannel();
int channel = tid.cboxChannel();
int ieta = tid.ieta();
int iphi = tid.iphi();
int zside = tid.zside();
Expand Down

0 comments on commit 6895a28

Please sign in to comment.