00001 #include <memory> 00002 #include "boost/shared_ptr.hpp" 00003 00004 #include "FWCore/Framework/interface/ESProducer.h" 00005 #include "FWCore/Framework/interface/ESHandle.h" 00006 #include "FWCore/Framework/interface/ModuleFactory.h" 00007 00008 #include "SimMuon/MCTruth/interface/MuonAssociatorByHits.h" 00009 #include "SimTracker/Records/interface/TrackAssociatorRecord.h" 00010 00011 class MuonAssociatorESProducer : public edm::ESProducer 00012 { 00013 public: 00014 00015 MuonAssociatorESProducer(edm::ParameterSet const & config) : config_(config) 00016 { 00017 setWhatProduced(this, config.getParameter<std::string>("ComponentName")); 00018 } 00019 00020 ~MuonAssociatorESProducer() {} 00021 00022 typedef boost::shared_ptr<TrackAssociatorBase> ReturnType; 00023 00024 ReturnType produce(const TrackAssociatorRecord & record) 00025 { 00026 using namespace edm::es; 00027 boost::shared_ptr<TrackAssociatorBase> pMuonAssociatorByHits( new MuonAssociatorByHits(config_) ); 00028 return pMuonAssociatorByHits; 00029 } 00030 00031 private: 00032 00033 edm::ParameterSet config_; 00034 }; 00035 00036 DEFINE_FWK_EVENTSETUP_MODULE(MuonAssociatorESProducer);