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  virtual ~MRHChi2MeasurementEstimatorESProducer();
16  std::shared_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
17  private:
18  std::shared_ptr<Chi2MeasurementEstimatorBase> _estimator;
19  edm::ParameterSet pset_;
20 };
21 
22 MRHChi2MeasurementEstimatorESProducer::MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet & p)
23 {
24  std::string myname = p.getParameter<std::string>("ComponentName");
25  pset_ = p;
26  setWhatProduced(this,myname);
27 }
28 
29 MRHChi2MeasurementEstimatorESProducer::~MRHChi2MeasurementEstimatorESProducer() {}
30 
31 std::shared_ptr<Chi2MeasurementEstimatorBase>
32 MRHChi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord& iRecord){
33 
34  double maxChi2 = pset_.getParameter<double>("MaxChi2");
35  double nSigma = pset_.getParameter<double>("nSigma");
36  _estimator = std::make_shared<MRHChi2MeasurementEstimator>(maxChi2,nSigma);
37  return _estimator;
38 }
39 
40 }
41 
42 
43 DEFINE_FWK_EVENTSETUP_MODULE(MRHChi2MeasurementEstimatorESProducer);
44 
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