CMS 3D CMS Logo

PropagatorWithMaterialESProducer.cc
Go to the documentation of this file.
5 
11 
12 #include <string>
13 #include <memory>
14 
15 using namespace edm;
16 
18 {
19  std::string myname = p.getParameter<std::string>("ComponentName");
20  pset_ = p;
21  setWhatProduced(this,myname);
22 }
23 
25 
26 std::unique_ptr<Propagator>
28 // if (_propagator){
29 // delete _propagator;
30 // _propagator = 0;
31 // }
32 
33  std::string pdir = pset_.getParameter<std::string>("PropagationDirection");
34  double mass = pset_.getParameter<double>("Mass");
35  double maxDPhi = pset_.getParameter<double>("MaxDPhi");
36  bool useRK = pset_.getParameter<bool>("useRungeKutta");
37  bool useOldAnalPropLogic = pset_.existsAs<bool>("useOldAnalPropLogic") ?
38  pset_.getParameter<bool>("useOldAnalPropLogic") : true;
39  double ptMin = pset_.existsAs<double>("ptMin") ? pset_.getParameter<double>("ptMin") : -1.0;
40 
41  ESHandle<MagneticField> magfield;
42  std::string mfName = "";
43  if (pset_.exists("SimpleMagneticField"))
44  mfName = pset_.getParameter<std::string>("SimpleMagneticField");
45  iRecord.getRecord<IdealMagneticFieldRecord>().get(mfName,magfield);
46  // edm::ESInputTag mfESInputTag(mfName);
47  // iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,magfield);
48  //fixme check that useRK is false when using SimpleMagneticField
49 
51 
52  if (pdir == "oppositeToMomentum") dir = oppositeToMomentum;
53  if (pdir == "alongMomentum") dir = alongMomentum;
54  if (pdir == "anyDirection") dir = anyDirection;
55 
56  return std::make_unique<PropagatorWithMaterial>(dir, mass, &(*magfield),
57  maxDPhi,useRK,ptMin,
59 }
60 
61 
T getParameter(std::string const &) const
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
PropagationDirection
PropagatorWithMaterialESProducer(const edm::ParameterSet &p)
HLT enums.
dbl *** dir
Definition: mlp_gen.cc:35