CMS 3D CMS Logo

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