CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:163
T getUntrackedParameter(std::string const &, T const &) const
MagneticFieldMapESProducer(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< MagneticFieldMap > produce(const MagneticFieldMapRecord &)