Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:32

0001 #include "FWCore/Framework/interface/EventSetup.h"
0002 #include "FWCore/Framework/interface/ESHandle.h"
0003 #include "FWCore/Framework/interface/ModuleFactory.h"
0004 #include "FWCore/Framework/interface/ESProducer.h"
0005 
0006 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorParams.h"
0007 
0008 #include "FWCore/Framework/interface/ESProducer.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0011 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
0012 #include <memory>
0013 
0014 namespace {
0015 
0016   class Chi2MeasurementEstimatorESProducer : public edm::ESProducer {
0017   public:
0018     Chi2MeasurementEstimatorESProducer(const edm::ParameterSet& p);
0019 
0020     std::unique_ptr<Chi2MeasurementEstimatorBase> produce(const TrackingComponentsRecord&);
0021 
0022     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0023 
0024   private:
0025     const double maxChi2_;
0026     const double nSigma_;
0027     const double maxDis_;
0028     const double maxSag_;
0029     const double minTol_;
0030     const double minpt_;
0031   };
0032 
0033   Chi2MeasurementEstimatorESProducer::Chi2MeasurementEstimatorESProducer(const edm::ParameterSet& p)
0034       : maxChi2_(p.getParameter<double>("MaxChi2")),
0035         nSigma_(p.getParameter<double>("nSigma")),
0036         maxDis_(p.getParameter<double>("MaxDisplacement")),
0037         maxSag_(p.getParameter<double>("MaxSagitta")),
0038         minTol_(p.getParameter<double>("MinimalTolerance")),
0039         minpt_(p.getParameter<double>("MinPtForHitRecoveryInGluedDet")) {
0040     std::string myname = p.getParameter<std::string>("ComponentName");
0041     setWhatProduced(this, myname);
0042   }
0043 
0044   std::unique_ptr<Chi2MeasurementEstimatorBase> Chi2MeasurementEstimatorESProducer::produce(
0045       const TrackingComponentsRecord& iRecord) {
0046     return std::make_unique<Chi2MeasurementEstimator>(maxChi2_, nSigma_, maxDis_, maxSag_, minTol_, minpt_);
0047   }
0048 
0049   void Chi2MeasurementEstimatorESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0050     auto desc = chi2MeasurementEstimatorParams::getFilledConfigurationDescription();
0051     desc.add<std::string>("ComponentName", "Chi2");
0052     descriptions.add("Chi2MeasurementEstimatorDefault", desc);
0053   }
0054 
0055 }  // namespace
0056 
0057 DEFINE_FWK_EVENTSETUP_MODULE(Chi2MeasurementEstimatorESProducer);