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  ~MRHChi2MeasurementEstimatorESProducer() override;
16  std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
17  private:
18  edm::ParameterSet pset_;
19 };
20 
21 MRHChi2MeasurementEstimatorESProducer::MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet & p)
22 {
23  std::string myname = p.getParameter<std::string>("ComponentName");
24  pset_ = p;
25  setWhatProduced(this,myname);
26 }
27 
28 MRHChi2MeasurementEstimatorESProducer::~MRHChi2MeasurementEstimatorESProducer() {}
29 
30 std::unique_ptr<Chi2MeasurementEstimatorBase>
31 MRHChi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord& iRecord){
32  double maxChi2 = pset_.getParameter<double>("MaxChi2");
33  double nSigma = pset_.getParameter<double>("nSigma");
34  return std::make_unique<MRHChi2MeasurementEstimator>(maxChi2,nSigma);
35 }
36 
37 }
38 
39 
40 DEFINE_FWK_EVENTSETUP_MODULE(MRHChi2MeasurementEstimatorESProducer);
41 
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60