CMS 3D CMS Logo

KFTrajectorySmootherESProducer.cc
Go to the documentation of this file.
3 
8 
13 
17 #include <memory>
18 
19 namespace {
20 
21  class KFTrajectorySmootherESProducer final : public edm::ESProducer {
22  public:
23  KFTrajectorySmootherESProducer(const edm::ParameterSet& p);
24  std::unique_ptr<TrajectorySmoother> produce(const TrajectoryFitterRecord&);
25 
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
28  desc.add<std::string>("ComponentName", "KFSmoother");
29  desc.add<std::string>("Propagator", "PropagatorWithMaterial");
30  desc.add<std::string>("Updator", "KFUpdator");
31  desc.add<std::string>("Estimator", "Chi2");
32  desc.add<std::string>("RecoGeometry", "GlobalDetLayerGeometry");
33  desc.add<double>("errorRescaling", 100);
34  desc.add<int>("minHits", 3);
35  descriptions.add("KFTrajectorySmoother", desc);
36  }
37 
38  private:
43  const double rescaleFactor_;
44  const int minHits_;
45  };
46 
47  KFTrajectorySmootherESProducer::KFTrajectorySmootherESProducer(const edm::ParameterSet& p)
48  : rescaleFactor_{p.getParameter<double>("errorRescaling")}, minHits_{p.getParameter<int>("minHits")} {
49  std::string myname = p.getParameter<std::string>("ComponentName");
50  auto cc = setWhatProduced(this, myname);
51  propToken_ = cc.consumes(edm::ESInputTag("", p.getParameter<std::string>("Propagator")));
52  updToken_ = cc.consumes(edm::ESInputTag("", p.getParameter<std::string>("Updator")));
53  estToken_ = cc.consumes(edm::ESInputTag("", p.getParameter<std::string>("Estimator")));
54  geoToken_ = cc.consumes(edm::ESInputTag("", p.getParameter<std::string>("RecoGeometry")));
55  }
56 
57  std::unique_ptr<TrajectorySmoother> KFTrajectorySmootherESProducer::produce(const TrajectoryFitterRecord& iRecord) {
58  return std::make_unique<KFTrajectorySmoother>(&iRecord.get(propToken_),
59  &iRecord.get(updToken_),
60  &iRecord.get(estToken_),
61  rescaleFactor_,
62  minHits_,
63  &iRecord.get(geoToken_));
64  }
65 } // namespace
66 
68 DEFINE_FWK_EVENTSETUP_MODULE(KFTrajectorySmootherESProducer);
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
#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)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const