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/GlobalCaloTrigger #30348

Merged
merged 1 commit 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 10 additions & 20 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctEmulator.cc
Expand Up @@ -15,16 +15,6 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"

// Trigger configuration includes
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/L1TObjects/interface/L1GctChannelMask.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1GctChannelMaskRcd.h"

// GCT include files
#include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetEtCalibrationLut.h"

Expand Down Expand Up @@ -108,23 +98,23 @@ L1GctEmulator::L1GctEmulator(const edm::ParameterSet& ps)
}
m_emToken = consumes<L1CaloEmCollection>(inputTag);
m_regionToken = consumes<L1CaloRegionCollection>(inputTag);
m_jfParsToken = esConsumes<L1GctJetFinderParams, L1GctJetFinderParamsRcd>(edm::ESInputTag("", m_conditionsLabel));
m_chanMaskToken = esConsumes<L1GctChannelMask, L1GctChannelMaskRcd>(edm::ESInputTag("", m_conditionsLabel));
m_etScaleToken = esConsumes<L1CaloEtScale, L1JetEtScaleRcd>(edm::ESInputTag("", m_conditionsLabel));
m_htMissScaleToken = esConsumes<L1CaloEtScale, L1HtMissScaleRcd>(edm::ESInputTag("", m_conditionsLabel));
m_hfRingEtScaleToken = esConsumes<L1CaloEtScale, L1HfRingEtScaleRcd>(edm::ESInputTag("", m_conditionsLabel));
}

int L1GctEmulator::configureGct(const edm::EventSetup& c) {
int success = 0;

if (success == 0) {
// get data from EventSetup
edm::ESHandle<L1GctJetFinderParams> jfPars;
c.get<L1GctJetFinderParamsRcd>().get(m_conditionsLabel, jfPars); // which record?
edm::ESHandle<L1GctChannelMask> chanMask;
c.get<L1GctChannelMaskRcd>().get(m_conditionsLabel, chanMask); // which record?
edm::ESHandle<L1CaloEtScale> etScale;
c.get<L1JetEtScaleRcd>().get(m_conditionsLabel, etScale); // which record?
edm::ESHandle<L1CaloEtScale> htMissScale;
c.get<L1HtMissScaleRcd>().get(m_conditionsLabel, htMissScale); // which record?
edm::ESHandle<L1CaloEtScale> hfRingEtScale;
c.get<L1HfRingEtScaleRcd>().get(m_conditionsLabel, hfRingEtScale); // which record?
edm::ESHandle<L1GctJetFinderParams> jfPars = c.getHandle(m_jfParsToken);
edm::ESHandle<L1GctChannelMask> chanMask = c.getHandle(m_chanMaskToken);
edm::ESHandle<L1CaloEtScale> etScale = c.getHandle(m_etScaleToken);
edm::ESHandle<L1CaloEtScale> htMissScale = c.getHandle(m_htMissScaleToken);
edm::ESHandle<L1CaloEtScale> hfRingEtScale = c.getHandle(m_hfRingEtScaleToken);

if (jfPars.product() == nullptr) {
success = -1;
Expand Down
17 changes: 17 additions & 0 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctEmulator.h
Expand Up @@ -22,10 +22,20 @@
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Utilities/interface/ESGetToken.h"

#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"

#include "L1Trigger/GlobalCaloTrigger/interface/L1GlobalCaloTrigger.h"
// Trigger configuration includes
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/L1TObjects/interface/L1GctChannelMask.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1GctChannelMaskRcd.h"

class L1GctEmulator : public edm::stream::EDProducer<> {
public:
Expand All @@ -46,6 +56,13 @@ class L1GctEmulator : public edm::stream::EDProducer<> {
edm::EDGetTokenT<L1CaloEmCollection> m_emToken;
edm::EDGetTokenT<L1CaloRegionCollection> m_regionToken;

//EventSetup Tokens
edm::ESGetToken<L1GctJetFinderParams, L1GctJetFinderParamsRcd> m_jfParsToken;
edm::ESGetToken<L1GctChannelMask, L1GctChannelMaskRcd> m_chanMaskToken;
edm::ESGetToken<L1CaloEtScale, L1JetEtScaleRcd> m_etScaleToken;
edm::ESGetToken<L1CaloEtScale, L1HtMissScaleRcd> m_htMissScaleToken;
edm::ESGetToken<L1CaloEtScale, L1HfRingEtScaleRcd> m_hfRingEtScaleToken;

// pointer to the actual emulator
std::unique_ptr<L1GlobalCaloTrigger> m_gct;

Expand Down
28 changes: 8 additions & 20 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctPrintLuts.cc
Expand Up @@ -6,16 +6,6 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"

// Trigger configuration includes
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/L1TObjects/interface/L1GctChannelMask.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1GctChannelMaskRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"

// GCT include files
#include "L1Trigger/GlobalCaloTrigger/interface/L1GctJetEtCalibrationLut.h"
#include "L1Trigger/GlobalCaloTrigger/interface/L1GctWheelJetFpga.h"
Expand Down Expand Up @@ -45,6 +35,10 @@ L1GctPrintLuts::L1GctPrintLuts(const edm::ParameterSet& iConfig)
m_jetEtCalibLuts.push_back(nextLut);
nextLut.reset(new L1GctJetEtCalibrationLut());
}
m_jfParsToken = esConsumes<L1GctJetFinderParams, L1GctJetFinderParamsRcd>();
m_etScaleToken = esConsumes<L1CaloEtScale, L1JetEtScaleRcd>();
m_htMissScaleToken = esConsumes<L1CaloEtScale, L1HtMissScaleRcd>();
m_hfRingEtScaleToken = esConsumes<L1CaloEtScale, L1HfRingEtScaleRcd>();
}

L1GctPrintLuts::~L1GctPrintLuts() {
Expand Down Expand Up @@ -158,16 +152,10 @@ int L1GctPrintLuts::configureGct(const edm::EventSetup& c) {

if (success == 0) {
// get data from EventSetup
edm::ESHandle<L1GctJetFinderParams> jfPars;
c.get<L1GctJetFinderParamsRcd>().get(jfPars); // which record?
edm::ESHandle<L1CaloEtScale> hfRingEtScale;
c.get<L1HfRingEtScaleRcd>().get(hfRingEtScale); // which record?
edm::ESHandle<L1CaloEtScale> htMissScale;
c.get<L1HtMissScaleRcd>().get(htMissScale); // which record?
// edm::ESHandle< L1GctChannelMask > chanMask ;
// c.get< L1GctChannelMaskRcd >().get( chanMask ) ; // which record?
edm::ESHandle<L1CaloEtScale> etScale;
c.get<L1JetEtScaleRcd>().get(etScale); // which record?
edm::ESHandle<L1GctJetFinderParams> jfPars = c.getHandle(m_jfParsToken);
edm::ESHandle<L1CaloEtScale> hfRingEtScale = c.getHandle(m_hfRingEtScaleToken);
edm::ESHandle<L1CaloEtScale> htMissScale = c.getHandle(m_htMissScaleToken);
edm::ESHandle<L1CaloEtScale> etScale = c.getHandle(m_etScaleToken);

if (jfPars.product() == nullptr) {
success = -1;
Expand Down
14 changes: 14 additions & 0 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctPrintLuts.h
Expand Up @@ -30,6 +30,14 @@

#include "L1Trigger/GlobalCaloTrigger/interface/L1GlobalCaloTrigger.h"

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

//
// class declaration
//
Expand Down Expand Up @@ -62,5 +70,11 @@ class L1GctPrintLuts : public edm::EDAnalyzer {

// pointers to the jet Et LUTs
lutPtrVector m_jetEtCalibLuts;

//EventSetup Tokens
edm::ESGetToken<L1GctJetFinderParams, L1GctJetFinderParamsRcd> m_jfParsToken;
edm::ESGetToken<L1CaloEtScale, L1JetEtScaleRcd> m_etScaleToken;
edm::ESGetToken<L1CaloEtScale, L1HtMissScaleRcd> m_htMissScaleToken;
edm::ESGetToken<L1CaloEtScale, L1HfRingEtScaleRcd> m_hfRingEtScaleToken;
};
#endif
21 changes: 7 additions & 14 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctValidation.cc
Expand Up @@ -7,13 +7,6 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"

#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"

#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"

#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"

#include "DataFormats/Math/interface/deltaPhi.h"
Expand All @@ -22,7 +15,10 @@

L1GctValidation::L1GctValidation(const edm::ParameterSet& iConfig)
: m_gctinp_tag(iConfig.getUntrackedParameter<edm::InputTag>("rctInputTag", edm::InputTag("rctDigis"))),
m_energy_tag(iConfig.getUntrackedParameter<edm::InputTag>("gctInputTag", edm::InputTag("gctDigis"))) {}
m_energy_tag(iConfig.getUntrackedParameter<edm::InputTag>("gctInputTag", edm::InputTag("gctDigis"))),
m_jfParsToken(esConsumes<L1GctJetFinderParams, L1GctJetFinderParamsRcd>()),
m_htMissScaleToken(esConsumes<L1CaloEtScale, L1HtMissScaleRcd>()),
m_hfRingEtScaleToken(esConsumes<L1CaloEtScale, L1HfRingEtScaleRcd>()) {}

L1GctValidation::~L1GctValidation() {
// do anything here that needs to be done at desctruction time
Expand All @@ -38,19 +34,16 @@ void L1GctValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& i
using namespace edm;

// Get the scales from the event setup
ESHandle<L1GctJetFinderParams> jfPars;
iSetup.get<L1GctJetFinderParamsRcd>().get(jfPars); // which record?
ESHandle<L1GctJetFinderParams> jfPars = iSetup.getHandle(m_jfParsToken);

double lsbForEt = jfPars.product()->getRgnEtLsbGeV();
double lsbForHt = jfPars.product()->getHtLsbGeV();

unsigned httJetThreshold = static_cast<int>(jfPars.product()->getHtJetEtThresholdGeV() / lsbForHt);
unsigned htmJetThreshold = static_cast<int>(jfPars.product()->getMHtJetEtThresholdGeV() / lsbForHt);

ESHandle<L1CaloEtScale> htMissScale;
iSetup.get<L1HtMissScaleRcd>().get(htMissScale); // which record?
ESHandle<L1CaloEtScale> hfRingEtScale;
iSetup.get<L1HfRingEtScaleRcd>().get(hfRingEtScale); // which record?
ESHandle<L1CaloEtScale> htMissScale = iSetup.getHandle(m_htMissScaleToken);
ESHandle<L1CaloEtScale> hfRingEtScale = iSetup.getHandle(m_hfRingEtScaleToken);

// Get the Gct energy sums from the event
Handle<L1GctEtTotalCollection> sumEtColl;
Expand Down
9 changes: 9 additions & 0 deletions L1Trigger/GlobalCaloTrigger/plugins/L1GctValidation.h
Expand Up @@ -26,8 +26,14 @@
#include "FWCore/Framework/interface/Event.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/ESGetToken.h"

#include "DataFormats/L1GlobalCaloTrigger/interface/L1GctCollections.h"
#include "CondFormats/L1TObjects/interface/L1GctJetFinderParams.h"
#include "CondFormats/DataRecord/interface/L1GctJetFinderParamsRcd.h"
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HfRingEtScaleRcd.h"
#include "TH1.h"
#include "TH2.h"
//
Expand Down Expand Up @@ -86,5 +92,8 @@ class L1GctValidation : public edm::EDAnalyzer {
TH1F* theHfRing0CountNegativeEta;
TH1F* theHfRing1CountPositiveEta;
TH1F* theHfRing1CountNegativeEta;
edm::ESGetToken<L1GctJetFinderParams, L1GctJetFinderParamsRcd> m_jfParsToken;
edm::ESGetToken<L1CaloEtScale, L1HtMissScaleRcd> m_htMissScaleToken;
edm::ESGetToken<L1CaloEtScale, L1HfRingEtScaleRcd> m_hfRingEtScaleToken;
};
#endif