TrackingTools
Producers
src
StraightLinePropagatorESProducer.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
TrackingTools/GeomPropagators/interface/StraightLinePropagator.h
"
4
#include "
TrackingTools/Records/interface/TrackingComponentsRecord.h
"
5
#include "
MagneticField/Engine/interface/MagneticField.h
"
6
#include "
MagneticField/Records/interface/IdealMagneticFieldRecord.h
"
7
8
#include "
FWCore/Framework/interface/EventSetup.h
"
9
#include "
FWCore/Framework/interface/ESHandle.h
"
10
#include "
FWCore/Framework/interface/ModuleFactory.h
"
11
12
#include <string>
13
#include <memory>
14
15
class
StraightLinePropagatorESProducer
:
public
edm::ESProducer
{
16
public
:
17
StraightLinePropagatorESProducer
(
const
edm::ParameterSet
&
p
);
18
~StraightLinePropagatorESProducer
()
override
;
19
std::unique_ptr<Propagator>
produce
(
const
TrackingComponentsRecord
&);
20
21
private
:
22
const
PropagationDirection
dir_
;
23
const
edm::ESGetToken<MagneticField, IdealMagneticFieldRecord>
magToken_
;
24
};
25
26
using namespace
edm
;
27
28
StraightLinePropagatorESProducer::StraightLinePropagatorESProducer
(
const
edm::ParameterSet
&
p
)
29
:
dir_
{[](
std::string
const
& pdir) {
30
if
(pdir ==
"oppositeToMomentum"
)
31
return
oppositeToMomentum
;
32
else
if
(pdir ==
"anyDirection"
)
33
return
anyDirection
;
34
return
alongMomentum
;
35
}(
p
.getParameter<
std::string
>(
"PropagationDirection"
))},
36
magToken_{setWhatProduced(
this
,
p
.getParameter<
std::string
>(
"ComponentName"
))
37
.consumesFrom<
MagneticField
,
IdealMagneticFieldRecord
>()}
38
39
{}
40
41
StraightLinePropagatorESProducer::~StraightLinePropagatorESProducer
() {}
42
43
std::unique_ptr<Propagator>
StraightLinePropagatorESProducer::produce
(
const
TrackingComponentsRecord
& iRecord) {
44
return
std::make_unique<StraightLinePropagator>(&iRecord.
get
(
magToken_
),
dir_
);
45
}
46
47
DEFINE_FWK_EVENTSETUP_MODULE
(
StraightLinePropagatorESProducer
);
StraightLinePropagatorESProducer
Definition:
StraightLinePropagatorESProducer.cc:15
anyDirection
Definition:
PropagationDirection.h:4
ESHandle.h
StraightLinePropagatorESProducer::~StraightLinePropagatorESProducer
~StraightLinePropagatorESProducer() override
Definition:
StraightLinePropagatorESProducer.cc:41
StraightLinePropagatorESProducer::magToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
Definition:
StraightLinePropagatorESProducer.cc:23
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
ESProducer.h
oppositeToMomentum
Definition:
PropagationDirection.h:4
IdealMagneticFieldRecord
Definition:
IdealMagneticFieldRecord.h:11
StraightLinePropagatorESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition:
StraightLinePropagatorESProducer.cc:43
IdealMagneticFieldRecord.h
StraightLinePropagatorESProducer::dir_
const PropagationDirection dir_
Definition:
StraightLinePropagatorESProducer.cc:22
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
edm::ParameterSet
Definition:
ParameterSet.h:47
MagneticField.h
StraightLinePropagator.h
StraightLinePropagatorESProducer::StraightLinePropagatorESProducer
StraightLinePropagatorESProducer(const edm::ParameterSet &p)
Definition:
StraightLinePropagatorESProducer.cc:28
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
ModuleFactory.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
alongMomentum
Definition:
PropagationDirection.h:4
TrackingComponentsRecord
Definition:
TrackingComponentsRecord.h:12
Generated for CMSSW Reference Manual by
1.8.16