CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MRHChi2MeasurementEstimatorESProducer.cc
Go to the documentation of this file.
8 #include <boost/shared_ptr.hpp>
9 
10 namespace {
11 
12 class MRHChi2MeasurementEstimatorESProducer: public edm::ESProducer{
13  public:
14  MRHChi2MeasurementEstimatorESProducer(const edm::ParameterSet & p);
15  virtual ~MRHChi2MeasurementEstimatorESProducer();
16  boost::shared_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
17  private:
18  boost::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 boost::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 = boost::shared_ptr<Chi2MeasurementEstimatorBase>(new MRHChi2MeasurementEstimator(maxChi2,nSigma));
37  return _estimator;
38 }
39 
40 }
41 
42 
43 DEFINE_FWK_EVENTSETUP_MODULE(MRHChi2MeasurementEstimatorESProducer);
44 
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60