CMS 3D CMS Logo

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