CMS 3D CMS Logo

Chi2MeasurementEstimatorESProducer.cc
Go to the documentation of this file.
5 
7 
12 #include <memory>
13 
14 namespace {
15 
16  class Chi2MeasurementEstimatorESProducer : public edm::ESProducer {
17  public:
18  Chi2MeasurementEstimatorESProducer(const edm::ParameterSet& p);
19 
20  std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
23 
24  private:
25  const double maxChi2_;
26  const double nSigma_;
27  const double maxDis_;
28  const double maxSag_;
29  const double minTol_;
30  const double minpt_;
31  };
32 
33  Chi2MeasurementEstimatorESProducer::Chi2MeasurementEstimatorESProducer(const edm::ParameterSet& p)
34  : maxChi2_(p.getParameter<double>("MaxChi2")),
35  nSigma_(p.getParameter<double>("nSigma")),
36  maxDis_(p.getParameter<double>("MaxDisplacement")),
37  maxSag_(p.getParameter<double>("MaxSagitta")),
38  minTol_(p.getParameter<double>("MinimalTolerance")),
39  minpt_(p.getParameter<double>("MinPtForHitRecoveryInGluedDet")) {
40  std::string myname = p.getParameter<std::string>("ComponentName");
41  setWhatProduced(this, myname);
42  }
43 
44  std::unique_ptr<Chi2MeasurementEstimatorBase> Chi2MeasurementEstimatorESProducer::produce(
45  const TrackingComponentsRecord& iRecord) {
46  return std::make_unique<Chi2MeasurementEstimator>(maxChi2_, nSigma_, maxDis_, maxSag_, minTol_, minpt_);
47  }
48 
51  desc.add<std::string>("ComponentName", "Chi2");
52  descriptions.add("Chi2MeasurementEstimatorDefault", desc);
53  }
54 
55 } // namespace
56 
57 DEFINE_FWK_EVENTSETUP_MODULE(Chi2MeasurementEstimatorESProducer);
edm::ParameterSetDescription getFilledConfigurationDescription()
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)