Skip to content

Commit

Permalink
Fix error reported from static analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Jul 9, 2020
1 parent 4a3eb91 commit 27e1a85
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Geometry/HGCalCommonData/src/HGCalDDDConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1315,16 +1315,19 @@ std::pair<int, int> HGCalDDDConstants::waferTypeRotation(
int layer, int waferU, int waferV, bool fromFile, bool debug) const {
int type(HGCalTypes::WaferOut), rotn(0);
int wl = HGCalWaferIndex::waferIndex(layer, waferU, waferV);
bool endOfList(true);
if (fromFile && (waferFileSize() > 0)) {
auto itr = hgpar_->waferInfoMap_.find(wl);
if (itr != hgpar_->waferInfoMap_.end()) {
endOfList = (itr != hgpar_->waferInfoMap_.end());
if (endOfList) {
type = (itr->second).part;
rotn = (itr->second).orient;
}
} else {
auto itr = hgpar_->waferTypes_.find(wl);
if ((mode_ == HGCalGeometryMode::Hexagon8) || (mode_ == HGCalGeometryMode::Hexagon8Full)) {
if (itr != hgpar_->waferTypes_.end()) {
endOfList = (itr != hgpar_->waferTypes_.end());
if (endOfList) {
if ((itr->second).second < HGCalWaferMask::k_OffsetRotation) {
rotn = (itr->second).second;
if ((itr->second).first == HGCalGeomTools::k_allCorners) {
Expand All @@ -1346,8 +1349,8 @@ std::pair<int, int> HGCalDDDConstants::waferTypeRotation(
#ifdef EDM_ML_DEBUG
if (debug)
edm::LogVerbatim("HGCalGeom") << "waferTypeRotation: Layer " << layer << " Wafer " << waferU << ":" << waferV
<< " Index " << std::hex << wl << std::dec << ":"
<< (itr != hgpar_->waferTypes_.end()) << " Type " << type << " Rotation " << rotn;
<< " Index " << std::hex << wl << std::dec << ":" << endOfList << " Type " << type
<< " Rotation " << rotn;
#endif
return std::make_pair(type, rotn);
}
Expand Down

0 comments on commit 27e1a85

Please sign in to comment.