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);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
void addDefault(ParameterSetDescription const &psetDescription)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)