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  virtual ~Chi2MeasurementEstimatorESProducer();
20  std::shared_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord &);
21 
22  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
23 
24  private:
25  std::shared_ptr<Chi2MeasurementEstimatorBase> m_estimator;
26  edm::ParameterSet const m_pset;
27 };
28 
29 Chi2MeasurementEstimatorESProducer::Chi2MeasurementEstimatorESProducer(const edm::ParameterSet & p) :
30  m_pset(p) {
31  std::string myname = p.getParameter<std::string>("ComponentName");
32  setWhatProduced(this,myname);
33 }
34 
35 Chi2MeasurementEstimatorESProducer::~Chi2MeasurementEstimatorESProducer() {}
36 
37 std::shared_ptr<Chi2MeasurementEstimatorBase>
38 Chi2MeasurementEstimatorESProducer::produce(const TrackingComponentsRecord & iRecord){
39  auto maxChi2 = m_pset.getParameter<double>("MaxChi2");
40  auto nSigma = m_pset.getParameter<double>("nSigma");
41  auto maxDis = m_pset.getParameter<double>("MaxDisplacement");
42  auto maxSag = m_pset.getParameter<double>("MaxSagitta");
43  auto minTol = m_pset.getParameter<double>("MinimalTolerance");
44  auto minpt = m_pset.getParameter<double>("MinPtForHitRecoveryInGluedDet");
45 
46  m_estimator = std::make_shared<Chi2MeasurementEstimator>(maxChi2,nSigma, maxDis, maxSag, minTol,minpt);
47  return m_estimator;
48 }
49 
50 
51 void
52 Chi2MeasurementEstimatorESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
53 
55  desc.add<std::string>("ComponentName","Chi2");
56  descriptions.add("Chi2MeasurementEstimatorDefault", desc);
57 }
58 
59 
60 }
61 
62 
63 
64 DEFINE_FWK_EVENTSETUP_MODULE(Chi2MeasurementEstimatorESProducer);
65 
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
edm::ParameterSetDescription getFilledConfigurationDescription()
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)