FastSimulation
ParticlePropagator
plugins
MagneticFieldMapESProducer.cc
Go to the documentation of this file.
1
#include "
FastSimulation/ParticlePropagator/plugins/MagneticFieldMapESProducer.h
"
2
#include "
FastSimulation/TrackerSetup/interface/TrackerInteractionGeometryRecord.h
"
3
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
4
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/ModuleFactory.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
9
#include <memory>
10
11
MagneticFieldMapESProducer::MagneticFieldMapESProducer
(
const
edm::ParameterSet
&
p
) {
12
setWhatProduced
(
this
);
13
_label
=
p
.getUntrackedParameter<
std::string
>(
"trackerGeometryLabel"
,
""
);
14
15
// theTrackerMaterial = p.getParameter<edm::ParameterSet>("TrackerMaterial");
16
}
17
18
MagneticFieldMapESProducer::~MagneticFieldMapESProducer
() {}
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
30
DEFINE_FWK_EVENTSETUP_MODULE
(
MagneticFieldMapESProducer
);
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
Generated for CMSSW Reference Manual by
1.8.16