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

added esConsumes to modules in L1Trigger /L1ExtraFromDigis #30336

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 22 additions & 1 deletion L1Trigger/L1ExtraFromDigis/interface/L1ExtraParticlesProd.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/Utilities/interface/ESGetToken.h"

#include "DataFormats/L1Trigger/interface/L1EmParticle.h"
#include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
Expand All @@ -36,7 +37,19 @@
#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"

#include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h"
#include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"
#include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
#include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
#include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
// forward declarations
class L1CaloGeometry;

Expand Down Expand Up @@ -79,6 +92,14 @@ class L1ExtraParticlesProd : public edm::stream::EDProducer<> {
// Set this to true when rerunning on RAW data where the GCT did not
// produce a L1GctHtMiss record.
bool ignoreHtMiss_;
edm::ESGetToken<L1MuTriggerScales, L1MuTriggerScalesRcd> muScalesToken_;
edm::ESGetToken<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd> muPtScaleToken_;
edm::ESGetToken<L1CaloGeometry, L1CaloGeometryRecord> caloGeomToken_;
edm::ESGetToken<L1CaloEtScale, L1EmEtScaleRcd> emScaleToken_;
edm::ESGetToken<L1CaloEtScale, L1JetEtScaleRcd> jetScaleToken_;
edm::ESGetToken<L1GctJetFinderParams, L1GctJetFinderParamsRcd> jetFinderParamsToken_;
edm::ESGetToken<L1CaloEtScale, L1HtMissScaleRcd> htMissScaleToken_;
edm::ESGetToken<L1CaloEtScale, L1HfRingEtScaleRcd> hfRingEtScaleToken_;
};

#endif
53 changes: 23 additions & 30 deletions L1Trigger/L1ExtraFromDigis/src/L1ExtraParticlesProd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@
#include "DataFormats/Common/interface/OrphanHandle.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include "CondFormats/DataRecord/interface/L1CaloGeometryRecord.h"
#include "CondFormats/L1TObjects/interface/L1CaloGeometry.h"

#include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"

#include "CondFormats/DataRecord/interface/L1MuTriggerPtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1MuTriggerScalesRcd.h"
#include "CondFormats/L1TObjects/interface/L1MuTriggerPtScale.h"
#include "CondFormats/L1TObjects/interface/L1MuTriggerScales.h"
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"
Expand Down Expand Up @@ -109,6 +94,21 @@ L1ExtraParticlesProd::L1ExtraParticlesProd(const edm::ParameterSet &iConfig)
consumes<L1GctHtMissCollection>(htMissSource_);
consumes<L1GctHFRingEtSumsCollection>(hfRingEtSumsSource_);
consumes<L1GctHFBitCountsCollection>(hfRingBitCountsSource_);

if (produceMuonParticles_) {
muScalesToken_ = esConsumes<L1MuTriggerScales, L1MuTriggerScalesRcd>();
muPtScaleToken_ = esConsumes<L1MuTriggerPtScale, L1MuTriggerPtScaleRcd>();
}
if (produceCaloParticles_) {
caloGeomToken_ = esConsumes<L1CaloGeometry, L1CaloGeometryRecord>();
emScaleToken_ = esConsumes<L1CaloEtScale, L1EmEtScaleRcd>();
jetScaleToken_ = esConsumes<L1CaloEtScale, L1JetEtScaleRcd>();
jetFinderParamsToken_ = esConsumes<L1GctJetFinderParams, L1GctJetFinderParamsRcd>();
hfRingEtScaleToken_ = esConsumes<L1CaloEtScale, L1HfRingEtScaleRcd>();
if (!ignoreHtMiss_) {
htMissScaleToken_ = esConsumes<L1CaloEtScale, L1HtMissScaleRcd>();
}
}
}

L1ExtraParticlesProd::~L1ExtraParticlesProd() {
Expand All @@ -133,11 +133,9 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
unique_ptr<L1MuonParticleCollection> muColl(new L1MuonParticleCollection);

if (produceMuonParticles_) {
ESHandle<L1MuTriggerScales> muScales;
iSetup.get<L1MuTriggerScalesRcd>().get(muScales);
ESHandle<L1MuTriggerScales> muScales = iSetup.getHandle(muScalesToken_);

ESHandle<L1MuTriggerPtScale> muPtScale;
iSetup.get<L1MuTriggerPtScaleRcd>().get(muPtScale);
ESHandle<L1MuTriggerPtScale> muPtScale = iSetup.getHandle(muPtScaleToken_);

Handle<L1MuGMTReadoutCollection> hwMuCollection;
iEvent.getByLabel(muonSource_, hwMuCollection);
Expand Down Expand Up @@ -224,14 +222,12 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
if (produceCaloParticles_) {
// ~~~~~~~~~~~~~~~~~~~~ Geometry ~~~~~~~~~~~~~~~~~~~~

ESHandle<L1CaloGeometry> caloGeomESH;
iSetup.get<L1CaloGeometryRecord>().get(caloGeomESH);
ESHandle<L1CaloGeometry> caloGeomESH = iSetup.getHandle(caloGeomToken_);
const L1CaloGeometry *caloGeom = &(*caloGeomESH);

// ~~~~~~~~~~~~~~~~~~~~ EM ~~~~~~~~~~~~~~~~~~~~

ESHandle<L1CaloEtScale> emScale;
iSetup.get<L1EmEtScaleRcd>().get(emScale);
ESHandle<L1CaloEtScale> emScale = iSetup.getHandle(emScaleToken_);

// Isolated EM
Handle<L1GctEmCandCollection> hwIsoEmCands;
Expand Down Expand Up @@ -305,8 +301,7 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS

// ~~~~~~~~~~~~~~~~~~~~ Jets ~~~~~~~~~~~~~~~~~~~~

ESHandle<L1CaloEtScale> jetScale;
iSetup.get<L1JetEtScaleRcd>().get(jetScale);
ESHandle<L1CaloEtScale> jetScale = iSetup.getHandle(jetScaleToken_);

// Central jets.
Handle<L1GctJetCandCollection> hwCenJetCands;
Expand Down Expand Up @@ -612,14 +607,13 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
iEvent.getByLabel(htMissSource_, hwHtMissColl);
}

ESHandle<L1GctJetFinderParams> jetFinderParams;
iSetup.get<L1GctJetFinderParamsRcd>().get(jetFinderParams);
ESHandle<L1GctJetFinderParams> jetFinderParams = iSetup.getHandle(jetFinderParamsToken_);
double htSumLSB = jetFinderParams->getHtLsbGeV();

ESHandle<L1CaloEtScale> htMissScale;
std::vector<bool> htMissMatched;
if (!ignoreHtMiss_) {
iSetup.get<L1HtMissScaleRcd>().get(htMissScale);
htMissScale = iSetup.getHandle(htMissScaleToken_);

if (!hwEtHadColl.isValid()) {
LogDebug("L1ExtraParticlesProd") << "\nWarning: L1GctEtHadCollection with " << etHadSource_
Expand Down Expand Up @@ -776,8 +770,7 @@ void L1ExtraParticlesProd::produce(edm::Event &iEvent, const edm::EventSetup &iS
Handle<L1GctHFBitCountsCollection> hwHFBitCountsColl;
iEvent.getByLabel(hfRingBitCountsSource_, hwHFBitCountsColl);

ESHandle<L1CaloEtScale> hfRingEtScale;
iSetup.get<L1HfRingEtScaleRcd>().get(hfRingEtScale);
ESHandle<L1CaloEtScale> hfRingEtScale = iSetup.getHandle(hfRingEtScaleToken_);

if (!hwHFEtSumsColl.isValid()) {
LogDebug("L1ExtraParticlesProd") << "\nWarning: L1GctHFRingEtSumsCollection with " << hfRingEtSumsSource_
Expand Down