test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
NavigationSchoolESProducer.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 #include "boost/shared_ptr.hpp"
5 
6 // user include files
9 
11 
14 
15 //
16 // class decleration
17 //
18 
20 public:
23 
24  typedef boost::shared_ptr<NavigationSchool> ReturnType;
25 
26  virtual ReturnType produce(const NavigationSchoolRecord&);
27  protected:
28  // ----------member data ---------------------------
31  boost::shared_ptr<NavigationSchool> theNavigationSchool ;
32 };
33 
34 //
35 //
36 // constructors and destructor
37 //
39 {
40  theNavigationPSet = iConfig;
42  //the following line is needed to tell the framework what
43  // data is being produced
45 
46  //now do what ever other initialization is needed
47 }
48 
49 
51 {
52 
53  // do anything here that needs to be done at desctruction time
54  // (e.g. close files, deallocate resources etc.)
55 
56 }
57 
58 
59 //
60 // member functions
61 //
62 
63 // ------------ method called to produce the data ------------
66 {
67  using namespace edm::es;
68 
69  // get the field
71  std::string mfName = "";
72  if (theNavigationPSet.exists("SimpleMagneticField"))
73  mfName = theNavigationPSet.getParameter<std::string>("SimpleMagneticField");
74  iRecord.getRecord<IdealMagneticFieldRecord>().get(mfName,field);
75  // edm::ESInputTag mfESInputTag(mfName);
76  // iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,field);
77 
78  //get the geometricsearch tracker geometry
79  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
80  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
81 
83  geometricSearchTracker.product(),
84  field.product()));
85  return theNavigationSchool ;
86 }
87 
T getParameter(std::string const &) const
#define dso_hidden
virtual ReturnType produce(const NavigationSchoolRecord &)
bool exists(std::string const &parameterName) const
checks if a parameter exists
boost::shared_ptr< NavigationSchool > ReturnType
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
boost::shared_ptr< NavigationSchool > theNavigationSchool
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
NavigationSchoolESProducer(const edm::ParameterSet &)
T get(const Candidate &c)
Definition: component.h:55