From 5a8615309f4f1cd831487274bb2c8e8eb1d302e8 Mon Sep 17 00:00:00 2001 From: Salavat Date: Sat, 28 Oct 2023 10:39:57 +0200 Subject: [PATCH] set Phase2 hardcoded PFcuts squash 3 commits --- .../HcalAlgos/interface/HcalDbHardcode.h | 2 +- .../HcalAlgos/src/HcalDbHardcode.cc | 27 ++++++++++++++++++- .../src/HcalHardcodeCalibrations.cc | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h b/CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h index 269812057cbe7..f75c6d95afb7e 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h @@ -101,7 +101,7 @@ class HcalDbHardcode { HcalPedestalWidth makePedestalWidth(HcalGenericDetId fId, bool eff, const HcalTopology* topo, double intlumi); HcalGain makeGain(HcalGenericDetId fId, bool fSmear = false) const; HcalGainWidth makeGainWidth(HcalGenericDetId fId) const; - HcalPFCut makePFCut(HcalGenericDetId fId) const; + HcalPFCut makePFCut(HcalGenericDetId fId, double intlumi, bool noHE) const; HcalZSThreshold makeZSThreshold(HcalGenericDetId fId) const; HcalQIECoder makeQIECoder(HcalGenericDetId fId) const; HcalCalibrationQIECoder makeCalibrationQIECoder(HcalGenericDetId fId) const; diff --git a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc index e37868d5e9e9d..85aa02726994e 100644 --- a/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc +++ b/CalibCalorimetry/HcalAlgos/src/HcalDbHardcode.cc @@ -178,9 +178,34 @@ HcalGainWidth HcalDbHardcode::makeGainWidth(HcalGenericDetId fId) const { // Ge return result; } -HcalPFCut HcalDbHardcode::makePFCut(HcalGenericDetId fId) const { // GeV +HcalPFCut HcalDbHardcode::makePFCut(HcalGenericDetId fId, double intLumi, bool noHE) const { // GeV + + // assign default dummy parameters float value0 = getParameters(fId).noiseThreshold(); float value1 = getParameters(fId).seedThreshold(); + + // lumi-dependent stuff for Phase2 + + if (noHE && fId.genericSubdet() == HcalGenericDetId::HcalGenBarrel) { // HB Phase2 + + // from SLHCUpgradeSimulations/Configuration/python/aging.py + const double lumis[] = {300, 1000, 3000, 4500}; // integrated lumi points + // row by row initialization + const float cuts[4][4] = {{0.4, 0.5, 0.6, 0.6}, {0.8, 1.2, 1.2, 1.2}, {1.0, 2.0, 2.0, 2.0}, {1.25, 2.5, 2.5, 2.5}}; + const float seeds[4][4] = { + {0.5, 0.625, 0.75, 0.75}, {1.0, 1.5, 1.5, 1.5}, {1.25, 2.5, 2.5, 2.5}, {1.5, 3.0, 3.0, 3.0}}; + const double eps = 1.e-6; + + HcalDetId hid(fId); + int depth_m1 = hid.depth() - 1; + for (int i = 0; i < 4; i++) { + if (std::abs(intLumi - lumis[i]) < eps) { + value0 = cuts[i][depth_m1]; + value1 = seeds[i][depth_m1]; + } + } + } + HcalPFCut result(fId.rawId(), value0, value1); return result; } diff --git a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc index 70d8348991d76..99ef352423218 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalHardcodeCalibrations.cc @@ -438,7 +438,7 @@ std::unique_ptr HcalHardcodeCalibrations::producePFCuts(const HcalPF for (auto cell : cells) { // Use only standard Hcal channels for now, no TrigPrims if (!cell.isHcalTrigTowerDetId()) { - HcalPFCut item = dbHardcode.makePFCut(cell); + HcalPFCut item = dbHardcode.makePFCut(cell, iLumi, dbHardcode.killHE()); result->addValues(item); } }