diff --git a/Geometry/CaloTopology/interface/HcalTopology.h b/Geometry/CaloTopology/interface/HcalTopology.h index 6f339af2be9db..c181300bf35f8 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_; } @@ -48,6 +44,7 @@ class HcalTopology : public CaloSubdetectorTopology { DetId denseId2detId(unsigned int /*denseid*/) const override; /// return a count of valid cells (for dense indexing use) unsigned int ncells() const override; + unsigned int ncells(int subdet) const; /// return a version which identifies the given topology int topoVersion() const override; @@ -171,6 +168,16 @@ class HcalTopology : public CaloSubdetectorTopology { HcalDetId idBack(const HcalDetId& id) const { return hcons_->idBack(id); } private: + bool phase1() const { return ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::H2HE)); } + bool phase1A() const { + return ((mode_ == HcalTopologyMode::LHC) || (mode_ == HcalTopologyMode::Run2A) || (mode_ == HcalTopologyMode::H2) || + (mode_ == HcalTopologyMode::H2HE)); + } + bool phase1B() const { + return ((mode_ == HcalTopologyMode::Run2B) || (mode_ == HcalTopologyMode::Run2C) || + (mode_ == HcalTopologyMode::Run3) || (mode_ == HcalTopologyMode::SLHC)); + } + bool phase2() const { return ((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 */ @@ -178,7 +185,7 @@ class HcalTopology : public CaloSubdetectorTopology { /** Is this a valid cell id, ignoring the exclusion list */ bool validDetIdPreLS1(const HcalDetId& id) const; - bool validRaw(const HcalDetId& id) const; + bool validRaw(const HcalDetId& id, const bool debug = false) const; unsigned int detId2denseIdPreLS1(const DetId& id) const; bool isExcluded(const HcalDetId& id) const; @@ -227,7 +234,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; @@ -235,6 +245,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 c550077058b81..05dca5267a42e 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 (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) { // need to know more eventually + } else { // need to know more eventually topoVersion_ = 10; HBSize_ = nEtaHB_ * IPHI_MAX * maxDepthHB_ * 2; HESize_ = nEtaHE_ * maxPhiHE_ * maxDepthHE_ * 2; @@ -155,75 +155,12 @@ HcalTopology::HcalTopology(const HcalDDDRecConstants* hcons, const bool mergePos << " " << maxDepthHB_ << ":" << maxDepthHE_ << " " << nEtaHB_ << ":" << nEtaHE_ << " " << etaHE2HF_ << ":" << etaHF2HE_ << " " << maxPhiHE_; #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::SLHC) || (mode_ == HcalTopologyMode::Run3) || (mode_ == HcalTopologyMode::Run4)) - ? 500 - : 87) { - 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 ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::Run3) || - (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 - 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"; + // Now redfine some of the sizes +#ifdef EDM_ML_DEBUG + edm::LogVerbatim("HCalGeom") << "Redefined sizes could be for HB:" << ncells(HcalBarrel) + << " HE:" << ncells(HcalEndcap) << " HF: " << ncells(HcalForward); +#endif } bool HcalTopology::valid(const DetId& id) const { @@ -233,7 +170,7 @@ bool HcalTopology::valid(const DetId& id) const { bool HcalTopology::validHcal(const HcalDetId& id) const { // check the raw rules - return validRaw(id) && !isExcluded(id); + return validRaw(id, false) && !isExcluded(id); } bool HcalTopology::validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const { @@ -504,7 +441,7 @@ int HcalTopology::exclude(HcalSubdetector subdet, int ieta1, int ieta2, int iphi for (int iphi = iphi_l; iphi <= iphi_h; iphi++) for (int depth = depth_l; depth <= depth_h; depth++) { HcalDetId id(subdet, ieta, iphi, depth); - if (validRaw(id)) { // use 'validRaw' to include check validity in "uncut" detector + if (validRaw(id, false)) { // use 'validRaw' to include check validity in "uncut" detector exclude(id); n++; } @@ -557,7 +494,12 @@ bool HcalTopology::validDetIdPreLS1(const HcalDetId& id) const { } /** Is this a valid cell id? */ -bool HcalTopology::validRaw(const HcalDetId& id) const { +bool HcalTopology::validRaw(const HcalDetId& id, +#ifdef EDM_ML_DEBUG + const bool debug) const { +#else + const bool) const { +#endif bool ok = true; int ieta = id.ieta(); int aieta = id.ietaAbs(); @@ -571,18 +513,23 @@ 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 ((aieta > lastHBRing()) || (depth > hcons_->getMaxDepth(0, aieta, iphi, zside)) || - (depth < hcons_->getMinDepth(0, aieta, iphi, zside))) + if (phase1()) { + if (aieta > lastHBRing() || depth > 2 || (aieta <= 14 && depth > 1)) ok = false; } else { - if (aieta > lastHBRing() || depth > 2 || (aieta <= 14 && depth > 1)) + if ((aieta > lastHBRing()) || (depth > hcons_->getMaxDepth(0, aieta, iphi, zside)) || + (depth < hcons_->getMinDepth(0, aieta, iphi, zside))) ok = false; } } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { + if (phase1A()) { + if (depth > hcons_->getMaxDepth(1, aieta, iphi, zside) || aieta < firstHERing() || aieta > lastHERing() || + (aieta == firstHERing() && depth != hcons_->getDepthEta16(2, iphi, zside)) || + (aieta == 17 && depth != 1 && mode_ != HcalTopologyMode::H2) || // special case at H2 + (((aieta >= 17 && aieta < firstHETripleDepthRing()) || aieta == lastHERing()) && depth > 2) || + (aieta >= firstHEDoublePhiRing() && (iphi % 2) == 0)) + ok = false; + } else { if ((depth > hcons_->getMaxDepth(1, aieta, iphi, zside)) || (depth < hcons_->getMinDepth(1, aieta, iphi, zside)) || (aieta < firstHERing()) || (aieta > lastHERing())) { ok = false; @@ -604,13 +551,6 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { } } } - } else { - if (depth > hcons_->getMaxDepth(1, aieta, iphi, zside) || aieta < firstHERing() || aieta > lastHERing() || - (aieta == firstHERing() && depth != hcons_->getDepthEta16(2, iphi, zside)) || - (aieta == 17 && depth != 1 && mode_ != HcalTopologyMode::H2) || // special case at H2 - (((aieta >= 17 && aieta < firstHETripleDepthRing()) || aieta == lastHERing()) && depth > 2) || - (aieta >= firstHEDoublePhiRing() && (iphi % 2) == 0)) - ok = false; } } else if (subdet == HcalOuter) { if (aieta > lastHORing() || iphi > IPHI_MAX || depth != 4) @@ -627,6 +567,16 @@ bool HcalTopology::validRaw(const HcalDetId& id) const { ok = false; } } +#ifdef EDM_ML_DEBUG + if (debug) + edm::LogVerbatim("HCalGeom") << "HcalValdRaw ID: " << subdet << ":" << aieta << ":" << depth << ":" << iphi << ":" + << zside << " Mode " << mode_ << ":" << phase1() << ":" << phase1A() << ":" + << phase1B() << ":" << phase2() << " Limits HB " << lastHBRing() << " HE " + << firstHERing() << ":" << lastHERing() << ":" << firstHEDoublePhiRing() << ":" + << firstHEQuadPhiRing() << " Depth " << hcons_->getMaxDepth(0, aieta, iphi, zside) + << ":" << hcons_->getMinDepth(0, aieta, iphi, zside) << ":" + << hcons_->getDepthEta16(2, iphi, zside) << " OK " << ok; +#endif return ok; } @@ -823,15 +773,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)) { - startingBin = hcons_->getMinDepth(0, etaRing, iphi, zside); - if (etaRing == lastHBRing()) { - nDepthBins = hcons_->getDepthEta16(1, iphi, zside) - startingBin + 1; - } else { - nDepthBins = hcons_->getMaxDepth(0, etaRing, iphi, zside) - startingBin + 1; - } - } else { + if (phase1() || (mode_ == HcalTopologyMode::H2)) { if (etaRing <= 14) { nDepthBins = 1; startingBin = 1; @@ -839,17 +781,16 @@ void HcalTopology::depthBinInformation( nDepthBins = 2; startingBin = 1; } - } - } else if (subdet == HcalEndcap) { - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (mode_ == HcalTopologyMode::Run4)) { - if (etaRing == firstHERing()) { - startingBin = hcons_->getDepthEta16(2, iphi, zside); + } else { + startingBin = hcons_->getMinDepth(0, etaRing, iphi, zside); + if (etaRing == lastHBRing()) { + nDepthBins = hcons_->getDepthEta16(1, iphi, zside) - startingBin + 1; } else { - startingBin = hcons_->getMinDepth(1, etaRing, iphi, zside); + nDepthBins = hcons_->getMaxDepth(0, etaRing, iphi, zside) - startingBin + 1; } - nDepthBins = hcons_->getMaxDepth(1, etaRing, iphi, zside) - startingBin + 1; - } else { + } + } else if (subdet == HcalEndcap) { + if (phase1A()) { if (etaRing == firstHERing()) { nDepthBins = 1; startingBin = 3; @@ -863,6 +804,13 @@ void HcalTopology::depthBinInformation( nDepthBins = (etaRing >= firstHETripleDepthRing()) ? 3 : 2; startingBin = 1; } + } else { + if (etaRing == firstHERing()) { + startingBin = hcons_->getDepthEta16(2, iphi, zside); + } else { + startingBin = hcons_->getMinDepth(1, etaRing, iphi, zside); + } + nDepthBins = hcons_->getMaxDepth(1, etaRing, iphi, zside) - startingBin + 1; } } else if (subdet == HcalForward) { nDepthBins = maxDepthHF_; @@ -895,18 +843,20 @@ bool HcalTopology::incrementDepth(HcalDetId& detId) const { depth = 4; } else if (subdet == HcalBarrel && etaRing == lastHBRing()) { // overlap - subdet = HcalEndcap; - if ((mode_ == HcalTopologyMode::SLHC) || (mode_ == HcalTopologyMode::H2HE) || (mode_ == HcalTopologyMode::Run3) || - (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)) { + if (phase2()) { // No more chance + detId = HcalDetId(); + return false; + } else { + subdet = HcalEndcap; + if (phase1B()) + depth = hcons_->getDepthEta16(2, iphi, zside); + } + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing() - 1) && !phase1B()) { // 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)) { + } else if ((subdet == HcalEndcap) && (etaRing == lastHERing()) && !phase1B()) { // split cells go to bigger granularity. Ring 29 -> 28 (ieta > 0) ? --ieta : ++ieta; } else { @@ -940,8 +890,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)) { + !phase1B()) { (ieta > 0) ? --ieta : ++ieta; } else if (depth <= 0) { if (subdet == HcalForward && etaRing == firstHFRing()) { @@ -1134,17 +1083,18 @@ double HcalTopology::etaMax(HcalSubdetector subdet) const { } return eta; } + std::pair HcalTopology::etaRange(HcalSubdetector subdet, int keta) const { int ieta = (keta > 0) ? keta : -keta; if (subdet == HcalForward) { if (ieta >= firstHFRing_) { - unsigned int ii = (unsigned int)(ieta - firstHFRing_); + unsigned int ii = static_cast(ieta - firstHFRing_); if (ii + 1 < etaTableHF.size()) return std::pair(etaTableHF[ii], etaTableHF[ii + 1]); } } else { - int ietal = (mode_ == HcalTopologyMode::LHC && ieta == lastHERing_ - 1) ? (ieta + 1) : ieta; - if ((ietal < (int)(etaTable.size())) && (ieta > 0)) + int ietal = (phase1() && ieta == lastHERing_ - 1) ? (ieta + 1) : ieta; + if ((ietal < static_cast(etaTable.size())) && (ieta > 0)) return std::pair(etaTable[ieta - 1], etaTable[ietal]); } return std::pair(0, 0); @@ -1702,4 +1652,18 @@ DetId HcalTopology::denseId2detId(unsigned int denseid) const { unsigned int HcalTopology::ncells() const { return HBSize_ + HESize_ + HOSize_ + HFSize_; } +unsigned int HcalTopology::ncells(int subdet) const { + unsigned int ncell(0); + for (int eta = -maxEta_; eta <= maxEta_; eta++) { + for (unsigned int phi = 1; phi <= maxPhi_; phi++) { + for (int depth = 1; depth <= 7; depth++) { + HcalDetId cell((HcalSubdetector)subdet, eta, phi, depth); + if (validRaw(cell, true)) + ++ncell; + } + } + } + return ncell; +} + int HcalTopology::topoVersion() const { return topoVersion_; } diff --git a/Geometry/CaloTopology/test/HcalTopologyTester.cc b/Geometry/CaloTopology/test/HcalTopologyTester.cc index b49da0aef53e0..fd859689337ab 100644 --- a/Geometry/CaloTopology/test/HcalTopologyTester.cc +++ b/Geometry/CaloTopology/test/HcalTopologyTester.cc @@ -47,6 +47,15 @@ void HcalTopologyTester::fillDescriptions(edm::ConfigurationDescriptions& descri void HcalTopologyTester::analyze(edm::Event const&, edm::EventSetup const& iSetup) { doTest(iSetup.getData(tokTopo_)); } void HcalTopologyTester::doTest(const HcalTopology& topology) { + // Total number of valid cells + edm::LogVerbatim("HCalGeom") << "Total number of cells in HB:" << topology.getHBSize() + << " HE: " << topology.getHESize() << " HF: " << topology.getHFSize() + << " HO: " << topology.getHOSize() << " HT: " << topology.getHTSize() + << " Calib: " << topology.getCALIBSize() << " Overall: " << topology.ncells(); + std::vector dets = {"HB", "HE", "HO", "HF"}; + for (int det = 1; det <= 4; ++det) + edm::LogVerbatim("HCalGeom") << "Valid cells for " << dets[det - 1] << " = " << topology.ncells(det); + // First test on movements along eta/phi directions edm::LogVerbatim("HCalGeom") << "\nTest on movements along eta/phi directions" << "\n=========================================="; diff --git a/Geometry/CaloTopology/test/testHcalTopology_cfg.py b/Geometry/CaloTopology/test/testHcalTopology_cfg.py index 04c8fc435b3bd..f80e250e1198e 100644 --- a/Geometry/CaloTopology/test/testHcalTopology_cfg.py +++ b/Geometry/CaloTopology/test/testHcalTopology_cfg.py @@ -1,11 +1,52 @@ +############################################################################### +# Way to use this: +# cmsRun testHcalTopology_cfg.py type=2018 +# +# Options for type 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2023, 2024 +# +############################################################################### import FWCore.ParameterSet.Config as cms +import os, sys, imp, re +import FWCore.ParameterSet.VarParsing as VarParsing -process = cms.Process("PROD") -process.load("SimGeneral.HepPDTESSource.pdt_cfi") +#################################################################### +### SETUP OPTIONS +options = VarParsing.VarParsing('standard') +options.register('type', + "2018", + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "type of operations: 2015, 2016, 2017, 2018, 2019, 2021, 2022, 2023, 2024") + +### get and parse the command line arguments +options.parseArguments() + +geomFile = "Configuration.Geometry.GeometryExtended" + options.type + "Reco_cff" + +print(options) +print("Geometry file: ", geomFile) -process.load("Geometry.HcalCommonData.testGeometry17bXML_cfi") -process.load("Geometry.HcalCommonData.hcalDDConstants_cff") -process.load("Geometry.HcalEventSetup.hcalTopologyIdeal_cfi") +#################################################################### +# Use the options + +if (options.type == "2015"): + from Configuration.Eras.Era_Run2_25ns_cff import Run2_25ns + process = cms.Process('TestHcalTopology',Run2_25ns) +elif (options.type == "2016"): + from Configuration.Eras.Era_Run2_2016_cff import Run2_2016 + process = cms.Process('TestHcalTopology',Run2_2016) +elif (options.type == "2017"): + from Configuration.Eras.Era_Run2_2017_cff import Run2_2017 + process = cms.Process('TestHcalTopology',Run2_2017) +elif (options.type == "2018"): + from Configuration.Eras.Era_Run2_2018_cff import Run2_2018 + process = cms.Process('TestHcalTopology',Run2_2018) +else: + from Configuration.Eras.Era_Run3_DDD_cff import Run3_DDD + process = cms.Process('TestHcalTopology',Run3_DDD) + +process.load("SimGeneral.HepPDTESSource.pdt_cfi") +process.load(geomFile) process.load("Geometry.CaloTopology.hcalTopologyTester_cfi") process.load('FWCore.MessageService.MessageLogger_cfi') diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2016/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2016/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..75392e2eb532c --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2016/v2/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2016a/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2016a/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..75392e2eb532c --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2016a/v2/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2017/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2017/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..856e640680e84 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2017/v2/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2018/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2018/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..5c8403372c259 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2018/v2/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2018Plan36/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2018Plan36/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..e94372ea66aa5 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2018Plan36/v2/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 + + + 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6 + + + 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2019/v2/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2019/v2/hcalRecNumbering.xml new file mode 100644 index 0000000000000..a6e5b16c8cf30 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2019/v2/hcalRecNumbering.xml @@ -0,0 +1,42 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 + + + 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6 + + + 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7 + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/2021/v4/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/2021/v4/hcalRecNumbering.xml new file mode 100644 index 0000000000000..a388604ca83d7 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/2021/v4/hcalRecNumbering.xml @@ -0,0 +1,45 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 + + + 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6 + + + 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7 + + + + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/H2/v1/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/H2/v1/hcalRecNumbering.xml new file mode 100644 index 0000000000000..eab8457ba7fe1 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/H2/v1/hcalRecNumbering.xml @@ -0,0 +1,44 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4 + + + 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 + + + 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v4/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v4/hcalRecNumbering.xml new file mode 100644 index 0000000000000..157b87de39a28 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v4/hcalRecNumbering.xml @@ -0,0 +1,28 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v5/hcalRecNumbering.xml b/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v5/hcalRecNumbering.xml new file mode 100644 index 0000000000000..bcfee49616e34 --- /dev/null +++ b/Geometry/HcalCommonData/data/hcalRecNumbering/NoHE/v5/hcalRecNumbering.xml @@ -0,0 +1,30 @@ + + + + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + + + 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 + + + 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4 + + + + + + + + + + + + + + + diff --git a/Geometry/HcalCommonData/interface/HcalTopologyMode.h b/Geometry/HcalCommonData/interface/HcalTopologyMode.h index 4a3aa4de0f93c..2d496d1426556 100644 --- a/Geometry/HcalCommonData/interface/HcalTopologyMode.h +++ b/Geometry/HcalCommonData/interface/HcalTopologyMode.h @@ -23,7 +23,17 @@ class StringToEnumParser { }; namespace HcalTopologyMode { - enum Mode { LHC = 0, H2 = 1, SLHC = 2, H2HE = 3, Run3 = 4, Run4 = 5 }; + enum Mode { + LHC = 0, // Legacy HCAL + H2 = 1, // H2 TB + SLHC = 2, // Attemptf HE to be used for HGCal + H2HE = 3, // H2 TB with includng HE + Run3 = 4, // Run3 with inclusionof ZDC + Run4 = 5, // Post LS3 + Run2A = 6, // With extended channels for HF + Run2B = 7, // With extended channels for HE + Run2C = 8 // With extended channels for HB + }; enum TriggerMode { TriggerMode_2009 = 0, // HF is summed in 3x2 regions diff --git a/Geometry/HcalCommonData/src/HcalTopologyMode.cc b/Geometry/HcalCommonData/src/HcalTopologyMode.cc index 7e2122bb56b0b..4d319ea10f89c 100644 --- a/Geometry/HcalCommonData/src/HcalTopologyMode.cc +++ b/Geometry/HcalCommonData/src/HcalTopologyMode.cc @@ -8,6 +8,9 @@ StringToEnumParser::StringToEnumParser() { enumMap["HcalTopologyMode::H2HE"] = HcalTopologyMode::H2HE; enumMap["HcalTopologyMode::Run3"] = HcalTopologyMode::Run3; enumMap["HcalTopologyMode::Run4"] = HcalTopologyMode::Run4; + enumMap["HcalTopologyMode::Run2A"] = HcalTopologyMode::Run2A; + enumMap["HcalTopologyMode::Run2B"] = HcalTopologyMode::Run2B; + enumMap["HcalTopologyMode::Run2C"] = HcalTopologyMode::Run2C; } template <>