TrackPropagation
Geant4e
plugins
GeantPropagatorESProducer.cc
Go to the documentation of this file.
1
#include "
GeantPropagatorESProducer.h
"
2
3
#include "
TrackPropagation/Geant4e/interface/Geant4ePropagator.h
"
4
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/ESProducer.h
"
7
#include "
FWCore/Framework/interface/EventSetup.h
"
8
#include "
FWCore/Framework/interface/ModuleFactory.h
"
9
10
#include <memory>
11
#include <string>
12
13
using namespace
edm
;
14
15
GeantPropagatorESProducer::GeantPropagatorESProducer
(
const
edm::ParameterSet
&
p
)
16
: magFieldToken_(setWhatProduced(this,
p
.getParameter<
std
::
string
>(
"ComponentName"
))
17
.consumesFrom<
MagneticField
,
IdealMagneticFieldRecord
>(
edm
::
ESInputTag
(
""
,
""
))) {
18
pset_
=
p
;
19
plimit_
=
pset_
.
getParameter
<
double
>(
"PropagationPtotLimit"
);
20
}
21
22
GeantPropagatorESProducer::~GeantPropagatorESProducer
() {}
23
24
std::unique_ptr<Propagator>
GeantPropagatorESProducer::produce
(
const
TrackingComponentsRecord
&iRecord) {
25
std::string
pdir =
pset_
.
getParameter
<
std::string
>(
"PropagationDirection"
);
26
std::string
particleName
=
pset_
.
getParameter
<
std::string
>(
"ParticleName"
);
27
28
PropagationDirection
dir
=
alongMomentum
;
29
30
if
(pdir ==
"oppositeToMomentum"
) {
31
dir
=
oppositeToMomentum
;
32
}
else
if
(pdir ==
"alongMomentum"
) {
33
dir
=
alongMomentum
;
34
}
else
if
(pdir ==
"anyDirection"
) {
35
dir
=
anyDirection
;
36
}
37
38
return
std::make_unique<Geant4ePropagator>(&(iRecord.
get
(
magFieldToken_
)),
particleName
,
dir
,
plimit_
);
39
}
GeantPropagatorESProducer::pset_
edm::ParameterSet pset_
Definition:
GeantPropagatorESProducer.h:27
anyDirection
Definition:
PropagationDirection.h:4
edm::ESInputTag
Definition:
ESInputTag.h:87
ESHandle.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
GeantPropagatorESProducer.h
GeantPropagatorESProducer::plimit_
double plimit_
Definition:
GeantPropagatorESProducer.h:29
ESProducer.h
oppositeToMomentum
Definition:
PropagationDirection.h:4
GeantPropagatorESProducer::~GeantPropagatorESProducer
~GeantPropagatorESProducer() override
Definition:
GeantPropagatorESProducer.cc:22
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
Geant4ePropagator.h
HiggsValidation_cfi.particleName
particleName
Definition:
HiggsValidation_cfi.py:7
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
GeantPropagatorESProducer::magFieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
Definition:
GeantPropagatorESProducer.h:28
edm::ParameterSet
Definition:
ParameterSet.h:47
GeantPropagatorESProducer::GeantPropagatorESProducer
GeantPropagatorESProducer(const edm::ParameterSet &p)
Definition:
GeantPropagatorESProducer.cc:15
ModuleFactory.h
std
Definition:
JetResolutionObject.h:76
GeantPropagatorESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition:
GeantPropagatorESProducer.cc:24
PropagationDirection
PropagationDirection
Definition:
PropagationDirection.h:4
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
MagneticField
Definition:
MagneticField.h:19
alongMomentum
Definition:
PropagationDirection.h:4
DeadROC_duringRun.dir
dir
Definition:
DeadROC_duringRun.py:23
TrackingComponentsRecord
Definition:
TrackingComponentsRecord.h:12
Generated for CMSSW Reference Manual by
1.8.16