CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackAssociatorByHitsESProducer.cc
Go to the documentation of this file.
1 // system include files
2 #include <memory>
3 #include "boost/shared_ptr.hpp"
4 
5 #include "SimTracker/TrackAssociatorESProducer/src/TrackAssociatorByHitsESProducer.hh"
6 // user include files
9 
11 
15 //#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
19 
20 //
21 // constants, enums and typedefs
22 //
23 
24 //
25 // static data member definitions
26 //
27 
28 //
29 // constructors and destructor
30 //
31 TrackAssociatorByHitsESProducer::TrackAssociatorByHitsESProducer(const edm::ParameterSet& iConfig)
32 {
33  //the following line is needed to tell the framework what
34  // data is being produced
35  std::string myName=iConfig.getParameter<std::string>("ComponentName");
36  setWhatProduced(this,myName);
37 
38  //now do what ever other initialization is needed
39  conf_=iConfig;
40 }
41 
42 
43 TrackAssociatorByHitsESProducer::~TrackAssociatorByHitsESProducer()
44 {
45 
46  // do anything here that needs to be done at desctruction time
47  // (e.g. close files, deallocate resources etc.)
48 
49 }
50 
51 
52 //
53 // member functions
54 //
55 
56 // ------------ method called to produce the data ------------
58 TrackAssociatorByHitsESProducer::produce(const TrackAssociatorRecord& iRecord)
59 {
60  using namespace edm::es;
62  iRecord.getRecord<IdealMagneticFieldRecord>().get(theMF);
63  std::auto_ptr<TrackAssociatorBase> pTrackAssociatorBase (new TrackAssociatorByHits(conf_));
64  return pTrackAssociatorBase ;
65 }
66 
67 //define this as a plug-in
T getParameter(std::string const &) const
std::map< DetId, double > ReturnType