CMS 3D CMS Logo

FlexibleKFFittingSmootherESProducer.cc
Go to the documentation of this file.
1 
4 
9 
10 
12 
14 
15 
16 namespace {
17 
18  class FlexibleKFFittingSmoother final : public TrajectoryFitter {
19  public:
20  ~FlexibleKFFittingSmoother() override{}
21 
22  private:
24  FlexibleKFFittingSmoother(const TrajectoryFitter& standardFitter,
26  theStandardFitter(standardFitter.clone()),
27  theLooperFitter(looperFitter.clone()) {}
28 
29 
30  Trajectory fitOne(const Trajectory& t,fitType type) const override { return fitter(type)->fitOne(t,type);}
31 
32 
33  Trajectory fitOne(const TrajectorySeed& aSeed,
34  const RecHitContainer& hits,
35  const TrajectoryStateOnSurface& firstPredTsos,
36  fitType type) const override {return fitter(type)->fitOne(aSeed,hits,firstPredTsos,type); }
37 
38  Trajectory fitOne(const TrajectorySeed& aSeed,
39  const RecHitContainer& hits,
40  fitType type) const override { return fitter(type)->fitOne(aSeed,hits,type); }
41 
42  std::unique_ptr<TrajectoryFitter> clone() const override {
43  return std::unique_ptr<TrajectoryFitter>(new FlexibleKFFittingSmoother(*theStandardFitter,*theLooperFitter));
44  }
45 
46  // FIXME a prototype: final inplementaiton may differ
47  void setHitCloner(TkCloner const * hc) override {
48  theStandardFitter->setHitCloner(hc);
49  theLooperFitter->setHitCloner(hc);
50  }
51 
52  private:
53 
54  const TrajectoryFitter* fitter(fitType type) const {
55  return (type==standard) ? theStandardFitter.get() : theLooperFitter.get();
56  }
57 
58  const std::unique_ptr<TrajectoryFitter> theStandardFitter;
59  const std::unique_ptr<TrajectoryFitter> theLooperFitter;
60 
61 
62  friend class FlexibleKFFittingSmootherESProducer;
63 
64  };
65 
66 
67 
68  class FlexibleKFFittingSmootherESProducer: public edm::ESProducer{
69  public:
70  FlexibleKFFittingSmootherESProducer(const edm::ParameterSet & p)
71  {
72  std::string myname = p.getParameter<std::string>("ComponentName");
73  pset_ = p;
74  setWhatProduced(this,myname);
75  }
76 
77  ~FlexibleKFFittingSmootherESProducer() override {}
78 
79  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
81  desc.add<std::string>("ComponentName","FlexibleKFFittingSmoother");
82  desc.add<std::string>("standardFitter","KFFittingSmootherWithOutliersRejectionAndRK");
83  desc.add<std::string>("looperFitter","LooperFittingSmoother");
84  descriptions.add("FlexibleKFFittingSmoother", desc);
85  }
86 
87  std::unique_ptr<TrajectoryFitter>
88  produce(const TrajectoryFitterRecord & iRecord){
89 
92 
93  iRecord.get(pset_.getParameter<std::string>("standardFitter"),standardFitter);
94  iRecord.get(pset_.getParameter<std::string>("looperFitter"),looperFitter);
95 
96  return std::unique_ptr<TrajectoryFitter>(new FlexibleKFFittingSmoother(*standardFitter.product(),
97  *looperFitter.product()));
98  }
99 
100 
101  private:
102  edm::ParameterSet pset_;
103  };
104 
105 }
106 
107 
108 
110 
111 DEFINE_FWK_EVENTSETUP_MODULE(FlexibleKFFittingSmootherESProducer);
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
virtual std::unique_ptr< TrajectoryFitter > clone() const =0
virtual void setHitCloner(TkCloner const *)=0
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
susybsm::HSCParticleCollection hc
Definition: classes.h:25
T const * product() const
Definition: ESHandle.h:84
bool get(HolderT &iHolder) const