TrackingTools
Producers
src
AnalyticalPropagatorESProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
FWCore/ParameterSet/interface/ConfigurationDescriptions.h
"
4
#include "
TrackingTools/Records/interface/TrackingComponentsRecord.h
"
5
#include "
TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h
"
6
7
#include "
MagneticField/Engine/interface/MagneticField.h
"
8
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
9
10
#include "
FWCore/Framework/interface/EventSetup.h
"
11
#include "
FWCore/Framework/interface/ESHandle.h
"
12
#include "
FWCore/Framework/interface/ModuleFactory.h
"
13
#include "
FWCore/Framework/interface/ESProducer.h
"
14
#include <
FWCore/Utilities/interface/ESInputTag.h
>
15
16
#include <string>
17
#include <memory>
18
19
using namespace
edm
;
20
21
class
AnalyticalPropagatorESProducer
:
public
edm::ESProducer
{
22
public
:
23
AnalyticalPropagatorESProducer
(
const
edm::ParameterSet
&
p
);
24
std::unique_ptr<Propagator> produce(
const
TrackingComponentsRecord
&);
25
26
static
void
fillDescriptions
(
edm::ConfigurationDescriptions
& oDesc);
27
28
private
:
29
const
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord>
magToken_
;
30
const
double
dphiCut_
;
31
const
PropagationDirection
dir_
;
32
};
33
34
AnalyticalPropagatorESProducer::AnalyticalPropagatorESProducer
(
const
edm::ParameterSet
&
p
)
35
: magToken_{
setWhatProduced
(
this
,
p
.getParameter<
std::string
>(
"ComponentName"
))
36
.consumesFrom<
MagneticField
,
IdealMagneticFieldRecord
>(
37
edm::ESInputTag
(
""
,
p
.getParameter<
std::string
>(
"SimpleMagneticField"
)))},
38
dphiCut_{
p
.getParameter<
double
>(
"MaxDPhi"
)},
39
dir_
{[](
std::string
const
& pdir) {
40
if
(pdir ==
"oppositeToMomentum"
)
41
return
oppositeToMomentum
;
42
if
(pdir ==
"alongMomentum"
)
43
return
alongMomentum
;
44
if
(pdir ==
"anyDirection"
)
45
return
anyDirection
;
46
return
alongMomentum
;
47
}(
p
.getParameter<
std::string
>(
"PropagationDirection"
))} {}
48
49
void
AnalyticalPropagatorESProducer::fillDescriptions
(
edm::ConfigurationDescriptions
& oDesc) {
50
edm::ParameterSetDescription
desc
;
51
desc
.add<
std::string
>(
"ComponentName"
)->setComment(
"the data label assigned to the Propagator"
);
52
desc
.add<
std::string
>(
"SimpleMagneticField"
,
""
)->setComment(
"the data label used to retrieve the MagneticField"
);
53
desc
.add<
std::string
>(
"PropagationDirection"
);
54
desc
.add<
double
>(
"MaxDPhi"
);
55
56
oDesc.
addDefault
(
desc
);
57
}
58
59
std::unique_ptr<Propagator>
AnalyticalPropagatorESProducer::produce
(
const
TrackingComponentsRecord
& iRecord) {
60
return
std::make_unique<AnalyticalPropagator>(&iRecord.
get
(
magToken_
),
dir_
,
dphiCut_
);
61
}
62
63
DEFINE_FWK_EVENTSETUP_MODULE
(
AnalyticalPropagatorESProducer
);
ConfigurationDescriptions.h
anyDirection
Definition:
PropagationDirection.h:4
edm::ESInputTag
Definition:
ESInputTag.h:87
AnalyticalPropagatorESProducer::dir_
const PropagationDirection dir_
Definition:
AnalyticalPropagatorESProducer.cc:31
ESHandle.h
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::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
edm::ParameterSetDescription
Definition:
ParameterSetDescription.h:52
ESProducer.h
oppositeToMomentum
Definition:
PropagationDirection.h:4
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
AnalyticalPropagatorESProducer::magToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
Definition:
AnalyticalPropagatorESProducer.cc:29
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
IdealMagneticFieldRecord.h
AnalyticalPropagatorESProducer::AnalyticalPropagatorESProducer
AnalyticalPropagatorESProducer(const edm::ParameterSet &p)
Definition:
AnalyticalPropagatorESProducer.cc:34
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:109
edm::ConfigurationDescriptions
Definition:
ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
AnalyticalPropagatorESProducer
Definition:
AnalyticalPropagatorESProducer.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:47
AnalyticalPropagatorESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &oDesc)
Definition:
AnalyticalPropagatorESProducer.cc:49
AnalyticalPropagatorESProducer::dphiCut_
const double dphiCut_
Definition:
AnalyticalPropagatorESProducer.cc:30
MagneticField.h
AnalyticalPropagator.h
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
AnalyticalPropagatorESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition:
AnalyticalPropagatorESProducer.cc:59
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition:
submitPVResolutionJobs.py:251
ESInputTag.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
TrackingComponentsRecord.h
PropagationDirection
PropagationDirection
Definition:
PropagationDirection.h:4
EventSetup.h
edm::ESProducer
Definition:
ESProducer.h:104
ParameterSet.h
SiStripFineDelayHit_cfi.MagneticField
MagneticField
Definition:
SiStripFineDelayHit_cfi.py:7
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition:
ConfigurationDescriptions.cc:99
alongMomentum
Definition:
PropagationDirection.h:4
TrackingComponentsRecord
Definition:
TrackingComponentsRecord.h:12
Generated for CMSSW Reference Manual by
1.8.16