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::unique_ptr<NavigationSchool> ReturnType;
24 
25  virtual ReturnType produce(const NavigationSchoolRecord&);
26  protected:
27  // ----------member data ---------------------------
30 };
31 
32 //
33 //
34 // constructors and destructor
35 //
37 {
38  theNavigationPSet = iConfig;
39  theNavigationSchoolName = theNavigationPSet.getParameter<std::string>("ComponentName");
40  //the following line is needed to tell the framework what
41  // data is being produced
42  setWhatProduced(this, theNavigationSchoolName);
43 
44  //now do what ever other initialization is needed
45 }
46 
47 
49 {
50 
51  // do anything here that needs to be done at desctruction time
52  // (e.g. close files, deallocate resources etc.)
53 
54 }
55 
56 
57 //
58 // member functions
59 //
60 
61 // ------------ method called to produce the data ------------
64 {
65  using namespace edm::es;
66 
67  // get the field
69  std::string mfName = "";
70  if (theNavigationPSet.exists("SimpleMagneticField"))
71  mfName = theNavigationPSet.getParameter<std::string>("SimpleMagneticField");
72  iRecord.getRecord<IdealMagneticFieldRecord>().get(mfName,field);
73  // edm::ESInputTag mfESInputTag(mfName);
74  // iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,field);
75 
76  //get the geometricsearch tracker geometry
77  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
78  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
79 
80  return ReturnType(NavigationSchoolFactory::get()->create(theNavigationSchoolName,
81  geometricSearchTracker.product(),
82  field.product()));
83 }
84 
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
def create(alignables, pedeDump, additionalData, outputFile, config)
virtual ReturnType produce(const NavigationSchoolRecord &)
std::unique_ptr< NavigationSchool > ReturnType
std::map< DetId, double > ReturnType
#define dso_hidden
Definition: Visibility.h:12
#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