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