TrackingTools
MaterialEffects
plugins
PropagatorWithMaterialESProducer.cc
Go to the documentation of this file.
1
#include "
PropagatorWithMaterialESProducer.h
"
2
#include "
TrackingTools/MaterialEffects/interface/PropagatorWithMaterial.h
"
3
4
#include "
FWCore/Framework/interface/EventSetup.h
"
5
#include "
FWCore/Framework/interface/ESHandle.h
"
6
#include "
FWCore/Framework/interface/ModuleFactory.h
"
7
#include "
FWCore/Framework/interface/ESProducer.h
"
8
#include "
FWCore/Utilities/interface/ESInputTag.h
"
9
10
#include <string>
11
#include <memory>
12
13
using namespace
edm
;
14
15
namespace
{
16
PropagationDirection
stringToDirection(
std::string
const
& iName) {
17
PropagationDirection
dir
=
alongMomentum
;
18
19
if
(iName ==
"oppositeToMomentum"
)
20
dir
=
oppositeToMomentum
;
21
if
(iName ==
"alongMomentum"
)
22
dir
=
alongMomentum
;
23
if
(iName ==
"anyDirection"
)
24
dir
=
anyDirection
;
25
return
dir
;
26
}
27
}
// namespace
28
29
PropagatorWithMaterialESProducer::PropagatorWithMaterialESProducer
(
const
edm::ParameterSet
&
p
)
30
: mfToken_(setWhatProduced(this,
p
.getParameter<
std
::
string
>(
"ComponentName"
))
31
.consumesFrom<
MagneticField
,
IdealMagneticFieldRecord
>(
32
edm
::
ESInputTag
(
""
,
p
.getParameter<
std
::
string
>(
"SimpleMagneticField"
)))),
33
mass_(
p
.getParameter<double>(
"Mass"
)),
34
maxDPhi_(
p
.getParameter<double>(
"MaxDPhi"
)),
35
ptMin_(
p
.getParameter<double>(
"ptMin"
)),
36
dir_
(stringToDirection(
p
.getParameter<
std
::
string
>(
"PropagationDirection"
))),
37
useRK_(
p
.getParameter<
bool
>(
"useRungeKutta"
)),
38
useOldAnalPropLogic_(
p
.getParameter<
bool
>(
"useOldAnalPropLogic"
)) {}
39
40
std::unique_ptr<Propagator>
PropagatorWithMaterialESProducer::produce
(
const
TrackingComponentsRecord
& iRecord) {
41
// edm::ESInputTag mfESInputTag(mfName);
42
// iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,magfield);
43
//fixme check that useRK is false when using SimpleMagneticField
44
45
return
std::make_unique<PropagatorWithMaterial>(
46
dir_
,
mass_
, &iRecord.
get
(
mfToken_
),
maxDPhi_
,
useRK_
,
ptMin_
,
useOldAnalPropLogic_
);
47
}
48
49
void
PropagatorWithMaterialESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& descriptions) {
50
ParameterSetDescription
desc;
51
desc.
add
<
std::string
>(
"PropagationDirection"
);
52
desc.
add
<
std::string
>(
"SimpleMagneticField"
,
""
);
53
desc.
add
<
std::string
>(
"ComponentName"
);
54
desc.
add
<
double
>(
"Mass"
);
55
desc.
add
<
double
>(
"MaxDPhi"
);
56
desc.
add
<
bool
>(
"useRungeKutta"
);
57
desc.
add
<
bool
>(
"useOldAnalPropLogic"
,
true
);
58
desc.
add
<
double
>(
"ptMin"
, -1.0);
59
descriptions.
addDefault
(desc);
60
}
PropagatorWithMaterialESProducer::useOldAnalPropLogic_
const bool useOldAnalPropLogic_
Definition:
PropagatorWithMaterialESProducer.h:35
electrons_cff.bool
bool
Definition:
electrons_cff.py:372
anyDirection
Definition:
PropagationDirection.h:4
edm::ESInputTag
Definition:
ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition:
ParameterSetDescription.h:95
PropagatorWithMaterialESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition:
PropagatorWithMaterialESProducer.cc:49
ESHandle.h
PropagatorWithMaterialESProducer::ptMin_
const double ptMin_
Definition:
PropagatorWithMaterialESProducer.h:32
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
sistrip::dir_
static const char dir_[]
Definition:
ConstantsForDqm.h:17
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
PropagatorWithMaterialESProducer::mfToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
Definition:
PropagatorWithMaterialESProducer.h:29
PropagatorWithMaterialESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition:
PropagatorWithMaterialESProducer.cc:40
oppositeToMomentum
Definition:
PropagationDirection.h:4
PropagatorWithMaterialESProducer::mass_
const double mass_
Definition:
PropagatorWithMaterialESProducer.h:30
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
PropagatorWithMaterialESProducer::useRK_
const bool useRK_
Definition:
PropagatorWithMaterialESProducer.h:34
PropagatorWithMaterialESProducer.h
PropagatorWithMaterialESProducer::dir_
const PropagationDirection dir_
Definition:
PropagatorWithMaterialESProducer.h:33
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:112
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
PropagatorWithMaterialESProducer::PropagatorWithMaterialESProducer
PropagatorWithMaterialESProducer(const edm::ParameterSet &p)
Definition:
PropagatorWithMaterialESProducer.cc:29
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition:
ParameterSet.h:36
PropagatorWithMaterial.h
ModuleFactory.h
ESInputTag.h
std
Definition:
JetResolutionObject.h:76
PropagationDirection
PropagationDirection
Definition:
PropagationDirection.h:4
EventSetup.h
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
MagneticField
Definition:
MagneticField.h:19
PropagatorWithMaterialESProducer::maxDPhi_
const double maxDPhi_
Definition:
PropagatorWithMaterialESProducer.h:31
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