diff --git a/EventFilter/L1TRawToDigi/plugins/OmtfPacker.cc b/EventFilter/L1TRawToDigi/plugins/OmtfPacker.cc index 6371a010047b0..9033356735f3e 100644 --- a/EventFilter/L1TRawToDigi/plugins/OmtfPacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/OmtfPacker.cc @@ -72,6 +72,9 @@ namespace omtf { edm::EDGetTokenT theDtThToken; edm::EDGetTokenT theDtPhToken; + edm::ESGetToken theRPCEMapToken; + edm::ESGetToken theAmcMappingToken; + CscPacker theCscPacker; RpcPacker theRpcPacker; DtPacker theDtPacker; @@ -90,6 +93,13 @@ namespace omtf { theSkipDt = pset.getParameter("skipDt"); theSkipRpc = pset.getParameter("skipRpc"); theSkipCsc = pset.getParameter("skipCsc"); + + if (!theSkipRpc) { + theRPCEMapToken = esConsumes(); + if (not theConfig.getParameter("useRpcConnectionFile")) { + theAmcMappingToken = esConsumes(); + } + } } void OmtfPacker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -112,15 +122,13 @@ namespace omtf { // initialise RPC packer // if (!theSkipRpc) { - edm::ESTransientHandle readoutMapping; - es.get().get(readoutMapping); + edm::ESTransientHandle readoutMapping = es.getTransientHandle(theRPCEMapToken); if (theConfig.getParameter("useRpcConnectionFile")) { theRpcPacker.init(*readoutMapping, edm::FileInPath(theConfig.getParameter("rpcConnectionFile")).fullPath()); } else { - edm::ESHandle amcMapping; - es.get().get(amcMapping); - theRpcPacker.init(*readoutMapping, *amcMapping); + auto const& amcMapping = es.getData(theAmcMappingToken); + theRpcPacker.init(*readoutMapping, amcMapping); } } diff --git a/EventFilter/L1TRawToDigi/plugins/OmtfUnpacker.cc b/EventFilter/L1TRawToDigi/plugins/OmtfUnpacker.cc index a2fe9e5d83b93..c872db2d4aa72 100644 --- a/EventFilter/L1TRawToDigi/plugins/OmtfUnpacker.cc +++ b/EventFilter/L1TRawToDigi/plugins/OmtfUnpacker.cc @@ -66,6 +66,9 @@ namespace omtf { edm::EDGetTokenT theFedDataToken; + edm::ESGetToken theRPCEMapToken; + edm::ESGetToken theAmcMappingToken; + RpcUnpacker theRpcUnpacker; CscUnpacker theCscUnpacker; DtUnpacker theDtUnpacker; @@ -92,6 +95,13 @@ namespace omtf { theSkipMuon = pset.getParameter("skipMuon"); theFedDataToken = consumes(pset.getParameter("inputLabel")); + + if (!theSkipRpc) { + theRPCEMapToken = esConsumes(); + if (not theConfig.getParameter("useRpcConnectionFile")) { + theAmcMappingToken = esConsumes(); + } + } } void OmtfUnpacker::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -112,15 +122,13 @@ namespace omtf { // rpc unpacker // if (!theSkipRpc) { - edm::ESTransientHandle readoutMapping; - es.get().get(readoutMapping); + edm::ESTransientHandle readoutMapping = es.getTransientHandle(theRPCEMapToken); if (theConfig.getParameter("useRpcConnectionFile")) { theRpcUnpacker.init(*readoutMapping, edm::FileInPath(theConfig.getParameter("rpcConnectionFile")).fullPath()); } else { - edm::ESHandle amcMapping; - es.get().get(amcMapping); - theRpcUnpacker.init(*readoutMapping, *amcMapping); + auto const& amcMapping = es.getData(theAmcMappingToken); + theRpcUnpacker.init(*readoutMapping, amcMapping); } }