Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt PF code to read Hcal thresholds from GT #43025

Merged
merged 7 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Configuration/Eras/python/Era_Run3_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from Configuration.Eras.Modifier_run2_HLTconditions_2018_cff import run2_HLTconditions_2018
from Configuration.Eras.Modifier_run3_RPC_cff import run3_RPC
from Configuration.Eras.Modifier_run3_ecal_cff import run3_ecal
from Configuration.Eras.Modifier_hcalPfCutsFromDB_cff import hcalPfCutsFromDB

Run3 = cms.ModifierChain(Run2_2018.copyAndExclude([run2_GEM_2017, ctpps_2018, run2_egamma_2018, run2_HLTconditions_2018]),
run3_common, run3_egamma, run3_GEM, run3_HB, run3_HFSL, stage2L1Trigger_2021, ctpps_2022, dd4hep, run3_RPC, run3_ecal)
run3_common, run3_egamma, run3_GEM, run3_HB, run3_HFSL, stage2L1Trigger_2021, ctpps_2022, dd4hep, run3_RPC, run3_ecal, hcalPfCutsFromDB)

3 changes: 3 additions & 0 deletions Configuration/Eras/python/Modifier_hcalPfCutsFromDB_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import FWCore.ParameterSet.Config as cms

hcalPfCutsFromDB = cms.Modifier()
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("hltParticleFlowRecHitECALL1Seeded"),
usePFThresholdsFromDB = cms.bool(False),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to keep the phase-2 HLT behind offline at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure I understood the question. For ECAL, this boolean needs to be False as ECAL thresholds are handled differently. In offline config also, for ECAL it is false.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's confusing to have the same parameter name if different thresholds are applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same code runs for all calorimeters (ECAL, HB, HE, HO, HF). So it is kept as True for HB and HE, where it is needed. And for others it is kept as False.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing this behaviour would profit the maintainability of the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mean to delay this PR, but just a question for my own understanding. (the question is not specific to Phase 2).

In the case of ECAL (and following the analogy with HCAL), are any of the PFCluster config parameters (e.g. seedingThreshold or gatheringThreshold) related to the values in the GT record of type EcalPFRecHitThresholdsRcd ? Is the EcalPFRecHitThresholds tag used in PFlow producers at any point ? (if not, should that happen eventually ?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ECAL, things work a bit differently. In the step where PFRecHits are produced from ECAL RecHits, we use the EcalPFRecHitThresholdsRcd from GT. These are per-crystal noise thresholds, so they are so many in numbers (~75K) that one has to use GT-based approach. Also, they are updated once a year, generally.
Here is the code for that:

PFRecHitQTestDBThreshold(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
: PFRecHitQTestBase(iConfig, cc),
applySelectionsToAllCrystals_(iConfig.getParameter<bool>("applySelectionsToAllCrystals")),
threshToken_(cc.esConsumes()) {}
void beginEvent(const edm::Event& event, const edm::EventSetup& iSetup) override {
ths_ = iSetup.getHandle(threshToken_);
}
bool test(reco::PFRecHit& hit, const EcalRecHit& rh, bool& clean, bool fullReadOut) override {
if (applySelectionsToAllCrystals_)
return pass(hit);
return fullReadOut or pass(hit);
}
bool test(reco::PFRecHit& hit, const HBHERecHit& rh, bool& clean) override { return pass(hit); }
bool test(reco::PFRecHit& hit, const HFRecHit& rh, bool& clean) override { return pass(hit); }
bool test(reco::PFRecHit& hit, const HORecHit& rh, bool& clean) override { return pass(hit); }
bool test(reco::PFRecHit& hit, const CaloTower& rh, bool& clean) override { return pass(hit); }
bool test(reco::PFRecHit& hit, const HGCRecHit& rh, bool& clean) override { return pass(hit); }
protected:
bool applySelectionsToAllCrystals_;
edm::ESHandle<EcalPFRecHitThresholds> ths_;
bool pass(const reco::PFRecHit& hit) {
float threshold = (*ths_)[hit.detId()];
return hit.energy() > threshold;
}
private:
edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> threshToken_;
};

Then, in the clustering step, ECAL has seeding thresholds and gathering thresholds that are passed from the config file, here:

_localMaxSeeds_ECAL = cms.PSet(
algoName = cms.string("LocalMaximumSeedFinder"),
thresholdsByDetector = cms.VPSet(
cms.PSet( detector = cms.string("ECAL_ENDCAP"),
seedingThreshold = cms.double(0.60),
seedingThresholdPt = cms.double(0.15)
),
cms.PSet( detector = cms.string("ECAL_BARREL"),
seedingThreshold = cms.double(0.23),
seedingThresholdPt = cms.double(0.0)
)
),
nNeighbours = cms.int32(8)
)
# topo clusterizer
_topoClusterizer_ECAL = cms.PSet(
algoName = cms.string("Basic2DGenericTopoClusterizer"),
thresholdsByDetector = cms.VPSet(
cms.PSet( detector = cms.string("ECAL_BARREL"),
gatheringThreshold = cms.double(0.08),
gatheringThresholdPt = cms.double(0.0)
),
cms.PSet( detector = cms.string("ECAL_ENDCAP"),
gatheringThreshold = cms.double(0.3),
gatheringThresholdPt = cms.double(0.0)

Since these are just one number for barrel and one for endcap, and they don't need update every year, there is no need to put those in GT. One can of course double check with ECAL DPG if they plan to update these numbers in Run3 or if they plan to put them in GT, but I don't think so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swagata87 , thanks for the explanation !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I thought its better to keep usePFThresholdsFromDB as false for ECAL etc, so that we will not even read the HCAL thresholds from GT in the beginRun of PFClusterProducer if the clustering is happening in ECAL etc. So we will spend less time/resourse hopefully by keeping it False.

I think the cost of this is pretty negligible.
Anyway I am about to sign this PR, but I still find confusing to have the same parameters configured differently in the phase-2 HLT menu depending on the "flavour". Please consider adding a comment to each instance for better documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I have now added a comment to every place where it is False in Phase2 HLT configs.

seedCleaners = cms.VPSet(cms.PSet(
RecHitFlagsToBeExcluded = cms.vstring(),
algoName = cms.string('FlagsCleanerECAL')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("hltParticleFlowRecHitECALUnseeded"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(cms.PSet(
RecHitFlagsToBeExcluded = cms.vstring(),
algoName = cms.string('FlagsCleanerECAL')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("hltParticleFlowRecHitHBHE"),
usePFThresholdsFromDB = cms.bool(True),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('LocalMaximumSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

hltParticleFlowClusterHCAL = cms.EDProducer("PFMultiDepthClusterProducer",
clustersSource = cms.InputTag("hltParticleFlowClusterHBHE"),
usePFThresholdsFromDB = cms.bool(True),
energyCorrector = cms.PSet(

),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
)
)
),
name = cms.string('PFRecHitQTestHCALThresholdVsDepth')
name = cms.string('PFRecHitQTestHCALThresholdVsDepth'),
usePFThresholdsFromDB = cms.bool(True)
),
cms.PSet(
cleaningThresholds = cms.vdouble(0.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitECAL"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(cms.PSet(
RecHitFlagsToBeExcluded = cms.vstring(),
algoName = cms.string('FlagsCleanerECAL')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitHF"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('LocalMaximumSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitHGCL1Seeded"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('PassThruSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitHGC"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('PassThruSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitHGC"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('PassThruSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
),
recHitCleaners = cms.VPSet(),
recHitsSource = cms.InputTag("particleFlowRecHitHO"),
usePFThresholdsFromDB = cms.bool(False),
seedCleaners = cms.VPSet(),
seedFinder = cms.PSet(
algoName = cms.string('LocalMaximumSeedFinder'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
detectorEnum = cms.int32(4),
threshold = cms.vdouble(1.2, 1.8)
)),
name = cms.string('PFRecHitQTestHCALThresholdVsDepth')
name = cms.string('PFRecHitQTestHCALThresholdVsDepth'),
usePFThresholdsFromDB = cms.bool(False)
)
),
src = cms.InputTag("hfreco"),
Expand Down
19 changes: 18 additions & 1 deletion HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,22 @@ def customizeHLTfor42943(process):

return process

def customizeHLTfor43025(process):

for producer in producers_by_type(process, "PFClusterProducer"):
producer.usePFThresholdsFromDB = cms.bool(True)

for producer in producers_by_type(process, "PFMultiDepthClusterProducer"):
producer.usePFThresholdsFromDB = cms.bool(True)

for producer in producers_by_type(process, "PFRecHitProducer"):
if producer.producers[0].name.value() == 'PFHBHERecHitCreator':
producer.producers[0].qualityTests[0].usePFThresholdsFromDB = cms.bool(True)
if producer.producers[0].name.value() == 'PFHFRecHitCreator':
producer.producers[0].qualityTests[1].usePFThresholdsFromDB = cms.bool(False)

return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):

Expand All @@ -272,5 +288,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"):

process = customizeHLTfor42497(process)
process = customizeHLTfor42943(process)

process = customizeHLTfor43025(process)

return process
26 changes: 21 additions & 5 deletions RecoLocalCalo/HcalRecAlgos/plugins/HcalChannelPropertiesEP.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "CondFormats/HcalObjects/interface/HcalRecoParams.h"
#include "CondFormats/DataRecord/interface/HcalRecoParamsRcd.h"

#include "CondFormats/HcalObjects/interface/HcalPFCuts.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"

#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/CaloTopology/interface/HcalTopology.h"
Expand All @@ -26,6 +29,7 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
public:
typedef std::unique_ptr<HcalRecoParams> ReturnType1;
typedef std::unique_ptr<HcalChannelPropertiesVec> ReturnType2;
typedef std::unique_ptr<HcalPFCuts> ReturnType3;

inline HcalChannelPropertiesEP(const edm::ParameterSet&) {
auto cc1 = setWhatProduced(this, &HcalChannelPropertiesEP::produce1);
Expand All @@ -39,13 +43,16 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
sevToken_ = cc2.consumes();
qualToken_ = cc2.consumes(qTag);
geomToken_ = cc2.consumes();

edm::es::Label productLabel("withTopo");
auto cc3 = setWhatProduced(this, &HcalChannelPropertiesEP::produce3, productLabel);
topoToken3_ = cc3.consumes();
pfcutsToken_ = cc3.consumes();
}

inline ~HcalChannelPropertiesEP() override {}

ReturnType1 produce1(const HcalChannelPropertiesAuxRecord& rcd) {
using namespace edm;

const HcalTopology& htopo = rcd.getRecord<HcalRecNumberingRecord>().get(topoToken_);
const HcalRecoParams& params = rcd.getRecord<HcalRecoParamsRcd>().get(paramsToken_);

Expand All @@ -61,8 +68,7 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
// This means that we are sometimes going to rebuild the
// whole table on the lumi block boundaries instead of
// just updating the list of bad channels.
using namespace edm;

//
// Retrieve various event setup records and data products
const HcalDbRecord& dbRecord = rcd.getRecord<HcalDbRecord>();
const HcalDbService& cond = dbRecord.get(condToken_);
Expand Down Expand Up @@ -118,18 +124,28 @@ class HcalChannelPropertiesEP : public edm::ESProducer {
return prod;
}

ReturnType3 produce3(const HcalPFCutsRcd& rcd) {
const HcalTopology& htopo = rcd.get(topoToken3_);
const HcalPFCuts& cuts = rcd.get(pfcutsToken_);

ReturnType3 prod = std::make_unique<HcalPFCuts>(cuts);
prod->setTopo(&htopo);
return prod;
}

HcalChannelPropertiesEP() = delete;
HcalChannelPropertiesEP(const HcalChannelPropertiesEP&) = delete;
HcalChannelPropertiesEP& operator=(const HcalChannelPropertiesEP&) = delete;

private:
edm::ESGetToken<HcalDbService, HcalDbRecord> condToken_;
edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> topoToken_;
edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> topoToken_, topoToken3_;
edm::ESGetToken<HcalRecoParams, HcalRecoParamsRcd> paramsToken_;
edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> sevToken_;
edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> qualToken_;
edm::ESGetToken<CaloGeometry, CaloGeometryRecord> geomToken_;
edm::ESGetToken<HcalRecoParams, HcalChannelPropertiesAuxRecord> myParamsToken_;
edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> pfcutsToken_;
};

DEFINE_FWK_EVENTSETUP_MODULE(HcalChannelPropertiesEP);
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
#include "DataFormats/Common/interface/RefToBaseVector.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
#include "CondTools/Hcal/interface/HcalPFCutsHandler.h"

#include <string>
#include <iostream>
Expand Down Expand Up @@ -87,9 +89,10 @@ class InitialClusteringStepBase {
virtual void updateEvent(const edm::Event&) {}

virtual void buildClusters(const edm::Handle<reco::PFRecHitCollection>&,
const std::vector<bool>& mask, // mask flags
const std::vector<bool>& seeds, // seed flags
reco::PFClusterCollection&) = 0; //output
const std::vector<bool>& mask, // mask flags
const std::vector<bool>& seeds, // seed flags
reco::PFClusterCollection&, //output
const HcalPFCuts*) = 0;

std::ostream& operator<<(std::ostream& o) const {
o << "InitialClusteringStep with algo \"" << _algoName << "\" located " << _nSeeds << " seeds and built "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
#include "CondTools/Hcal/interface/HcalPFCutsHandler.h"

#include <string>

Expand All @@ -27,9 +29,9 @@ class PFCPositionCalculatorBase {
virtual void update(const edm::EventSetup&) {}

// here we transform one PFCluster to use the new position calculation
virtual void calculateAndSetPosition(reco::PFCluster&) = 0;
virtual void calculateAndSetPosition(reco::PFCluster&, const HcalPFCuts*) = 0;
// here you call a loop inside to transform the whole vector
virtual void calculateAndSetPositions(reco::PFClusterCollection&) = 0;
virtual void calculateAndSetPositions(reco::PFClusterCollection&, const HcalPFCuts*) = 0;

const std::string& name() const { return _algoName; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "DataFormats/ParticleFlowReco/interface/PFClusterFwd.h"

#include "RecoParticleFlow/PFClusterProducer/interface/PFCPositionCalculatorBase.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
#include "CondTools/Hcal/interface/HcalPFCutsHandler.h"

#include <string>
#include <iostream>
Expand Down Expand Up @@ -41,7 +43,8 @@ class PFClusterBuilderBase {

virtual void buildClusters(const reco::PFClusterCollection& topos,
const std::vector<bool>& seedable,
reco::PFClusterCollection& outclus) = 0;
reco::PFClusterCollection& outclus,
const HcalPFCuts*) = 0;

std::ostream& operator<<(std::ostream& o) const {
o << "PFClusterBuilder with algo \"" << _algoName << "\" located " << _nSeeds << " seeds and built "
Expand Down
28 changes: 25 additions & 3 deletions RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "Geometry/Records/interface/HcalRecNumberingRecord.h"
#include "Geometry/CaloTopology/interface/HcalTopology.h"
#include "DataFormats/METReco/interface/HcalPhase1FlagLabels.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
#include "CondTools/Hcal/interface/HcalPFCutsHandler.h"

#include <iostream>

Expand Down Expand Up @@ -258,7 +260,12 @@ class PFRecHitQTestHCALThresholdVsDepth : public PFRecHitQTestBase {
PFRecHitQTestHCALThresholdVsDepth() {}

PFRecHitQTestHCALThresholdVsDepth(const edm::ParameterSet& iConfig, edm::ConsumesCollector& cc)
: PFRecHitQTestBase(iConfig, cc), psets_(iConfig.getParameter<std::vector<edm::ParameterSet>>("cuts")) {
: PFRecHitQTestBase(iConfig, cc),
psets_(iConfig.getParameter<std::vector<edm::ParameterSet>>("cuts")),
cutsFromDB(iConfig.getParameter<bool>("usePFThresholdsFromDB")) {
if (cutsFromDB) {
hcalCutsToken_ = cc.esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"));
}
for (auto& pset : psets_) {
depths_.push_back(pset.getParameter<std::vector<int>>("depth"));
thresholds_.push_back(pset.getParameter<std::vector<double>>("threshold"));
Expand All @@ -269,7 +276,11 @@ class PFRecHitQTestHCALThresholdVsDepth : public PFRecHitQTestBase {
}
}

void beginEvent(const edm::Event& event, const edm::EventSetup& iSetup) override {}
void beginEvent(const edm::Event& event, const edm::EventSetup& iSetup) override {
if (cutsFromDB) {
paramPF = &iSetup.getData(hcalCutsToken_);
}
}

bool test(reco::PFRecHit& hit, const EcalRecHit& rh, bool& clean, bool fullReadOut) override { return true; }
bool test(reco::PFRecHit& hit, const HBHERecHit& rh, bool& clean) override {
Expand All @@ -292,16 +303,22 @@ class PFRecHitQTestHCALThresholdVsDepth : public PFRecHitQTestBase {
std::vector<std::vector<int>> depths_;
std::vector<std::vector<double>> thresholds_;
std::vector<int> detector_;
HcalPFCuts const* paramPF = nullptr;

bool test(unsigned aDETID, double energy, double time, bool& clean) {
HcalDetId detid(aDETID);
const HcalPFCut* item = nullptr;
if (cutsFromDB) {
item = paramPF->getValues(detid.rawId());
}

for (unsigned int d = 0; d < detector_.size(); ++d) {
if (detid.subdet() != detector_[d])
continue;
for (unsigned int i = 0; i < thresholds_[d].size(); ++i) {
if (detid.depth() == depths_[d][i]) {
if (energy < thresholds_[d][i]) {
float thres = cutsFromDB ? item->noiseThreshold() : thresholds_[d][i];
if (energy < thres) {
clean = false;
return false;
}
Expand All @@ -311,6 +328,11 @@ class PFRecHitQTestHCALThresholdVsDepth : public PFRecHitQTestBase {
}
return true;
}

private:
edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> htopoToken_;
edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> hcalCutsToken_;
bool cutsFromDB;
};

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
#include "DataFormats/ParticleFlowReco/interface/PFRecHitFwd.h"
#include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
#include "CondTools/Hcal/interface/HcalPFCutsHandler.h"

class SeedFinderBase {
public:
Expand All @@ -15,7 +17,8 @@ class SeedFinderBase {

virtual void findSeeds(const edm::Handle<reco::PFRecHitCollection>& input,
const std::vector<bool>& mask,
std::vector<bool>& seedable) = 0;
std::vector<bool>& seedable,
const HcalPFCuts*) = 0;

const std::string& name() const { return _algoName; }

Expand Down
Loading