Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-21 04:02:41

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 "CSCObjectMap.h"
0012 
0013 class CSCObjectMapESProducer : public edm::ESProducer {
0014 public:
0015   CSCObjectMapESProducer(const edm::ParameterSet&) : rpcGeomToken_(setWhatProduced(this).consumes<RPCGeometry>()) {}
0016 
0017   std::unique_ptr<CSCObjectMap> produce(MuonGeometryRecord const& record) {
0018     return std::make_unique<CSCObjectMap>(record.get(rpcGeomToken_));
0019   }
0020 
0021   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0022     edm::ParameterSetDescription desc;
0023     descriptions.add("cscObjectMapESProducer", 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(CSCObjectMapESProducer);