CMS 3D CMS Logo

BeamHaloPropagatorESProducer.cc
Go to the documentation of this file.
1 
8 
14 
17 
20 
22 
23 using namespace edm;
24 using namespace std;
25 
27 {
28  myname = parameterSet.getParameter<string>("ComponentName");
29 
30  string propDir = parameterSet.getParameter<string>("PropagationDirection");
31 
32  if (propDir == "oppositeToMomentum") thePropagationDirection = oppositeToMomentum;
33  else if (propDir == "alongMomentum") thePropagationDirection = alongMomentum;
34  else if (propDir == "anyDirection") thePropagationDirection = anyDirection;
35  else
36  throw cms::Exception("BeamHaloPropagatorESProducer")
37  << "Wrong fit direction ("<< propDir <<")chosen in BeamHaloPropagatorESProducer";
38 
39  theEndCapTrackerPropagatorName = parameterSet.getParameter<string>("EndCapTrackerPropagator");
40  theCrossingTrackerPropagatorName = parameterSet.getParameter<string>("CrossingTrackerPropagator");
41 
42  setWhatProduced(this,myname);
43 }
44 
46 
47 std::unique_ptr<Propagator>
49 
50  ESHandle<MagneticField> magField;
51  iRecord.getRecord<IdealMagneticFieldRecord>().get(magField);
52 
53  ESHandle<Propagator> endcapPropagator;
54  iRecord.get(theEndCapTrackerPropagatorName,endcapPropagator);
55 
56  ESHandle<Propagator> crossPropagator;
57  iRecord.get(theCrossingTrackerPropagatorName,crossPropagator);
58 
59  LogDebug("BeamHaloPropagator")<<"Creating a BeamHaloPropagator: "<<myname
60  <<"\n with EndCap Propagator: "<<theEndCapTrackerPropagatorName
61  <<"\n with Crossing Propagator: "<<theCrossingTrackerPropagatorName;
62 
63  return std::make_unique<BeamHaloPropagator>(*endcapPropagator,*crossPropagator,
64  &*magField,
65  thePropagationDirection);
66 }
#define LogDebug(id)
~BeamHaloPropagatorESProducer() override
Destructor.
T getParameter(std::string const &) const
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
BeamHaloPropagatorESProducer(const edm::ParameterSet &)
Constructor.
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
HLT enums.
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11