CMS 3D CMS Logo

MagneticFieldMapESProducer.cc
Go to the documentation of this file.
4 
8 
9 #include <memory>
10 
12 {
13  setWhatProduced(this);
14  _label = p.getUntrackedParameter<std::string>("trackerGeometryLabel","");
15 
16  // theTrackerMaterial = p.getParameter<edm::ParameterSet>("TrackerMaterial");
17 
18 }
19 
21 
22 std::shared_ptr<MagneticFieldMap>
24 
25  edm::ESHandle<TrackerInteractionGeometry> theInteractionGeometry;
26  edm::ESHandle<MagneticField> theMagneticField;
27 
28  iRecord.getRecord<TrackerInteractionGeometryRecord>().get(_label, theInteractionGeometry );
29  iRecord.getRecord<IdealMagneticFieldRecord>().get(theMagneticField );
30 
31  _map = std::make_shared<MagneticFieldMap>(&(*theMagneticField),&(*theInteractionGeometry));
32 
33  return _map;
34 
35 }
36 
37 
T getUntrackedParameter(std::string const &, T const &) const
std::shared_ptr< MagneticFieldMap > produce(const MagneticFieldMapRecord &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::shared_ptr< MagneticFieldMap > _map
MagneticFieldMapESProducer(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60