CMS 3D CMS Logo

SmartPropagatorESProducer.cc
Go to the documentation of this file.
1 
8 
14 
17 
20 
21 
22 using namespace edm;
23 using namespace std;
24 
26 {
27  string myname = parameterSet.getParameter<string>("ComponentName");
28 
29  string propDir = parameterSet.getParameter<string>("PropagationDirection");
30 
31  if (propDir == "oppositeToMomentum") thePropagationDirection = oppositeToMomentum;
32  else if (propDir == "alongMomentum") thePropagationDirection = alongMomentum;
33  else if (propDir == "anyDirection") thePropagationDirection = anyDirection;
34  else
35  throw cms::Exception("SmartPropagatorESProducer")
36  << "Wrong fit direction chosen in SmartPropagatorESProducer";
37 
38 
39  theEpsilon = parameterSet.getParameter<double>("Epsilon");
40 
41  theTrackerPropagatorName = parameterSet.getParameter<string>("TrackerPropagator");
42  theMuonPropagatorName = parameterSet.getParameter<string>("MuonPropagator");
43 
44  setWhatProduced(this,myname);
45 }
46 
48 
49 std::unique_ptr<Propagator>
51 
52  ESHandle<MagneticField> magField;
53  iRecord.getRecord<IdealMagneticFieldRecord>().get(magField);
54 
56  iRecord.get(theTrackerPropagatorName,trackerPropagator);
57 
59  iRecord.get(theMuonPropagatorName,muonPropagator);
60 
61 
62  return std::make_unique<SmartPropagator>(*trackerPropagator, *muonPropagator,
63  &*magField,
64  thePropagationDirection,
65  theEpsilon);
66 }
T getParameter(std::string const &) const
muonPropagator
Propagator to go from muon state to TOB/TEC.
trackerPropagator
Propagator used searching for hits.
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
SmartPropagatorESProducer(const edm::ParameterSet &)
Constructor.
~SmartPropagatorESProducer() override
Destructor.
HLT enums.
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11