diff --git a/CondTools/HLT/src/AlCaRecoTriggerBitsRcdRead.cc b/CondTools/HLT/src/AlCaRecoTriggerBitsRcdRead.cc index b870c72cdaa65..62bbef5bb0bd6 100644 --- a/CondTools/HLT/src/AlCaRecoTriggerBitsRcdRead.cc +++ b/CondTools/HLT/src/AlCaRecoTriggerBitsRcdRead.cc @@ -56,6 +56,7 @@ class AlCaRecoTriggerBitsRcdRead : public edm::EDAnalyzer { void printMap(edm::RunNumber_t firstRun, edm::RunNumber_t lastRun, const AlCaRecoTriggerBits &triggerMap) const; // members + edm::ESGetToken triggerBitsToken_; const OutputType outputType_; edm::ESWatcher watcher_; edm::RunNumber_t firstRun_; @@ -69,7 +70,10 @@ class AlCaRecoTriggerBitsRcdRead : public edm::EDAnalyzer { /////////////////////////////////////////////////////////////////////// AlCaRecoTriggerBitsRcdRead::AlCaRecoTriggerBitsRcdRead(const edm::ParameterSet &cfg) - : outputType_(this->stringToEnum(cfg.getUntrackedParameter("outputType"))), firstRun_(0), lastRun_(0) { + : triggerBitsToken_(esConsumes()), + outputType_(this->stringToEnum(cfg.getUntrackedParameter("outputType"))), + firstRun_(0), + lastRun_(0) { // edm::LogInfo("") << "@SUB=AlCaRecoTriggerBitsRcdRead" // << cfg.getParameter("@module_label"); @@ -119,8 +123,7 @@ void AlCaRecoTriggerBitsRcdRead::beginRun(const edm::Run &run, const edm::EventS this->printMap(firstRun_, lastRun_, lastTriggerBits_); // Get AlCaRecoTriggerBits from EventSetup: - edm::ESHandle triggerBits; - iSetup.get().get(triggerBits); + const auto &triggerBits = &iSetup.getData(triggerBitsToken_); lastTriggerBits_ = *triggerBits; // copy for later use firstRun_ = run.run(); // keep track where it started } diff --git a/CondTools/HLT/src/AlCaRecoTriggerBitsRcdUpdate.cc b/CondTools/HLT/src/AlCaRecoTriggerBitsRcdUpdate.cc index bf2dd82713194..62daca69ce119 100644 --- a/CondTools/HLT/src/AlCaRecoTriggerBitsRcdUpdate.cc +++ b/CondTools/HLT/src/AlCaRecoTriggerBitsRcdUpdate.cc @@ -44,6 +44,7 @@ class AlCaRecoTriggerBitsRcdUpdate : public edm::EDAnalyzer { /// Takes over memory uresponsibility for 'bitsToWrite'. void writeBitsToDB(AlCaRecoTriggerBits *bitsToWrite) const; + edm::ESGetToken triggerBitsToken_; unsigned int nEventCalls_; const unsigned int firstRunIOV_; const int lastRunIOV_; @@ -58,7 +59,8 @@ class AlCaRecoTriggerBitsRcdUpdate : public edm::EDAnalyzer { /////////////////////////////////////////////////////////////////////// AlCaRecoTriggerBitsRcdUpdate::AlCaRecoTriggerBitsRcdUpdate(const edm::ParameterSet &cfg) - : nEventCalls_(0), + : triggerBitsToken_(esConsumes()), + nEventCalls_(0), firstRunIOV_(cfg.getParameter("firstRunIOV")), lastRunIOV_(cfg.getParameter("lastRunIOV")), startEmpty_(cfg.getParameter("startEmpty")), @@ -98,8 +100,7 @@ AlCaRecoTriggerBitsRcdUpdate::createStartTriggerBits(bool startEmpty, const edm: if (startEmpty) { return new AlCaRecoTriggerBits; } else { - edm::ESHandle triggerBits; - evtSetup.get().get(triggerBits); + const auto &triggerBits = &evtSetup.getData(triggerBitsToken_); return new AlCaRecoTriggerBits(*triggerBits); // copy old one } }