CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackAssociatorByChi2ESProducer.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/TrackAssociatorByChi2ESProducer.hh"
6 // user include files
9 
11 
13 //#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
16 
17 //
18 // constants, enums and typedefs
19 //
20 
21 //
22 // static data member definitions
23 //
24 
25 //
26 // constructors and destructor
27 //
29 {
30  //the following line is needed to tell the framework what
31  // data is being produced
32  std::string myName=iConfig.getParameter<std::string>("ComponentName");
33  setWhatProduced(this,myName);
34 
35  //now do what ever other initialization is needed
36  conf_=iConfig;
37 }
38 
39 
40 TrackAssociatorByChi2ESProducer::~TrackAssociatorByChi2ESProducer()
41 {
42 
43  // do anything here that needs to be done at desctruction time
44  // (e.g. close files, deallocate resources etc.)
45 
46 }
47 
48 
49 //
50 // member functions
51 //
52 
53 // ------------ method called to produce the data ------------
55 TrackAssociatorByChi2ESProducer::produce(const TrackAssociatorRecord& iRecord)
56 {
57  using namespace edm::es;
59  iRecord.getRecord<IdealMagneticFieldRecord>().get(theMF);
60  std::auto_ptr<TrackAssociatorBase> pTrackAssociatorBase (new TrackAssociatorByChi2(theMF,conf_));
61  return pTrackAssociatorBase ;
62 }
63 
64 //define this as a plug-in
T getParameter(std::string const &) const
std::map< DetId, double > ReturnType