From 31c743f582400dd7686eb68504e20cf2a68abc60 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sat, 2 Oct 2021 02:06:27 +0200 Subject: [PATCH 1/2] Modernize the remaining HCAL AlCaReco producers --- .../plugins/AlCaGammaJetProducer.cc | 75 ++++++++------- .../plugins/AlCaGammaJetSelector.cc | 13 +-- .../plugins/AlCaHOCalibProducer.cc | 92 ++++++++++--------- .../plugins/PrescalerFHN.cc | 3 +- .../python/alcagammajet_cfi.py | 29 +----- .../python/alcahomuon_cfi.py | 22 +---- .../python/alcahomuoncosmics_cfi.py | 23 +---- 7 files changed, 110 insertions(+), 147 deletions(-) diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc index 944a3564b1b7c..5ada273df77a7 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetProducer.cc @@ -5,10 +5,11 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "DataFormats/DetId/interface/DetId.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" @@ -39,7 +40,9 @@ class AlCaGammaJetProducer : public edm::global::EDProducer<> { public: explicit AlCaGammaJetProducer(const edm::ParameterSet&); + ~AlCaGammaJetProducer() override = default; void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: bool select(const reco::PhotonCollection&, const reco::PFJetCollection&) const; @@ -156,107 +159,95 @@ bool AlCaGammaJetProducer::select(const reco::PhotonCollection& ph, const reco:: } return false; } + // ------------ method called to produce the data ------------ void AlCaGammaJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup&) const { // Access the collections from iEvent - edm::Handle phoHandle; - iEvent.getByToken(tok_Photon_, phoHandle); + auto const& phoHandle = iEvent.getHandle(tok_Photon_); if (!phoHandle.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get the product " << labelPhoton_; return; } const reco::PhotonCollection& photon = *(phoHandle.product()); - edm::Handle pfjet; - iEvent.getByToken(tok_PFJet_, pfjet); + auto const& pfjet = iEvent.getHandle(tok_PFJet_); if (!pfjet.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFJet_; return; } const reco::PFJetCollection& pfjets = *(pfjet.product()); - edm::Handle pfc; - iEvent.getByToken(tok_PFCand_, pfc); + auto const& pfc = iEvent.getHandle(tok_PFCand_); if (!pfc.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFCandidate_; return; } const reco::PFCandidateCollection& pfcand = *(pfc.product()); - edm::Handle vt; - iEvent.getByToken(tok_Vertex_, vt); + auto const& vt = iEvent.getHandle(tok_Vertex_); if (!vt.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelVertex_; return; } const reco::VertexCollection& vtx = *(vt.product()); - edm::Handle pfmt; - iEvent.getByToken(tok_PFMET_, pfmt); + auto const& pfmt = iEvent.getHandle(tok_PFMET_); if (!pfmt.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFMET_; return; } const reco::PFMETCollection& pfmet = *(pfmt.product()); - edm::Handle>> hbhe; - iEvent.getByToken(tok_HBHE_, hbhe); + auto const& hbhe = iEvent.getHandle(tok_HBHE_); if (!hbhe.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHBHE_; return; } const edm::SortedCollection>& Hithbhe = *(hbhe.product()); - edm::Handle>> ho; - iEvent.getByToken(tok_HO_, ho); + auto const& ho = iEvent.getHandle(tok_HO_); if (!ho.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHO_; return; } const edm::SortedCollection>& Hitho = *(ho.product()); - edm::Handle>> hf; - iEvent.getByToken(tok_HF_, hf); + auto const& hf = iEvent.getHandle(tok_HF_); if (!hf.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHF_; return; } const edm::SortedCollection>& Hithf = *(hf.product()); - edm::Handle trig; - iEvent.getByToken(tok_TrigRes_, trig); + auto const& trig = iEvent.getHandle(tok_TrigRes_); if (!trig.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelTrigger_; return; } const edm::TriggerResults& trigres = *(trig.product()); - edm::Handle rh; - iEvent.getByToken(tok_Rho_, rh); + auto const& rh = iEvent.getHandle(tok_Rho_); if (!rh.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelRho_; return; } const double rho_val = *(rh.product()); - edm::Handle gsf; - iEvent.getByToken(tok_GsfElec_, gsf); + auto const& gsf = iEvent.getHandle(tok_GsfElec_); if (!gsf.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelGsfEle_; return; } const reco::GsfElectronCollection& gsfele = *(gsf.product()); - edm::Handle con; - iEvent.getByToken(tok_Conv_, con); + auto const& con = iEvent.getHandle(tok_Conv_); if (!con.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelConv_; return; } const reco::ConversionCollection& conv = *(con.product()); - edm::Handle bs; - iEvent.getByToken(tok_BS_, bs); + auto const& bs = iEvent.getHandle(tok_BS_); if (!bs.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelBeamSpot_; return; @@ -287,10 +278,8 @@ void AlCaGammaJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm: iEvent.emplace(put_rho_, rho_val); iEvent.emplace(put_conv_, conv); - edm::Handle> loosePhotonQual; - iEvent.getByToken(tok_loosePhoton_, loosePhotonQual); - edm::Handle> tightPhotonQual; - iEvent.getByToken(tok_tightPhoton_, tightPhotonQual); + auto const& loosePhotonQual = iEvent.getHandle(tok_loosePhoton_); + auto const& tightPhotonQual = iEvent.getHandle(tok_tightPhoton_); if (loosePhotonQual.isValid() && tightPhotonQual.isValid()) { miniLoosePhoton.reserve(photon.size()); miniTightPhoton.reserve(photon.size()); @@ -329,4 +318,26 @@ void AlCaGammaJetProducer::produce(edm::StreamID, edm::Event& iEvent, const edm: return; } +void AlCaGammaJetProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("PhoInput", edm::InputTag("gedPhotons")); + desc.add("PFjetInput", edm::InputTag("ak4PFJetsCHS")); + desc.add("HBHEInput", edm::InputTag("hbhereco")); + desc.add("HFInput", edm::InputTag("hfreco")); + desc.add("HOInput", edm::InputTag("horeco")); + desc.add("METInput", edm::InputTag("pfMet")); + desc.add("TriggerResults", edm::InputTag("TriggerResults::HLT")); + desc.add("gsfeleInput", edm::InputTag("gedGsfElectrons")); + desc.add("particleFlowInput", edm::InputTag("particleFlow")); + desc.add("VertexInput", edm::InputTag("offlinePrimaryVertices")); + desc.add("ConversionsInput", edm::InputTag("allConversions")); + desc.add("rhoInput", edm::InputTag("fixedGridRhoFastjetAll")); + desc.add("BeamSpotInput", edm::InputTag("offlineBeamSpot")); + desc.add("PhoLoose", edm::InputTag("PhotonIDProdGED", "PhotonCutBasedIDLoose")); + desc.add("PhoTight", edm::InputTag("PhotonIDProdGED", "PhotonCutBasedIDTight")); + desc.add("MinPtJet", 10.0); + desc.add("MinPtPhoton", 10.0); + descriptions.add("alcaGammaJetProducer", desc); +} + DEFINE_FWK_MODULE(AlCaGammaJetProducer); diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetSelector.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetSelector.cc index 6312302cfde2f..d0554c4728ac2 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetSelector.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaGammaJetSelector.cc @@ -27,6 +27,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "DataFormats/EgammaCandidates/interface/Photon.h" #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" @@ -47,7 +48,7 @@ namespace AlCaGammaJet { class AlCaGammaJetSelector : public edm::stream::EDFilter > { public: explicit AlCaGammaJetSelector(const edm::ParameterSet&, const AlCaGammaJet::Counters* count); - ~AlCaGammaJetSelector() override; + ~AlCaGammaJetSelector() override = default; static std::unique_ptr initializeGlobalCache(edm::ParameterSet const&) { return std::make_unique(); @@ -101,8 +102,6 @@ AlCaGammaJetSelector::AlCaGammaJetSelector(const edm::ParameterSet& iConfig, con tok_PFJet_ = consumes(labelPFJet_); } -AlCaGammaJetSelector::~AlCaGammaJetSelector() {} - // // member functions // @@ -116,7 +115,7 @@ void AlCaGammaJetSelector::fillDescriptions(edm::ConfigurationDescriptions& desc desc.add("PFjetInput", edm::InputTag("ak4PFJetsCHS")); desc.add("MinPtJet", 10.0); desc.add("MinPtPhoton", 10.0); - descriptions.addDefault(desc); + descriptions.add("alcaGammaJetSelector", desc); } // ------------ method called on each new Event ------------ @@ -124,16 +123,14 @@ bool AlCaGammaJetSelector::filter(edm::Event& iEvent, const edm::EventSetup& iSe nProcessed_++; // Access the collections from iEvent - edm::Handle phoHandle; - iEvent.getByToken(tok_Photon_, phoHandle); + auto const& phoHandle = iEvent.getHandle(tok_Photon_); if (!phoHandle.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get the product " << labelPhoton_; return false; // do not filter } const reco::PhotonCollection photons = *(phoHandle.product()); - edm::Handle pfjetHandle; - iEvent.getByToken(tok_PFJet_, pfjetHandle); + auto const& pfjetHandle = iEvent.getHandle(tok_PFJet_); if (!pfjetHandle.isValid()) { edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFJet_; return false; // do not filter diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc index 2f9bf7975ccc3..b7ec1fcea8346 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc @@ -77,55 +77,47 @@ Ring 0 L0 : Width Tray 6:266.6, 5&4:325.6, 3:330.6, 2:341.6, 1:272.6 // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDProducer.h" - #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/Utilities/interface/InputTag.h" + +#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" +#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" +#include "DataFormats/HcalDetId/interface/HcalDetId.h" +#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" +#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" +#include "DataFormats/GeometrySurface/interface/PlaneBuilder.h" +#include "DataFormats/Luminosity/interface/LumiDetails.h" +#include "DataFormats/Math/interface/Error.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/RecoCandidate/interface/IsoDeposit.h" +#include "DataFormats/Scalers/interface/LumiScalers.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/TrajectorySeed/interface/PropagationDirection.h" +#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" +#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" - -#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" -#include "DataFormats/HcalDetId/interface/HcalDetId.h" -#include "DataFormats/HcalDetId/interface/HcalSubdetector.h" - +#include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/Records/interface/MuonGeometryRecord.h" -#include "DataFormats/TrajectorySeed/interface/PropagationDirection.h" -#include "DataFormats/GeometrySurface/interface/PlaneBuilder.h" - #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/RecoCandidate/interface/IsoDeposit.h" - -#include "DataFormats/HcalCalibObjects/interface/HOCalibVariables.h" -#include "DataFormats/Math/interface/Error.h" -#include "CLHEP/Vector/LorentzVector.h" - -#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h" -#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" - -#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" -#include "DataFormats/Math/interface/Error.h" #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixPropagator.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "DataFormats/Luminosity/interface/LumiDetails.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Scalers/interface/LumiScalers.h" // Necessary includes for identify severity of flagged problems in HO rechits //#include "RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h" @@ -133,6 +125,7 @@ Ring 0 L0 : Width Tray 6:266.6, 5&4:325.6, 3:330.6, 2:341.6, 1:272.6 #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" #include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" +#include "CLHEP/Vector/LorentzVector.h" #include "CLHEP/Units/GlobalPhysicalConstants.h" #include "CLHEP/Units/GlobalSystemOfUnits.h" @@ -150,7 +143,9 @@ Ring 0 L0 : Width Tray 6:266.6, 5&4:325.6, 3:330.6, 2:341.6, 1:272.6 class AlCaHOCalibProducer : public edm::one::EDProducer { public: explicit AlCaHOCalibProducer(const edm::ParameterSet&); + ~AlCaHOCalibProducer() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); typedef Basic3DVector PositionType; typedef Basic3DVector DirectionType; typedef Basic3DVector RotationType; @@ -290,6 +285,25 @@ AlCaHOCalibProducer::AlCaHOCalibProducer(const edm::ParameterSet& iConfig) { // member functions // +void AlCaHOCalibProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("hbheInput", edm::InputTag("hbhereco")); + desc.addUntracked("hotime", false); + desc.addUntracked("hbinfo", false); + desc.addUntracked("sigma", 1.0); + desc.addUntracked("plotOccupancy", false); + desc.addUntracked("CosmicData", false); + desc.add("hoInput", edm::InputTag("horeco")); + desc.add("towerInput", edm::InputTag("towerMaker")); + desc.addUntracked("RootFileName", "test.root"); + desc.addUntracked("m_scale", 4.0); + desc.addUntracked("debug", false); + desc.addUntracked("muons", edm::InputTag("muons")); + desc.add("vertexTags", edm::InputTag("offlinePrimaryVertices")); + desc.add("lumiTags", edm::InputTag("scalersRawToDigi")); + descriptions.add("alcaHOCalibProducer", desc); +} + // ------------ method called to produce the data ------------ void AlCaHOCalibProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { int irun = iEvent.id().run(); @@ -314,23 +328,21 @@ void AlCaHOCalibProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe tmpHOCalib.inslumi = -1.; if (m_cosmic) { - iEvent.getByToken(tok_muonsCosmic_, cosmicmuon); + cosmicmuon = iEvent.getHandle(tok_muonsCosmic_); muonOK = (cosmicmuon.isValid() && !cosmicmuon->empty()); } else { - iEvent.getByToken(tok_muons_, collisionmuon); + collisionmuon = iEvent.getHandle(tok_muons_); muonOK = (collisionmuon.isValid() && !collisionmuon->empty()); if (iEvent.isRealData()) { - edm::Handle primaryVertices; - iEvent.getByToken(tok_vertex_, primaryVertices); + auto const& primaryVertices = iEvent.getHandle(tok_vertex_); if (primaryVertices.isValid()) { tmpHOCalib.nprim = primaryVertices->size(); } tmpHOCalib.inslumi = 0.; - edm::Handle lumiScale; - iEvent.getByToken(tok_lumi_, lumiScale); + auto const& lumiScale = iEvent.getHandle(tok_lumi_); if (lumiScale.isValid()) { if (lumiScale->empty()) { @@ -496,8 +508,7 @@ void AlCaHOCalibProducer::fillHOStore(const reco::TrackRef& ncosm, } } else { // if (muonTags_.label() =="muons") { - edm::Handle calotower; - iEvent.getByToken(tok_tower_, calotower); + auto const& calotower = iEvent.getHandle(tok_tower_); for (CaloTowerCollection::const_iterator calt = calotower->begin(); calt != calotower->end(); calt++) { //CMSSW_2_1_x const math::XYZVector towermom = (*calt).momentum(); @@ -748,9 +759,7 @@ void AlCaHOCalibProducer::fillHOStore(const reco::TrackRef& ncosm, tmpHOCalib.hbhesig[ij] = -100.0; } - edm::Handle hbheht; // iEvent.getByType(hbheht); - iEvent.getByToken(tok_hbhe_, hbheht); - + auto const& hbheht =iEvent.getHandle(tok_hbhe_); // iEvent.getByType(hbheht); if (!(*hbheht).empty()) { if ((*hbheht).empty()) throw(int)(*hbheht).size(); @@ -806,8 +815,7 @@ void AlCaHOCalibProducer::fillHOStore(const reco::TrackRef& ncosm, } } //m_hbinfo #endif - edm::Handle hoht; - iEvent.getByToken(tok_ho_, hoht); + auto const& hoht = iEvent.getHandle(tok_ho_); if (!(*hoht).empty()) { for (HORecHitCollection::const_iterator jk = (*hoht).begin(); jk != (*hoht).end(); jk++) { diff --git a/Calibration/HcalAlCaRecoProducers/plugins/PrescalerFHN.cc b/Calibration/HcalAlCaRecoProducers/plugins/PrescalerFHN.cc index 6e74be577813e..c794a66632a2b 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/PrescalerFHN.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/PrescalerFHN.cc @@ -120,8 +120,7 @@ bool PrescalerFHN::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { // Trying to mirror HLTrigger/HLTfilters/src/HLTHighLevel.cc where possible - Handle trh; - iEvent.getByToken(tok_trigger, trh); + auto const& trh = iEvent.getHandle(tok_trigger); if (trh.isValid()) { LogDebug("") << "TriggerResults found, number of HLT paths: " << trh->size(); diff --git a/Calibration/HcalAlCaRecoProducers/python/alcagammajet_cfi.py b/Calibration/HcalAlCaRecoProducers/python/alcagammajet_cfi.py index 14dc850e7b7c4..6afff74e0f025 100644 --- a/Calibration/HcalAlCaRecoProducers/python/alcagammajet_cfi.py +++ b/Calibration/HcalAlCaRecoProducers/python/alcagammajet_cfi.py @@ -1,32 +1,11 @@ import FWCore.ParameterSet.Config as cms # producer for alcadijets (HCAL gamma-jet) -GammaJetProd = cms.EDProducer("AlCaGammaJetProducer", - PhoInput = cms.InputTag("gedPhotons"), - PFjetInput = cms.InputTag("ak4PFJetsCHS"), - HBHEInput = cms.InputTag("hbhereco"), - HFInput = cms.InputTag("hfreco"), - HOInput = cms.InputTag("horeco"), - METInput = cms.InputTag("pfMet"), - TriggerResults = cms.InputTag("TriggerResults::HLT"), - gsfeleInput = cms.InputTag("gedGsfElectrons"), - particleFlowInput = cms.InputTag("particleFlow"), - VertexInput = cms.InputTag("offlinePrimaryVertices"), - ConversionsInput = cms.InputTag("allConversions"), - rhoInput = cms.InputTag("fixedGridRhoFastjetAll"), - BeamSpotInput = cms.InputTag("offlineBeamSpot"), - PhoLoose = cms.InputTag("PhotonIDProdGED", "PhotonCutBasedIDLoose"), - PhoTight = cms.InputTag("PhotonIDProdGED", "PhotonCutBasedIDTight"), - MinPtJet = cms.double(10.0), - MinPtPhoton = cms.double(10.0) - ) +import Calibration.HcalAlCaRecoProducers.alcaGammaJetProducer_cfi +GammaJetProd = Calibration.HcalAlCaRecoProducers.alcaGammaJetProducer_cfi.alcaGammaJetProducer.clone() -GammaJetFilter = cms.EDFilter("AlCaGammaJetSelector", - PhoInput = cms.InputTag("gedPhotons"), - PFjetInput = cms.InputTag("ak4PFJetsCHS"), - MinPtJet = cms.double(10.0), - MinPtPhoton = cms.double(10.0) - ) +import Calibration.HcalAlCaRecoProducers.alcaGammaJetSelector_cfi +GammaJetFilter = Calibration.HcalAlCaRecoProducers.alcaGammaJetSelector_cfi.alcaGammaJetSelector.clone() diff --git a/Calibration/HcalAlCaRecoProducers/python/alcahomuon_cfi.py b/Calibration/HcalAlCaRecoProducers/python/alcahomuon_cfi.py index c20cae7eca51f..0df06170aead0 100644 --- a/Calibration/HcalAlCaRecoProducers/python/alcahomuon_cfi.py +++ b/Calibration/HcalAlCaRecoProducers/python/alcahomuon_cfi.py @@ -6,24 +6,8 @@ #process.load('Configuration.StandardSequences.Reconstruction_Data_cff') #from Configuration.StandardSequences.Reconstruction_Data_cff import * from RecoLocalCalo.HcalRecAlgos.hcalRecAlgoESProd_cfi import * -hoCalibProducer = cms.EDProducer("AlCaHOCalibProducer", - hbheInput = cms.InputTag("hbhereco"), - hotime = cms.untracked.bool(False), - hbinfo = cms.untracked.bool(False), - sigma = cms.untracked.double(1.0), - plotOccupancy = cms.untracked.bool(False), - CosmicData = cms.untracked.bool(False), - hoInput = cms.InputTag("horeco"), - towerInput = cms.InputTag("towerMaker"), - RootFileName = cms.untracked.string('test.root'), - m_scale = cms.untracked.double(4.0), - debug = cms.untracked.bool(False), - muons = cms.untracked.InputTag("muons"), - #muons = cms.untracked.InputTag("cosmicMuons"), - #muons = cms.untracked.InputTag("standAloneMuons"), - vertexTags = cms.InputTag("offlinePrimaryVertices"), - lumiTags = cms.InputTag("scalersRawToDigi") - #lumiTags = cms.InputTag("lumiProducer") -) + +import Calibration.HcalAlCaRecoProducers.alcaHOCalibProducer_cfi +hoCalibProducer = Calibration.HcalAlCaRecoProducers.alcaHOCalibProducer_cfi.alcaHOCalibProducer.clone() diff --git a/Calibration/HcalAlCaRecoProducers/python/alcahomuoncosmics_cfi.py b/Calibration/HcalAlCaRecoProducers/python/alcahomuoncosmics_cfi.py index 1ff126a493549..e0e7d452375bb 100644 --- a/Calibration/HcalAlCaRecoProducers/python/alcahomuoncosmics_cfi.py +++ b/Calibration/HcalAlCaRecoProducers/python/alcahomuoncosmics_cfi.py @@ -7,24 +7,9 @@ #from Configuration.StandardSequences.Reconstruction_Data_cff import * from RecoLocalCalo.HcalRecAlgos.hcalRecAlgoESProd_cfi import * -hoCalibCosmicsProducer = cms.EDProducer("AlCaHOCalibProducer", - hbheInput = cms.InputTag("hbhereco"), - hotime = cms.untracked.bool(False), - hbinfo = cms.untracked.bool(False), - sigma = cms.untracked.double(1.0), - plotOccupancy = cms.untracked.bool(False), - CosmicData = cms.untracked.bool(True), - hoInput = cms.InputTag("horeco"), - towerInput = cms.InputTag("towerMaker"), - digiInput = cms.untracked.bool(False), - RootFileName = cms.untracked.string('test.root'), - m_scale = cms.untracked.double(4.0), - debug = cms.untracked.bool(False), - muons = cms.untracked.InputTag("cosmicMuons"), - vertexTags = cms.InputTag("offlinePrimaryVertices"), - lumiTags = cms.InputTag("scalersRawToDigi") - #lumiTags = cms.InputTag("lumiProducer") - +import Calibration.HcalAlCaRecoProducers.alcaHOCalibProducer_cfi +hoCalibCosmicsProducer = Calibration.HcalAlCaRecoProducers.alcaHOCalibProducer_cfi.alcaHOCalibProducer.clone( + CosmicData = True, + muons = cms.untracked.InputTag("cosmicMuons") ) - From 5ec10cce0be6a106b7a52b9bc16843dcf5729ce2 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Sat, 2 Oct 2021 02:36:18 +0200 Subject: [PATCH 2/2] Code check --- .../HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc index b7ec1fcea8346..1e5290d2ad57c 100644 --- a/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc +++ b/Calibration/HcalAlCaRecoProducers/plugins/AlCaHOCalibProducer.cc @@ -759,7 +759,7 @@ void AlCaHOCalibProducer::fillHOStore(const reco::TrackRef& ncosm, tmpHOCalib.hbhesig[ij] = -100.0; } - auto const& hbheht =iEvent.getHandle(tok_hbhe_); // iEvent.getByType(hbheht); + auto const& hbheht = iEvent.getHandle(tok_hbhe_); // iEvent.getByType(hbheht); if (!(*hbheht).empty()) { if ((*hbheht).empty()) throw(int)(*hbheht).size(); @@ -815,7 +815,7 @@ void AlCaHOCalibProducer::fillHOStore(const reco::TrackRef& ncosm, } } //m_hbinfo #endif - auto const& hoht = iEvent.getHandle(tok_ho_); + auto const& hoht = iEvent.getHandle(tok_ho_); if (!(*hoht).empty()) { for (HORecHitCollection::const_iterator jk = (*hoht).begin(); jk != (*hoht).end(); jk++) {