Skip to content

Commit

Permalink
Merge pull request #43681 from swagata87/fix2017
Browse files Browse the repository at this point in the history
Use HCAL noise cuts from DB only for Run3 and Phase2
  • Loading branch information
cmsbuild authored Jan 10, 2024
2 parents 7924ce4 + 534bb08 commit f5cbbf1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
hbheRecHitsTag = cms.InputTag("hltHbhereco"),
maxSeverityHB = cms.int32(9),
maxSeverityHE = cms.int32(9),
usePFThresholdsFromDB = cms.bool(True),
superClustersArePF = cms.bool(True)
),
cms.PSet(
Expand Down
1 change: 1 addition & 0 deletions RecoHI/Configuration/python/Reconstruction_hiPF_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
hbheRecHitsTag = cms.InputTag("hbhereco"),
maxSeverityHB = cms.int32(9),
maxSeverityHE = cms.int32(9),
usePFThresholdsFromDB = cms.bool(True),
superClustersArePF = cms.bool(True) ),
# all secondary track importers
cms.PSet( importerName = cms.string("GeneralTracksImporter"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class SuperClusterImporter : public BlockElementImporterBase {
const edm::EDGetTokenT<HBHERecHitCollection> hbheRecHitsTag_;
const int maxSeverityHB_;
const int maxSeverityHE_;
bool cutsFromDB;
CaloTowerConstituentsMap const* towerMap_;
CaloGeometry const* caloGeom_;
HcalTopology const* hcalTopo_;
Expand Down Expand Up @@ -71,19 +72,24 @@ SuperClusterImporter::SuperClusterImporter(const edm::ParameterSet& conf, edm::C
hbheRecHitsTag_(cc.consumes(conf.getParameter<edm::InputTag>("hbheRecHitsTag"))),
maxSeverityHB_(conf.getParameter<int>("maxSeverityHB")),
maxSeverityHE_(conf.getParameter<int>("maxSeverityHE")),
cutsFromDB(conf.getParameter<bool>("usePFThresholdsFromDB")),
_superClustersArePF(conf.getParameter<bool>("superClustersArePF")),
_ctmapToken(cc.esConsumes<edm::Transition::BeginLuminosityBlock>()),
caloGeometryToken_{cc.esConsumes<edm::Transition::BeginLuminosityBlock>()},
hcalTopologyToken_{cc.esConsumes<edm::Transition::BeginLuminosityBlock>()},
hcalChannelQualityToken_{cc.esConsumes<edm::Transition::BeginLuminosityBlock>(edm::ESInputTag("", "withTopo"))},
hcalSevLvlComputerToken_{cc.esConsumes<edm::Transition::BeginLuminosityBlock>()} {
hcalCutsToken_ =
cc.esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginLuminosityBlock>(edm::ESInputTag("", "withTopo"));
if (cutsFromDB) {
hcalCutsToken_ = cc.esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginLuminosityBlock>(
edm::ESInputTag("", "withTopo"));
}
}

void SuperClusterImporter::updateEventSetup(const edm::EventSetup& es) {
towerMap_ = &es.getData(_ctmapToken);
hcalCuts = &es.getData(hcalCutsToken_);
if (cutsFromDB) {
hcalCuts = &es.getData(hcalCutsToken_);
}
caloGeom_ = &es.getData(caloGeometryToken_);
hcalTopo_ = &es.getData(hcalTopologyToken_);
hcalChannelQual_ = &es.getData(hcalChannelQualityToken_);
Expand Down
6 changes: 6 additions & 0 deletions RecoParticleFlow/PFProducer/python/particleFlowBlock_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
hbheRecHitsTag = cms.InputTag('hbhereco'),
maxSeverityHB = cms.int32(9),
maxSeverityHE = cms.int32(9),
usePFThresholdsFromDB = cms.bool(False),
superClustersArePF = cms.bool(True) ),
cms.PSet( importerName = cms.string("ConversionTrackImporter"),
source = cms.InputTag("pfConversions"),
Expand Down Expand Up @@ -248,3 +249,8 @@ def _findIndicesByModule(name):
particleFlowBlock,
elementImporters = _addTimingLayer
)

#--- Use DB conditions for cuts&seeds for Run3 and phase2
from Configuration.Eras.Modifier_hcalPfCutsFromDB_cff import hcalPfCutsFromDB
hcalPfCutsFromDB.toModify( _scImporter,
usePFThresholdsFromDB = True)

0 comments on commit f5cbbf1

Please sign in to comment.