CMS 3D CMS Logo

GeantPropagatorESProducer.cc
Go to the documentation of this file.
2 
4 
9 
10 #include <memory>
11 #include <string>
12 
13 using namespace edm;
14 
16  : magFieldToken_(setWhatProduced(this, p.getParameter<std::string>("ComponentName"))
17  .consumesFrom<MagneticField, IdealMagneticFieldRecord>(edm::ESInputTag("", ""))) {
18  pset_ = p;
19  plimit_ = pset_.getParameter<double>("PropagationPtotLimit");
20 }
21 
23 
24 std::unique_ptr<Propagator> GeantPropagatorESProducer::produce(const TrackingComponentsRecord &iRecord) {
25  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
27 
29 
30  if (pdir == "oppositeToMomentum") {
32  } else if (pdir == "alongMomentum") {
34  } else if (pdir == "anyDirection") {
35  dir = anyDirection;
36  }
37 
38  return std::make_unique<Geant4ePropagator>(&(iRecord.get(magFieldToken_)), particleName, dir, plimit_);
39 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PropagationDirection
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
HLT enums.
GeantPropagatorESProducer(const edm::ParameterSet &p)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_