CMS 3D CMS Logo

TrackAssociatorByPositionESProducer.cc

Go to the documentation of this file.
00001 // system include files
00002 #include <memory>
00003 #include "boost/shared_ptr.hpp"
00004 
00005 #include "SimTracker/TrackAssociatorESProducer/src/TrackAssociatorByPositionESProducer.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 "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
00013 
00014 //
00015 // constants, enums and typedefs
00016 //
00017 
00018 //
00019 // static data member definitions
00020 //
00021 
00022 //
00023 // constructors and destructor
00024 //
00025 TrackAssociatorByPositionESProducer::TrackAssociatorByPositionESProducer(const edm::ParameterSet& iConfig)
00026 {
00027    //the following line is needed to tell the framework what
00028    // data is being produced
00029   std::string cname = iConfig.getParameter<std::string>("ComponentName");
00030    setWhatProduced(this,cname);
00031 
00032    //now do what ever other initialization is needed
00033    conf_=iConfig;
00034    thePname=iConfig.getParameter<std::string>("propagator");
00035 }
00036 
00037 
00038 TrackAssociatorByPositionESProducer::~TrackAssociatorByPositionESProducer()
00039 {
00040  
00041    // do anything here that needs to be done at desctruction time
00042    // (e.g. close files, deallocate resources etc.)
00043 
00044 }
00045 
00046 
00047 //
00048 // member functions
00049 //
00050 
00051 // ------------ method called to produce the data  ------------
00052 TrackAssociatorByPositionESProducer::ReturnType
00053 TrackAssociatorByPositionESProducer::produce(const TrackAssociatorRecord& iRecord)
00054 {
00055    using namespace edm::es;
00056    
00057    edm::ESHandle<Propagator> theP;
00058    iRecord.getRecord<TrackingComponentsRecord>().get(thePname,theP);
00059    
00060    edm::ESHandle<GlobalTrackingGeometry> theG;
00061    iRecord.getRecord<GlobalTrackingGeometryRecord>().get(theG);
00062 
00063    std::auto_ptr<TrackAssociatorBase> pTrackAssociatorBase (new TrackAssociatorByPosition(conf_,
00064                                                                                           theG.product(),
00065                                                                                           theP.product()));
00066    return pTrackAssociatorBase ;
00067 }
00068 
00069 //define this as a plug-in

Generated on Tue Jun 9 17:47:55 2009 for CMSSW by  doxygen 1.5.4