Skip to content

Commit

Permalink
Merge pull request #35020 from makortel/esconsumesRPCUnpackingModule
Browse files Browse the repository at this point in the history
Migrate RPCUnpackingModule to esConsumes()
  • Loading branch information
cmsbuild committed Aug 27, 2021
2 parents 1cbe017 + 93ab48c commit ffeed6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.cc
Expand Up @@ -20,8 +20,6 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "CondFormats/RPCObjects/interface/RPCEMap.h"
#include "CondFormats/DataRecord/interface/RPCEMapRcd.h"
#include "DataFormats/RPCDigi/interface/DataRecord.h"
#include "DataFormats/RPCDigi/interface/ReadoutError.h"
#include "DataFormats/RPCDigi/interface/RPCRawSynchro.h"
Expand All @@ -41,6 +39,7 @@ RPCUnpackingModule::RPCUnpackingModule(const edm::ParameterSet& pset)
: dataLabel_(pset.getParameter<edm::InputTag>("InputLabel")),
doSynchro_(pset.getParameter<bool>("doSynchro")),
eventCounter_(0),
theReadoutMappingToken(esConsumes<edm::Transition::BeginRun>()),
theCabling(nullptr) {
produces<RPCDigiCollection>();
produces<RPCRawDataCounts>();
Expand All @@ -62,8 +61,7 @@ void RPCUnpackingModule::beginRun(const edm::Run& run, const edm::EventSetup& es
if (theRecordWatcher.check(es)) {
LogTrace("") << "record has CHANGED!!, (re)initialise readout map!";
delete theCabling;
ESTransientHandle<RPCEMap> readoutMapping;
es.get<RPCEMapRcd>().get(readoutMapping);
ESTransientHandle<RPCEMap> readoutMapping = es.getTransientHandle(theReadoutMappingToken);
theCabling = readoutMapping->convert();
theReadoutMappingSearch.init(theCabling);
LogTrace("") << " READOUT MAP VERSION: " << theCabling->version() << endl;
Expand Down
2 changes: 2 additions & 0 deletions EventFilter/RPCRawToDigi/plugins/RPCUnpackingModule.h
Expand Up @@ -9,6 +9,7 @@
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/Framework/interface/ESWatcher.h"
#include "CondFormats/DataRecord/interface/RPCEMapRcd.h"
#include "CondFormats/RPCObjects/interface/RPCEMap.h"
#include "RPCReadOutMappingWithFastSearch.h"
#include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"

Expand Down Expand Up @@ -42,6 +43,7 @@ class RPCUnpackingModule : public edm::stream::EDProducer<> {
unsigned long eventCounter_;

edm::ESWatcher<RPCEMapRcd> theRecordWatcher;
edm::ESGetToken<RPCEMap, RPCEMapRcd> theReadoutMappingToken;
const RPCReadOutMapping* theCabling;
RPCReadOutMappingWithFastSearch theReadoutMappingSearch;
edm::EDGetTokenT<FEDRawDataCollection> fedToken_;
Expand Down

0 comments on commit ffeed6d

Please sign in to comment.