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 
edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:50
ESHandle.h
TrackerInteractionGeometryRecord
Definition: TrackerInteractionGeometryRecord.h:26
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MagneticFieldMapESProducer::MagneticFieldMapESProducer
MagneticFieldMapESProducer(const edm::ParameterSet &p)
Definition: MagneticFieldMapESProducer.cc:11
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
MagneticFieldMapESProducer::~MagneticFieldMapESProducer
~MagneticFieldMapESProducer() override
Definition: MagneticFieldMapESProducer.cc:18
MagneticFieldMapESProducer::_label
std::string _label
Definition: MagneticFieldMapESProducer.h:17
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
MagneticFieldMapESProducer.h
IdealMagneticFieldRecord.h
edm::ESHandle
Definition: DTSurvey.h:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
MagneticFieldMapRecord
Definition: MagneticFieldMapRecord.h:27
get
#define get
MagneticFieldMapESProducer
Definition: MagneticFieldMapESProducer.h:10
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
MagneticFieldMapESProducer::produce
std::unique_ptr< MagneticFieldMap > produce(const MagneticFieldMapRecord &)
Definition: MagneticFieldMapESProducer.cc:20
ParameterSet.h
TrackerInteractionGeometryRecord.h