CMS 3D CMS Logo

BeamHaloPropagatorESProducer.cc
Go to the documentation of this file.
1 
8 
11 
17 
20 
23 
25 
26 #include <memory>
27 
29 public:
32 
35 
36  // Operations
37  std::unique_ptr<Propagator> produce(const TrackingComponentsRecord&);
38 
39 private:
47 };
48 
49 using namespace edm;
50 using namespace std;
51 
53  myname = parameterSet.getParameter<string>("ComponentName");
54 
55  string propDir = parameterSet.getParameter<string>("PropagationDirection");
56 
57  if (propDir == "oppositeToMomentum")
58  thePropagationDirection = oppositeToMomentum;
59  else if (propDir == "alongMomentum")
60  thePropagationDirection = alongMomentum;
61  else if (propDir == "anyDirection")
62  thePropagationDirection = anyDirection;
63  else
64  throw cms::Exception("BeamHaloPropagatorESProducer")
65  << "Wrong fit direction (" << propDir << ")chosen in BeamHaloPropagatorESProducer";
66 
67  theEndCapTrackerPropagatorName = parameterSet.getParameter<string>("EndCapTrackerPropagator");
68  theCrossingTrackerPropagatorName = parameterSet.getParameter<string>("CrossingTrackerPropagator");
69 
70  setWhatProduced(this, myname)
71  .setConsumes(magToken_)
72  .setConsumes(endcapToken_, edm::ESInputTag(""s, theEndCapTrackerPropagatorName))
73  .setConsumes(crossToken_, edm::ESInputTag(""s, theCrossingTrackerPropagatorName));
74 }
75 
77 
78 std::unique_ptr<Propagator> BeamHaloPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord) {
79  LogDebug("BeamHaloPropagator") << "Creating a BeamHaloPropagator: " << myname
80  << "\n with EndCap Propagator: " << theEndCapTrackerPropagatorName
81  << "\n with Crossing Propagator: " << theCrossingTrackerPropagatorName;
82 
83  return std::make_unique<BeamHaloPropagator>(
84  iRecord.get(endcapToken_), iRecord.get(crossToken_), &iRecord.get(magToken_), thePropagationDirection);
85 }
86 
BeamHaloPropagatorESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition: BeamHaloPropagatorESProducer.cc:78
Handle.h
anyDirection
Definition: PropagationDirection.h:4
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
BeamHaloPropagatorESProducer::crossToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > crossToken_
Definition: BeamHaloPropagatorESProducer.cc:46
ESProducer.h
oppositeToMomentum
Definition: PropagationDirection.h:4
BeamHaloPropagatorESProducer::magToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
Definition: BeamHaloPropagatorESProducer.cc:44
BeamHaloPropagatorESProducer
Definition: BeamHaloPropagatorESProducer.cc:28
alignCSCRings.s
s
Definition: alignCSCRings.py:92
IdealMagneticFieldRecord.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
BeamHaloPropagatorESProducer::endcapToken_
edm::ESGetToken< Propagator, TrackingComponentsRecord > endcapToken_
Definition: BeamHaloPropagatorESProducer.cc:45
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::ParameterSet
Definition: ParameterSet.h:36
BeamHaloPropagator.h
BeamHaloPropagatorESProducer::~BeamHaloPropagatorESProducer
~BeamHaloPropagatorESProducer() override
Destructor.
Definition: BeamHaloPropagatorESProducer.cc:76
BeamHaloPropagatorESProducer::thePropagationDirection
PropagationDirection thePropagationDirection
Definition: BeamHaloPropagatorESProducer.cc:40
BeamHaloPropagatorESProducer::theEndCapTrackerPropagatorName
std::string theEndCapTrackerPropagatorName
Definition: BeamHaloPropagatorESProducer.cc:42
MagneticField.h
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
BeamHaloPropagatorESProducer::theCrossingTrackerPropagatorName
std::string theCrossingTrackerPropagatorName
Definition: BeamHaloPropagatorESProducer.cc:43
PropagationDirection.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
ModuleFactory.h
std
Definition: JetResolutionObject.h:76
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
TrackingComponentsRecord.h
Exception
Definition: hltDiff.cc:246
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
EventSetup.h
Exception.h
edm::ESProducer
Definition: ESProducer.h:101
BeamHaloPropagatorESProducer::BeamHaloPropagatorESProducer
BeamHaloPropagatorESProducer(const edm::ParameterSet &)
Constructor.
Definition: BeamHaloPropagatorESProducer.cc:52
BeamHaloPropagatorESProducer::myname
std::string myname
Definition: BeamHaloPropagatorESProducer.cc:41
ParameterSet.h
alongMomentum
Definition: PropagationDirection.h:4
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12