CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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_[]
PropagationDirection
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
StraightLinePropagatorESProducer(const edm::ParameterSet &p)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_