00001 // system include files 00002 #include <memory> 00003 #include "boost/shared_ptr.hpp" 00004 00005 #include "SimTracker/VertexAssociatorESProducer/src/VertexAssociatorByTracksESProducer.hh" 00006 // user include files 00007 #include "FWCore/Framework/interface/ModuleFactory.h" 00008 #include "FWCore/Framework/interface/ESProducer.h" 00009 00010 #include "FWCore/Framework/interface/ESHandle.h" 00011 00012 #include "SimTracker/VertexAssociation/interface/VertexAssociatorByTracks.h" 00013 #include "SimTracker/Records/interface/VertexAssociatorRecord.h" 00014 #include "MagneticField/Engine/interface/MagneticField.h" 00015 //#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" 00016 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h" 00017 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" 00018 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00019 00020 // 00021 // constants, enums and typedefs 00022 // 00023 00024 // 00025 // static data member definitions 00026 // 00027 00028 // 00029 // constructors and destructor 00030 // 00031 VertexAssociatorByTracksESProducer::VertexAssociatorByTracksESProducer(const edm::ParameterSet& iConfig) 00032 { 00033 //the following line is needed to tell the framework what 00034 // data is being produced 00035 setWhatProduced(this,"VertexAssociatorByTracks"); 00036 00037 //now do what ever other initialization is needed 00038 conf_=iConfig; 00039 } 00040 00041 00042 VertexAssociatorByTracksESProducer::~VertexAssociatorByTracksESProducer() 00043 { 00044 00045 // do anything here that needs to be done at desctruction time 00046 // (e.g. close files, deallocate resources etc.) 00047 00048 } 00049 00050 00051 // 00052 // member functions 00053 // 00054 00055 // ------------ method called to produce the data ------------ 00056 VertexAssociatorByTracksESProducer::ReturnType 00057 VertexAssociatorByTracksESProducer::produce(const VertexAssociatorRecord& iRecord) 00058 { 00059 using namespace edm::es; 00060 edm::ESHandle<MagneticField> theMF; 00061 iRecord.getRecord<IdealMagneticFieldRecord>().get(theMF); 00062 std::auto_ptr<VertexAssociatorBase> pVertexAssociatorBase (new VertexAssociatorByTracks(conf_)); 00063 return pVertexAssociatorBase ; 00064 } 00065 00066 //define this as a plug-in