CMS 3D CMS Logo

NavigationSchoolESProducer.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
5 // user include files
8 
10 
13 
14 //
15 // class decleration
16 //
17 
19 public:
21  ~NavigationSchoolESProducer() override;
22 
23  typedef std::shared_ptr<NavigationSchool> ReturnType;
24 
25  virtual ReturnType produce(const NavigationSchoolRecord&);
26  protected:
27  // ----------member data ---------------------------
30  std::shared_ptr<NavigationSchool> theNavigationSchool ;
31 };
32 
33 //
34 //
35 // constructors and destructor
36 //
38 {
39  theNavigationPSet = iConfig;
40  theNavigationSchoolName = theNavigationPSet.getParameter<std::string>("ComponentName");
41  //the following line is needed to tell the framework what
42  // data is being produced
43  setWhatProduced(this, theNavigationSchoolName);
44 
45  //now do what ever other initialization is needed
46 }
47 
48 
50 {
51 
52  // do anything here that needs to be done at desctruction time
53  // (e.g. close files, deallocate resources etc.)
54 
55 }
56 
57 
58 //
59 // member functions
60 //
61 
62 // ------------ method called to produce the data ------------
65 {
66  using namespace edm::es;
67 
68  // get the field
70  std::string mfName = "";
71  if (theNavigationPSet.exists("SimpleMagneticField"))
72  mfName = theNavigationPSet.getParameter<std::string>("SimpleMagneticField");
73  iRecord.getRecord<IdealMagneticFieldRecord>().get(mfName,field);
74  // edm::ESInputTag mfESInputTag(mfName);
75  // iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,field);
76 
77  //get the geometricsearch tracker geometry
78  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
79  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
80 
81  theNavigationSchool.reset(NavigationSchoolFactory::get()->create(theNavigationSchoolName,
82  geometricSearchTracker.product(),
83  field.product()));
84  return theNavigationSchool ;
85 }
86 
T getParameter(std::string const &) const
#define dso_hidden
def create(alignables, pedeDump, additionalData, outputFile, config)
virtual ReturnType produce(const NavigationSchoolRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::shared_ptr< NavigationSchool > ReturnType
std::shared_ptr< NavigationSchool > theNavigationSchool
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
NavigationSchoolESProducer(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:86
T get(const Candidate &c)
Definition: component.h:55