From 3745f300412717eab292621c6cc6802ef56215bf Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 8 Oct 2024 20:24:32 +0200 Subject: [PATCH 1/8] Correct the HcalTopology class for 2 new geometry modes - backport #46308 --- .../Geometry/test/calogeometry2026writer.py | 5 ++- Geometry/CaloTopology/src/HcalTopology.cc | 40 ++++++++----------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/CondTools/Geometry/test/calogeometry2026writer.py b/CondTools/Geometry/test/calogeometry2026writer.py index 5ccd23807fa1f..77d0816049103 100644 --- a/CondTools/Geometry/test/calogeometry2026writer.py +++ b/CondTools/Geometry/test/calogeometry2026writer.py @@ -1,8 +1,9 @@ import FWCore.ParameterSet.Config as cms -process = cms.Process("CaloGeometryWriter") +from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 +process = cms.Process("CaloGeometryWriter",Phase2C17I13M9) process.load('CondCore.CondDB.CondDB_cfi') -process.load('Configuration.Geometry.GeometryExtended2026D41_cff') +process.load('Configuration.Geometry.GeometryExtended2026D110_cff') process.load('Geometry.CaloEventSetup.CaloGeometry2026DBWriter_cfi') process.load('CondTools.Geometry.HcalParametersWriter_cff') diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index c550077058b81..ebd6aed2ba8e6 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -64,7 +64,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos } else { nEtaHE_ = (lastHERing_ - firstHERing_ + 1); } - if (mode_ == HcalTopologyMode::LHC) { + if ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal @@ -72,7 +72,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos HFSize_ = kHFSizePreLS1; // ieta * iphi * depth * 2 CALIBSize_ = kCALIBSizePreLS1; numberOfShapes_ = 87; - } else if (mode_ == HcalTopologyMode::SLHC) { // need to know more eventually + } else if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) { // need to know more eventually topoVersion_ = 10; HBSize_ = nEtaHB_ * IPHI_MAX * maxDepthHB_ * 2; HESize_ = nEtaHE_ * maxPhiHE_ * maxDepthHE_ * 2; @@ -195,18 +195,14 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HFSize_(kHFSizePreLS1), HTSize_(kHTSizePreLS1), CALIBSize_(kCALIBSizePreLS1), - numberOfShapes_( - ((mode == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run3) || (mode_ == HcalTopologyMode::Run4)) - ? 500 - : 87) { - if (mode_ == HcalTopologyMode::LHC) { + numberOfShapes_(((mode == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) ? 500 : 87) { + if ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { // need to know more eventually + } else if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) { // need to know more eventually HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 @@ -571,8 +567,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { if (ok) { if (subdet == HcalBarrel) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { + if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { if ((aieta > lastHBRing()) || (depth > hcons_->getMaxDepth(0, aieta, iphi, zside)) || (depth < hcons_->getMinDepth(0, aieta, iphi, zside))) ok = false; @@ -581,8 +576,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { ok = false; } } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { + if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { if ((depth > hcons_->getMaxDepth(1, aieta, iphi, zside)) || (depth < hcons_->getMinDepth(1, aieta, iphi, zside)) || (aieta < firstHERing()) || (aieta > lastHERing())) { ok = false; @@ -823,8 +817,7 @@ int HcalTopology::decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const { void HcalTopology::depthBinInformation( HcalSubdetector subdet, int etaRing, int iphi, int zside, int& nDepthBins, int& startingBin) const { if (subdet == HcalBarrel) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { + if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { startingBin = hcons_->getMinDepth(0, etaRing, iphi, zside); if (etaRing == lastHBRing()) { nDepthBins = hcons_->getDepthEta16(1, iphi, zside) - startingBin + 1; @@ -841,8 +834,7 @@ void HcalTopology::depthBinInformation( } } } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { + if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { if (etaRing == firstHERing()) { startingBin = hcons_->getDepthEta16(2, iphi, zside); } else { @@ -896,17 +888,16 @@ bool HcalTopology::incrementDepth(HcalDetId& detId) const { } else if (subdet == HcalBarrel && etaRing == lastHBRing()) { // overlap subdet = HcalEndcap; - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) + if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) depth = hcons_->getDepthEta16(2, iphi, zside); } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && (mode_ != HcalTopologyMode::SLHC) && - (mode_ != HcalTopologyMode::Run3) && (mode_ != HcalTopologyMode::Run4)) { + (mode_ != HcalTopologyMode::Run4)) { // guard ring HF29 is behind HE 28 subdet = HcalForward; (ieta > 0) ? ++ieta : --ieta; depth = 1; } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && (mode_ != HcalTopologyMode::SLHC) && - (mode_ != HcalTopologyMode::Run3) && (mode_ != HcalTopologyMode::Run4)) { + (mode_ != HcalTopologyMode::Run4)) { // split cells go to bigger granularity. Ring 29 -> 28 (ieta > 0) ? --ieta : ++ieta; } else { @@ -940,8 +931,7 @@ bool HcalTopology::decrementDepth(HcalDetId& detId) const { } } } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && (depth == hcons_->getDepthEta29(iphi, zside, 0)) && - (mode_ != HcalTopologyMode::SLHC) && (mode_ != HcalTopologyMode::Run3) && - (mode_ != HcalTopologyMode::Run4)) { + (mode_ != HcalTopologyMode::SLHC) && (mode_ != HcalTopologyMode::Run4)) { (ieta > 0) ? --ieta : ++ieta; } else if (depth <= 0) { if (subdet == HcalForward && etaRing == firstHFRing()) { @@ -1143,7 +1133,9 @@ std::pair HcalTopology::etaRange(HcalSubdetector subdet, int ket return std::pair(etaTableHF[ii], etaTableHF[ii + 1]); } } else { - int ietal = (mode_ == HcalTopologyMode::LHC && ieta == lastHERing_ - 1) ? (ieta + 1) : ieta; + int ietal = (((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) && ieta == lastHERing_ - 1) + ? (ieta + 1) + : ieta; if ((ietal < (int)(etaTable.size())) && (ieta > 0)) return std::pair(etaTable[ieta - 1], etaTable[ietal]); } From b62aca15b52459d94f2feb000665ecdbef62f44a Mon Sep 17 00:00:00 2001 From: Sunanda Date: Tue, 8 Oct 2024 21:02:36 +0200 Subject: [PATCH 2/8] Suggestion from Chris Jones --- .../CaloTopology/interface/HcalTopology.h | 2 ++ Geometry/CaloTopology/src/HcalTopology.cc | 32 ++++++++----------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Geometry/CaloTopology/interface/HcalTopology.h b/Geometry/CaloTopology/interface/HcalTopology.h index 6f339af2be9db..8e1dc0a60328c 100644 --- a/Geometry/CaloTopology/interface/HcalTopology.h +++ b/Geometry/CaloTopology/interface/HcalTopology.h @@ -171,6 +171,8 @@ class HcalTopology : public CaloSubdetectorTopology { HcalDetId idBack(const HcalDetId& id) const { return hcons_->idBack(id); } private: + bool phase1() const { return ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)); } + bool phase2() const { return ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)); } /** Get the neighbors of the given cell with higher absolute ieta */ int incAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const; /** Get the neighbors of the given cell with lower absolute ieta */ diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index ebd6aed2ba8e6..8dbd6826135f4 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -64,7 +64,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos } else { nEtaHE_ = (lastHERing_ - firstHERing_ + 1); } - if ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) { + if (phase1()) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal @@ -72,7 +72,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos HFSize_ = kHFSizePreLS1; // ieta * iphi * depth * 2 CALIBSize_ = kCALIBSizePreLS1; numberOfShapes_ = 87; - } else if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) { // need to know more eventually + } else if (phase2()) { // need to know more eventually topoVersion_ = 10; HBSize_ = nEtaHB_ * IPHI_MAX * maxDepthHB_ * 2; HESize_ = nEtaHE_ * maxPhiHE_ * maxDepthHE_ * 2; @@ -195,14 +195,14 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HFSize_(kHFSizePreLS1), HTSize_(kHTSizePreLS1), CALIBSize_(kCALIBSizePreLS1), - numberOfShapes_(((mode == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) ? 500 : 87) { - if ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) { + numberOfShapes_(phase2() ? 500 : 87) { + if (phase1()) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run4)) { // need to know more eventually + } else if (phase2()) { // need to know more eventually HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 @@ -567,7 +567,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { if (ok) { if (subdet == HcalBarrel) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { + if (phase2() || (mode_ == HcalTopologyMode::H2HE)) { if ((aieta > lastHBRing()) || (depth > hcons_->getMaxDepth(0, aieta, iphi, zside)) || (depth < hcons_->getMinDepth(0, aieta, iphi, zside))) ok = false; @@ -576,7 +576,7 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { ok = false; } } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { + if (phase2() || (mode_ == HcalTopologyMode::H2HE)) { if ((depth > hcons_->getMaxDepth(1, aieta, iphi, zside)) || (depth < hcons_->getMinDepth(1, aieta, iphi, zside)) || (aieta < firstHERing()) || (aieta > lastHERing())) { ok = false; @@ -817,7 +817,7 @@ int HcalTopology::decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const { void HcalTopology::depthBinInformation( HcalSubdetector subdet, int etaRing, int iphi, int zside, int& nDepthBins, int& startingBin) const { if (subdet == HcalBarrel) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { + if (phase2() || (mode_ == HcalTopologyMode::H2HE)) { startingBin = hcons_->getMinDepth(0, etaRing, iphi, zside); if (etaRing == lastHBRing()) { nDepthBins = hcons_->getDepthEta16(1, iphi, zside) - startingBin + 1; @@ -834,7 +834,7 @@ void HcalTopology::depthBinInformation( } } } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) { + if (phase2() || (mode_ == HcalTopologyMode::H2HE)) { if (etaRing == firstHERing()) { startingBin = hcons_->getDepthEta16(2, iphi, zside); } else { @@ -888,16 +888,14 @@ bool HcalTopology::incrementDepth(HcalDetId& detId) const { } else if (subdet == HcalBarrel && etaRing == lastHBRing()) { // overlap subdet = HcalEndcap; - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run4)) + if (phase2() || (mode_ == HcalTopologyMode::H2HE)) depth = hcons_->getDepthEta16(2, iphi, zside); - } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && (mode_ != HcalTopologyMode::SLHC) && - (mode_ != HcalTopologyMode::Run4)) { + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && phase2()) { // guard ring HF29 is behind HE 28 subdet = HcalForward; (ieta > 0) ? ++ieta : --ieta; depth = 1; - } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && (mode_ != HcalTopologyMode::SLHC) && - (mode_ != HcalTopologyMode::Run4)) { + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && phase2()) { // split cells go to bigger granularity. Ring 29 -> 28 (ieta > 0) ? --ieta : ++ieta; } else { @@ -931,7 +929,7 @@ bool HcalTopology::decrementDepth(HcalDetId& detId) const { } } } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && (depth == hcons_->getDepthEta29(iphi, zside, 0)) && - (mode_ != HcalTopologyMode::SLHC) && (mode_ != HcalTopologyMode::Run4)) { + phase2()) { (ieta > 0) ? --ieta : ++ieta; } else if (depth <= 0) { if (subdet == HcalForward && etaRing == firstHFRing()) { @@ -1133,9 +1131,7 @@ std::pair HcalTopology::etaRange(HcalSubdetector subdet, int ket return std::pair(etaTableHF[ii], etaTableHF[ii + 1]); } } else { - int ietal = (((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run3)) && ieta == lastHERing_ - 1) - ? (ieta + 1) - : ieta; + int ietal = (phase1() && ieta == lastHERing_ - 1) ? (ieta + 1) : ieta; if ((ietal < (int)(etaTable.size())) && (ieta > 0)) return std::pair(etaTable[ieta - 1], etaTable[ietal]); } From d63dfc9ea4bf1d6cd51f8bcc2079d0489e360766 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 9 Oct 2024 08:11:38 +0200 Subject: [PATCH 3/8] Correction --- Geometry/CaloTopology/src/HcalTopology.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 8dbd6826135f4..2bbd724447114 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -890,12 +890,12 @@ bool HcalTopology::incrementDepth(HcalDetId& detId) const { subdet = HcalEndcap; if (phase2() || (mode_ == HcalTopologyMode::H2HE)) depth = hcons_->getDepthEta16(2, iphi, zside); - } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && phase2()) { + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && !phase2()) { // guard ring HF29 is behind HE 28 subdet = HcalForward; (ieta > 0) ? ++ieta : --ieta; depth = 1; - } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && phase2()) { + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && !phase2()) { // split cells go to bigger granularity. Ring 29 -> 28 (ieta > 0) ? --ieta : ++ieta; } else { @@ -929,7 +929,7 @@ bool HcalTopology::decrementDepth(HcalDetId& detId) const { } } } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && (depth == hcons_->getDepthEta29(iphi, zside, 0)) && - phase2()) { + !phase2()) { (ieta > 0) ? --ieta : ++ieta; } else if (depth <= 0) { if (subdet == HcalForward && etaRing == firstHFRing()) { From 7489d69c7769c9b9e34e2843e9050852b1ba43ab Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 9 Oct 2024 11:29:07 +0200 Subject: [PATCH 4/8] Corrections --- .../CaloTopology/interface/HcalTopology.h | 6 ++++++ Geometry/CaloTopology/src/HcalTopology.cc | 21 ++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Geometry/CaloTopology/interface/HcalTopology.h b/Geometry/CaloTopology/interface/HcalTopology.h index 8e1dc0a60328c..8f8e759bf12f8 100644 --- a/Geometry/CaloTopology/interface/HcalTopology.h +++ b/Geometry/CaloTopology/interface/HcalTopology.h @@ -229,7 +229,10 @@ class HcalTopology : public CaloSubdetectorTopology { static constexpr int kHBhalf = 1296, kHEhalf = 1296, kHOhalf = 1080, kHFhalf = 864, kHThalf = 2088, kZDChalf = 11, kCASTORhalf = 224, kCALIBhalf = 693, kHThalfPhase1 = 2520, kHcalhalf = kHBhalf + kHEhalf + kHOhalf + kHFhalf; + static constexpr int kHBhalfPostLS2 = 4536, kHEhalfPostLS2 = 3384, kHFhalfPostLS2 = 1728; + static constexpr int kHcalhalfPostLS2 = kHBhalfPostLS2 + kHEhalfPostLS2 + kHOhalf + kHFhalfPostLS2; static constexpr int kSizeForDenseIndexingPreLS1 = 2 * kHcalhalf; + static constexpr int kSizeForDenseIndexingPostLS2 = 2 * kHcalhalfPostLS2; static constexpr int kHBSizePreLS1 = 2 * kHBhalf; static constexpr int kHESizePreLS1 = 2 * kHEhalf; static constexpr int kHOSizePreLS1 = 2 * kHOhalf; @@ -237,6 +240,9 @@ class HcalTopology : public CaloSubdetectorTopology { static constexpr int kHTSizePreLS1 = 2 * kHThalf; static constexpr int kHTSizePhase1 = 2 * kHThalfPhase1; static constexpr int kCALIBSizePreLS1 = 2 * kCALIBhalf; + static constexpr int kHBSizePostLS2 = 2 * kHBhalfPostLS2; + static constexpr int kHESizePostLS2 = 2 * kHEhalfPostLS2; + static constexpr int kHFSizePostLS2 = 2 * kHFhalfPostLS2; static constexpr int minMaxDepth_ = 4; static constexpr unsigned int minPhi_ = 1, maxPhi_ = 72; static constexpr unsigned int kOffCalibHB_ = 0; diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 2bbd724447114..60ee8be81710a 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -64,7 +64,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos } else { nEtaHE_ = (lastHERing_ - firstHERing_ + 1); } - if (phase1()) { + if (mode_ == HcalTopologyMode::LHC) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal @@ -72,6 +72,14 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos HFSize_ = kHFSizePreLS1; // ieta * iphi * depth * 2 CALIBSize_ = kCALIBSizePreLS1; numberOfShapes_ = 87; + } else if (mode_ == HcalTopologyMode::Run3) { + topoVersion_ = 10; + HBSize_ = kHBSizePostLS2; + HESize_ = kHESizePostLS2; + HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 + HFSize_ = kHFSizePostLS2; + CALIBSize_ = kOffCalibHFX_; + numberOfShapes_ = (maxPhiHE_ > 72) ? 1200 : 500; } else if (phase2()) { // need to know more eventually topoVersion_ = 10; HBSize_ = nEtaHB_ * IPHI_MAX * maxDepthHB_ * 2; @@ -196,13 +204,20 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HTSize_(kHTSizePreLS1), CALIBSize_(kCALIBSizePreLS1), numberOfShapes_(phase2() ? 500 : 87) { - if (phase1()) { + if (mode_ == HcalTopologyMode::LHC) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else if (phase2()) { // need to know more eventually + } else if (mode_ == HcalTopologyMode::Run3) { + topoVersion_ = 10; + HBSize_ = kHBSizePostLS2; + HESize_ = kHESizePostLS2; + HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 + HFSize_ = kHFSizePostLS2; + CALIBSize_ = kOffCalibHFX_; + } else if (phase2()) { // need to know more eventually HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 From 0a166de381534ce38d01dc20819c93d6557c8cc4 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 9 Oct 2024 14:29:30 +0200 Subject: [PATCH 5/8] Make small change --- Geometry/CaloTopology/src/HcalTopology.cc | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 60ee8be81710a..5b03137a7bb04 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -72,15 +72,7 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos HFSize_ = kHFSizePreLS1; // ieta * iphi * depth * 2 CALIBSize_ = kCALIBSizePreLS1; numberOfShapes_ = 87; - } else if (mode_ == HcalTopologyMode::Run3) { - topoVersion_ = 10; - HBSize_ = kHBSizePostLS2; - HESize_ = kHESizePostLS2; - HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 - HFSize_ = kHFSizePostLS2; - CALIBSize_ = kOffCalibHFX_; - numberOfShapes_ = (maxPhiHE_ > 72) ? 1200 : 500; - } else if (phase2()) { // need to know more eventually + } else { // need to know more eventually topoVersion_ = 10; HBSize_ = nEtaHB_ * IPHI_MAX * maxDepthHB_ * 2; HESize_ = nEtaHE_ * maxPhiHE_ * maxDepthHE_ * 2; @@ -210,14 +202,7 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else if (mode_ == HcalTopologyMode::Run3) { - topoVersion_ = 10; - HBSize_ = kHBSizePostLS2; - HESize_ = kHESizePostLS2; - HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 - HFSize_ = kHFSizePostLS2; - CALIBSize_ = kOffCalibHFX_; - } else if (phase2()) { // need to know more eventually + } else { // need to know more eventually HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 From e51d1c1bad2df7abdcc39280c010c381315db530 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 9 Oct 2024 14:41:34 +0200 Subject: [PATCH 6/8] code check --- Geometry/CaloTopology/src/HcalTopology.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 5b03137a7bb04..9b3c702acc23d 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -202,7 +202,7 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else { // need to know more eventually + } else { // need to know more eventually HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 From ad1753c108eb62d7192ecec9b54fccafa294b78e Mon Sep 17 00:00:00 2001 From: Sunanda Date: Wed, 9 Oct 2024 20:32:11 +0200 Subject: [PATCH 7/8] Modify numberofshapes --- Geometry/CaloTopology/src/HcalTopology.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 9b3c702acc23d..918d523fea6a6 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -195,7 +195,7 @@ HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, HFSize_(kHFSizePreLS1), HTSize_(kHTSizePreLS1), CALIBSize_(kCALIBSizePreLS1), - numberOfShapes_(phase2() ? 500 : 87) { + numberOfShapes_((mode_ == HcalTopologyMode::LHC) ? 87 : 500) { if (mode_ == HcalTopologyMode::LHC) { topoVersion_ = 0; //DL HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal From fd51c79d0e285f79dea1a9843a7b8e010b0e6c50 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Fri, 11 Oct 2024 22:53:00 +0200 Subject: [PATCH 8/8] Remove the obsolete constructors as done in #46357 --- .../CaloTopology/interface/HcalTopology.h | 4 -- Geometry/CaloTopology/src/HcalTopology.cc | 65 ------------------- 2 files changed, 69 deletions(-) diff --git a/Geometry/CaloTopology/interface/HcalTopology.h b/Geometry/CaloTopology/interface/HcalTopology.h index 8f8e759bf12f8..a8e691328a7a5 100644 --- a/Geometry/CaloTopology/interface/HcalTopology.h +++ b/Geometry/CaloTopology/interface/HcalTopology.h @@ -26,10 +26,6 @@ class HcalTopology : public CaloSubdetectorTopology { public: HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePosition = false); - HcalTopology(HcalTopologyMode::Mode mode, - int maxDepthHB, - int maxDepthHE, - HcalTopologyMode::TriggerMode tmode = HcalTopologyMode::TriggerMode_2009); HcalTopologyMode::Mode mode() const { return mode_; } HcalTopologyMode::TriggerMode triggerMode() const { return triggerMode_; } diff --git a/Geometry/CaloTopology/src/HcalTopology.cc b/Geometry/CaloTopology/src/HcalTopology.cc index 918d523fea6a6..d3534ca11687f 100644 --- a/Geometry/CaloTopology/src/HcalTopology.cc +++ b/Geometry/CaloTopology/src/HcalTopology.cc @@ -157,71 +157,6 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos #endif } -HcalTopology::HcalTopology(HcalTopologyMode::Mode mode, - int maxDepthHB, - int maxDepthHE, - HcalTopologyMode::TriggerMode tmode) - : hcons_(nullptr), - mergePosition_(false), - excludeHB_(false), - excludeHE_(false), - excludeHO_(false), - excludeHF_(false), - mode_(mode), - triggerMode_(tmode), - firstHBRing_(1), - lastHBRing_(16), - firstHERing_(16), - lastHERing_(29), - firstHFRing_(29), - lastHFRing_(41), - firstHORing_(1), - lastHORing_(15), - firstHEDoublePhiRing_((mode == HcalTopologyMode::H2 || mode == HcalTopologyMode::H2HE) ? (22) : (21)), - firstHEQuadPhiRing_(999), - firstHFQuadPhiRing_(40), - firstHETripleDepthRing_((mode == HcalTopologyMode::H2 || mode == HcalTopologyMode::H2HE) ? (24) : (27)), - singlePhiBins_(IPHI_MAX), - doublePhiBins_(36), - maxDepthHB_(maxDepthHB), - maxDepthHE_(maxDepthHE), - maxDepthHF_(2), - etaHE2HF_(30), - etaHF2HE_(29), - maxPhiHE_(IPHI_MAX), - HBSize_(kHBSizePreLS1), - HESize_(kHESizePreLS1), - HOSize_(kHOSizePreLS1), - HFSize_(kHFSizePreLS1), - HTSize_(kHTSizePreLS1), - CALIBSize_(kCALIBSizePreLS1), - numberOfShapes_((mode_ == HcalTopologyMode::LHC) ? 87 : 500) { - if (mode_ == HcalTopologyMode::LHC) { - topoVersion_ = 0; //DL - HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal - HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal - HOSize_ = kHOSizePreLS1; // ieta * iphi * 2 - HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm - } else { // need to know more eventually - HBSize_ = maxDepthHB * 16 * IPHI_MAX * 2; - HESize_ = maxDepthHE * (29 - 16 + 1) * maxPhiHE_ * 2; - HOSize_ = 15 * IPHI_MAX * 2; // ieta * iphi * 2 - HFSize_ = IPHI_MAX * 13 * maxDepthHF_ * 2; // phi * eta * depth * pm - CALIBSize_ = kOffCalibHFX_; - topoVersion_ = 10; - } - nEtaHB_ = (lastHBRing_ - firstHBRing_ + 1); - nEtaHE_ = (lastHERing_ - firstHERing_ + 1); - if (triggerMode_ == HcalTopologyMode::TriggerMode_2009) { - HTSize_ = kHTSizePreLS1; - } else { - HTSize_ = kHTSizePhase1; - } - - edm::LogWarning("HCalGeom") << "This is an incomplete constructor of HcalTopology - be warned that many " - << "functionalities will not be there - revert from this - get from EventSetup"; -} - bool HcalTopology::valid(const DetId& id) const { assert(id.det() == DetId::Hcal); return validHcal(id);