CMS 3D CMS Logo

MagneticFieldMapESProducer.cc
Go to the documentation of this file.
5 #include <memory>
6 
8  : label_(p.getUntrackedParameter<std::string>("trackerGeometryLabel", "")) {
9  auto cc = setWhatProduced(this);
10  tokenGeom_ = cc.consumes(edm::ESInputTag("", label_));
11  tokenBField_ = cc.consumes();
12 }
13 
14 std::unique_ptr<MagneticFieldMap> MagneticFieldMapESProducer::produce(const MagneticFieldMapRecord& iRecord) {
15  auto theInteractionGeometry = &(iRecord.getRecord<TrackerInteractionGeometryRecord>().get(tokenGeom_));
16  auto theMagneticField = &(iRecord.getRecord<IdealMagneticFieldRecord>().get(tokenBField_));
17 
18  return std::make_unique<MagneticFieldMap>(theMagneticField, theInteractionGeometry);
19 }
20 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ESGetToken< TrackerInteractionGeometry, TrackerInteractionGeometryRecord > tokenGeom_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tokenBField_
MagneticFieldMapESProducer(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< MagneticFieldMap > produce(const MagneticFieldMapRecord &)