CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PropagatorWithMaterialESProducer.cc
Go to the documentation of this file.
3 
9 
10 #include <string>
11 #include <memory>
12 
13 using namespace edm;
14 
15 namespace {
16  PropagationDirection stringToDirection(std::string const& iName) {
18 
19  if (iName == "oppositeToMomentum")
20  dir = oppositeToMomentum;
21  if (iName == "alongMomentum")
22  dir = alongMomentum;
23  if (iName == "anyDirection")
24  dir = anyDirection;
25  return dir;
26  }
27 } // namespace
28 
30  : mfToken_(setWhatProduced(this, p.getParameter<std::string>("ComponentName"))
32  edm::ESInputTag("", p.getParameter<std::string>("SimpleMagneticField")))),
33  mass_(p.getParameter<double>("Mass")),
34  maxDPhi_(p.getParameter<double>("MaxDPhi")),
35  ptMin_(p.getParameter<double>("ptMin")),
36  dir_(stringToDirection(p.getParameter<std::string>("PropagationDirection"))),
37  useRK_(p.getParameter<bool>("useRungeKutta")),
38  useOldAnalPropLogic_(p.getParameter<bool>("useOldAnalPropLogic")) {}
39 
40 std::unique_ptr<Propagator> PropagatorWithMaterialESProducer::produce(const TrackingComponentsRecord& iRecord) {
41  // edm::ESInputTag mfESInputTag(mfName);
42  // iRecord.getRecord<IdealMagneticFieldRecord>().get(mfESInputTag,magfield);
43  //fixme check that useRK is false when using SimpleMagneticField
44 
45  return std::make_unique<PropagatorWithMaterial>(
47 }
48 
51  desc.add<std::string>("PropagationDirection");
52  desc.add<std::string>("SimpleMagneticField", "");
53  desc.add<std::string>("ComponentName");
54  desc.add<double>("Mass");
55  desc.add<double>("MaxDPhi");
56  desc.add<bool>("useRungeKutta");
57  desc.add<bool>("useOldAnalPropLogic", true);
58  desc.add<double>("ptMin", -1.0);
59  descriptions.addDefault(desc);
60 }
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static const char dir_[]
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
PropagationDirection
ptMin_(conf.getParameter< double >("ptMin"))
void addDefault(ParameterSetDescription const &psetDescription)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
PropagatorWithMaterialESProducer(const edm::ParameterSet &p)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_