CMS 3D CMS Logo

GeantPropagatorESProducer.cc
Go to the documentation of this file.
5 
10 
11 #include <memory>
12 #include <string>
13 
14 using namespace edm;
15 
17  std::string myname = p.getParameter<std::string>("ComponentName");
18  pset_ = p;
19  plimit_ = pset_.getParameter<double>("PropagationPtotLimit");
20  setWhatProduced(this, myname);
21 }
22 
24 
25 std::unique_ptr<Propagator> GeantPropagatorESProducer::produce(const TrackingComponentsRecord &iRecord) {
26  ESHandle<MagneticField> magfield;
27  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield);
28 
29  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
30  std::string particleName = pset_.getParameter<std::string>("ParticleName");
31 
33 
34  if (pdir == "oppositeToMomentum")
35  dir = oppositeToMomentum;
36  else if (pdir == "alongMomentum")
37  dir = alongMomentum;
38  else if (pdir == "anyDirection")
39  dir = anyDirection;
40 
41  return std::make_unique<Geant4ePropagator>(&(*magfield), particleName, dir, plimit_);
42 }
T getParameter(std::string const &) const
PropagationDirection
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
HLT enums.
GeantPropagatorESProducer(const edm::ParameterSet &p)
dbl *** dir
Definition: mlp_gen.cc:35