Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:26:14

0001 // system include files
0002 #include <memory>
0003 
0004 // user include files
0005 #include "FWCore/Framework/interface/ESProducer.h"
0006 #include "FWCore/Framework/interface/ESHandle.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0009 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0010 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0011 #include "DTObjectMap.h"
0012 
0013 class DTObjectMapESProducer : public edm::ESProducer {
0014 public:
0015   DTObjectMapESProducer(const edm::ParameterSet&) : rpcGeomToken_(setWhatProduced(this).consumes<RPCGeometry>()) {}
0016 
0017   std::unique_ptr<DTObjectMap> produce(MuonGeometryRecord const& record) {
0018     return std::make_unique<DTObjectMap>(record.get(rpcGeomToken_));
0019   }
0020 
0021   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0022     edm::ParameterSetDescription desc;
0023     descriptions.add("dtObjectMapESProducer", desc);
0024   }
0025 
0026 private:
0027   const edm::ESGetToken<RPCGeometry, MuonGeometryRecord> rpcGeomToken_;
0028 };
0029 
0030 //define this as a plug-in
0031 #include "FWCore/Framework/interface/ModuleFactory.h"
0032 DEFINE_FWK_EVENTSETUP_MODULE(DTObjectMapESProducer);