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 
static const char dir_[]
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
PropagationDirection
StraightLinePropagatorESProducer(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
HLT enums.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const