From 22b5a7b069b13fc7fc9dd2bf200b0f2959edf730 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sun, 5 Nov 2023 15:46:59 +0100 Subject: [PATCH] Code check --- Geometry/CaloTopology/src/HGCalTopology.cc | 4 ++-- .../CaloTopology/test/HGCalTopologyTester.cc | 4 ++-- Geometry/HGCalGeometry/src/HGCalGeometry.cc | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Geometry/CaloTopology/src/HGCalTopology.cc b/Geometry/CaloTopology/src/HGCalTopology.cc index 95da9a843e046..30cf19659b52e 100644 --- a/Geometry/CaloTopology/src/HGCalTopology.cc +++ b/Geometry/CaloTopology/src/HGCalTopology.cc @@ -467,8 +467,8 @@ bool HGCalTopology::valid(const DetId& idin) const { HGCalTopology::DecodedDetId id = decode(idin); bool flag; if (waferHexagon6()) { - flag = (idin.det() == det_ && idin.subdetId() == static_cast(subdet_) && id.iCell1 >= 0 && id.iCell1 < cells_ && - id.iLay > 0 && id.iLay <= layers_ && id.iSec1 >= 0 && id.iSec1 <= sectors_); + flag = (idin.det() == det_ && idin.subdetId() == static_cast(subdet_) && id.iCell1 >= 0 && + id.iCell1 < cells_ && id.iLay > 0 && id.iLay <= layers_ && id.iSec1 >= 0 && id.iSec1 <= sectors_); if (flag) flag = hdcons_.isValidHex(id.iLay, id.iSec1, id.iCell1, true); } else if (tileTrapezoid()) { diff --git a/Geometry/CaloTopology/test/HGCalTopologyTester.cc b/Geometry/CaloTopology/test/HGCalTopologyTester.cc index a80f7c1a801ce..c15fe4d92c1a0 100644 --- a/Geometry/CaloTopology/test/HGCalTopologyTester.cc +++ b/Geometry/CaloTopology/test/HGCalTopologyTester.cc @@ -75,9 +75,9 @@ void HGCalTopologyTester::doTest(const HGCalTopology& topology) { for (unsigned int i = 0; i < type_.size(); ++i) { DetId id; if (topology.isHFNose()) { - id = HFNoseDetId(1, type_[i], layer_[i], sec1_[i], sec2_[i], cell1_[i], cell2_[i]); + id = HFNoseDetId(1, type_[i], layer_[i], sec1_[i], sec2_[i], cell1_[i], cell2_[i]); } else if (detectorName_ == "HGCalEESensitive") { - id = HGCSiliconDetId(DetId::HGCalEE, 1, type_[i], layer_[i], sec1_[i], sec2_[i], cell1_[i], cell2_[i]); + id = HGCSiliconDetId(DetId::HGCalEE, 1, type_[i], layer_[i], sec1_[i], sec2_[i], cell1_[i], cell2_[i]); } else if (detectorName_ == "HGCalHESiliconSensitive") { id = HGCSiliconDetId(DetId::HGCalHSi, 1, type_[i], layer_[i], sec1_[i], sec2_[i], cell1_[i], cell2_[i]); } else if (detectorName_ == "HGCalHEScintillatorSensitive") { diff --git a/Geometry/HGCalGeometry/src/HGCalGeometry.cc b/Geometry/HGCalGeometry/src/HGCalGeometry.cc index 1e2cc00241f0f..bd4f80c5c6664 100644 --- a/Geometry/HGCalGeometry/src/HGCalGeometry.cc +++ b/Geometry/HGCalGeometry/src/HGCalGeometry.cc @@ -139,10 +139,10 @@ void HGCalGeometry::newCell( m_validIds.emplace_back(idc); #ifdef EDM_ML_DEBUG ++cellSelect; - if (idc.det() == DetId::Forward) - edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HFNoseDetId(idc); - else - edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HGCSiliconDetId(idc); + if (idc.det() == DetId::Forward) + edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HFNoseDetId(idc); + else + edm::LogVerbatim("HGCalGeom") << "Valid Id [" << u << ", " << v << "] " << HGCSiliconDetId(idc); #endif } } @@ -224,10 +224,13 @@ GlobalPoint HGCalGeometry::getPosition(const DetId& detid, bool debug) const { << " Global " << glob; } else { if (debug) { - if (detid.det() == DetId::Forward) - edm::LogVerbatim("HGCalGeom") << "getPosition for " << HFNoseDetId(detid) << " Layer " << id.iLay << " Wafer " << id.iSec1 << ":" << id.iSec2 << " Cell " << id.iCell1 << ":" << id.iCell2; - else - edm::LogVerbatim("HGCalGeom") << "getPosition for " << HGCSiliconDetId(detid) << " Layer " << id.iLay << " Wafer " << id.iSec1 << ":" << id.iSec2 << " Cell " << id.iCell1 << ":" << id.iCell2; + if (detid.det() == DetId::Forward) + edm::LogVerbatim("HGCalGeom") << "getPosition for " << HFNoseDetId(detid) << " Layer " << id.iLay << " Wafer " + << id.iSec1 << ":" << id.iSec2 << " Cell " << id.iCell1 << ":" << id.iCell2; + else + edm::LogVerbatim("HGCalGeom") << "getPosition for " << HGCSiliconDetId(detid) << " Layer " << id.iLay + << " Wafer " << id.iSec1 << ":" << id.iSec2 << " Cell " << id.iCell1 << ":" + << id.iCell2; } xy = m_topology.dddConstants().locateCell( id.zSide, id.iLay, id.iSec1, id.iSec2, id.iCell1, id.iCell2, true, true, false, debug);