CMS 3D CMS Logo

AnalyticalPropagatorESProducer.cc
Go to the documentation of this file.
6 
9 
15 
16 #include <string>
17 #include <memory>
18 
19 using namespace edm;
20 
22 public:
24  std::unique_ptr<Propagator> produce(const TrackingComponentsRecord&);
25 
27 
28 private:
30  const double dphiCut_;
32 };
33 
35  : magToken_{setWhatProduced(this, p.getParameter<std::string>("ComponentName"))
37  edm::ESInputTag("", p.getParameter<std::string>("SimpleMagneticField")))},
38  dphiCut_{p.getParameter<double>("MaxDPhi")},
39  dir_{[](std::string const& pdir) {
40  if (pdir == "oppositeToMomentum")
41  return oppositeToMomentum;
42  if (pdir == "alongMomentum")
43  return alongMomentum;
44  if (pdir == "anyDirection")
45  return anyDirection;
46  return alongMomentum;
47  }(p.getParameter<std::string>("PropagationDirection"))} {}
48 
51  desc.add<std::string>("ComponentName")->setComment("the data label assigned to the Propagator");
52  desc.add<std::string>("SimpleMagneticField", "")->setComment("the data label used to retrieve the MagneticField");
53  desc.add<std::string>("PropagationDirection");
54  desc.add<double>("MaxDPhi");
55 
56  oDesc.addDefault(desc);
57 }
58 
59 std::unique_ptr<Propagator> AnalyticalPropagatorESProducer::produce(const TrackingComponentsRecord& iRecord) {
60  return std::make_unique<AnalyticalPropagator>(&iRecord.get(magToken_), dir_, dphiCut_);
61 }
62 
ConfigurationDescriptions.h
anyDirection
Definition: PropagationDirection.h:4
edm::ESInputTag
Definition: ESInputTag.h:87
AnalyticalPropagatorESProducer::dir_
const PropagationDirection dir_
Definition: AnalyticalPropagatorESProducer.cc:31
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
oppositeToMomentum
Definition: PropagationDirection.h:4
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
AnalyticalPropagatorESProducer::magToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magToken_
Definition: AnalyticalPropagatorESProducer.cc:29
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
IdealMagneticFieldRecord.h
AnalyticalPropagatorESProducer::AnalyticalPropagatorESProducer
AnalyticalPropagatorESProducer(const edm::ParameterSet &p)
Definition: AnalyticalPropagatorESProducer.cc:34
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:103
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
AnalyticalPropagatorESProducer
Definition: AnalyticalPropagatorESProducer.cc:21
edm::ParameterSet
Definition: ParameterSet.h:47
AnalyticalPropagatorESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &oDesc)
Definition: AnalyticalPropagatorESProducer.cc:49
AnalyticalPropagatorESProducer::dphiCut_
const double dphiCut_
Definition: AnalyticalPropagatorESProducer.cc:30
MagneticField.h
AnalyticalPropagator.h
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
AnalyticalPropagatorESProducer::produce
std::unique_ptr< Propagator > produce(const TrackingComponentsRecord &)
Definition: AnalyticalPropagatorESProducer.cc:59
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
ESInputTag.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
TrackingComponentsRecord.h
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:104
ParameterSet.h
SiStripFineDelayHit_cfi.MagneticField
MagneticField
Definition: SiStripFineDelayHit_cfi.py:7
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
alongMomentum
Definition: PropagationDirection.h:4
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12