CMS 3D CMS Logo

StraightLinePropagatorESProducer.cc
Go to the documentation of this file.
7 
11 
12 #include <string>
13 #include <memory>
14 
16 public:
19  std::unique_ptr<Propagator> produce(const TrackingComponentsRecord&);
20 
21 private:
24 };
25 
26 using namespace edm;
27 
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 
42 
43 std::unique_ptr<Propagator> StraightLinePropagatorESProducer::produce(const TrackingComponentsRecord& iRecord) {
44  return std::make_unique<StraightLinePropagator>(&iRecord.get(magToken_), dir_);
45 }
46 
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