CMS 3D CMS Logo

MRHChi2MeasurementEstimatorESProducer.cc
Go to the documentation of this file.
8 #include <memory>
9 
10 namespace {
11 
12  class MRHChi2MeasurementEstimatorESProducer : public edm::ESProducer {
13  public:
14  MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet& p);
15 
16  std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
17 
18  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
19 
20  private:
21  const double maxChi2_;
22  const double nSigma_;
23  };
24 
25  MRHChi2MeasurementEstimatorESProducer::MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet& p)
26  : maxChi2_(p.getParameter<double>("MaxChi2")), nSigma_(p.getParameter<double>("nSigma")) {
27  std::string myname = p.getParameter<std::string>("ComponentName");
28  setWhatProduced(this, myname);
29  }
30 
31  std::unique_ptr<Chi2MeasurementEstimatorBase> MRHChi2MeasurementEstimatorESProducer::produce(
32  const TrackingComponentsRecord& iRecord) {
33  return std::make_unique<MRHChi2MeasurementEstimator>(maxChi2_, nSigma_);
34  }
35 
38  desc.add<double>("MaxChi2");
39  desc.add<double>("nSigma");
40  desc.add<std::string>("ComponentName");
41  descriptions.addDefault(desc);
42  }
43 } // namespace
44 
45 DEFINE_FWK_EVENTSETUP_MODULE(MRHChi2MeasurementEstimatorESProducer);
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
ESHandle.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
ModuleFactory.h
MRHChi2MeasurementEstimator.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
TrackingComponentsRecord.h
EventSetup.h
edm::ESProducer
Definition: ESProducer.h:101
ParameterSet.h
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
TrackingComponentsRecord
Definition: TrackingComponentsRecord.h:12