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  setWhatProduced(this, myname);
20 }
21 
23 
24 std::unique_ptr<Propagator> GeantPropagatorESProducer::produce(const TrackingComponentsRecord &iRecord) {
25  ESHandle<MagneticField> magfield;
26  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield);
27 
28  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
29  std::string particleName = pset_.getParameter<std::string>("ParticleName");
30 
32 
33  if (pdir == "oppositeToMomentum")
34  dir = oppositeToMomentum;
35  if (pdir == "alongMomentum")
36  dir = alongMomentum;
37  if (pdir == "anyDirection")
38  dir = anyDirection;
39 
40  return std::make_unique<Geant4ePropagator>(&(*magfield), particleName, dir);
41 }
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