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_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tokenBField_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
MagneticFieldMapESProducer(const edm::ParameterSet &p)
std::unique_ptr< MagneticFieldMap > produce(const MagneticFieldMapRecord &)