CMS 3D CMS Logo

KFTrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef CD_KFTrajectoryFitter_H_
2 #define CD_KFTrajectoryFitter_H_
3 
19 
20 #include <memory>
21 
22 class KFTrajectoryFitter final : public TrajectoryFitter {
23 private:
27 
28 public:
29  // backward compatible (too many places it uses as such...)
30  KFTrajectoryFitter(const Propagator& aPropagator,
31  const TrajectoryStateUpdator& aUpdator,
32  const MeasurementEstimator& aEstimator,
33  int minHits = 3,
34  const DetLayerGeometry* detLayerGeometry = nullptr,
35  TkCloner const* hc = nullptr)
36  : thePropagator(aPropagator.clone()),
37  theUpdator(aUpdator.clone()),
38  theEstimator(aEstimator.clone()),
40  theGeometry(detLayerGeometry),
42  owner(true) {
43  if (!theGeometry)
45  // FIXME. Why this first constructor is needed? who is using it? Can it be removed?
46  // it is uses in many many places
47  }
48 
49  KFTrajectoryFitter(const Propagator* aPropagator,
50  const TrajectoryStateUpdator* aUpdator,
51  const MeasurementEstimator* aEstimator,
52  int minHits = 3,
53  const DetLayerGeometry* detLayerGeometry = nullptr,
54  TkCloner const* hc = nullptr)
55  : thePropagator(aPropagator),
56  theUpdator(aUpdator),
57  theEstimator(aEstimator),
59  theGeometry(detLayerGeometry),
61  owner(false) {
62  if (!theGeometry)
64  }
65 
66  ~KFTrajectoryFitter() override {
67  if (owner) {
68  delete thePropagator;
69  delete theUpdator;
70  delete theEstimator;
71  }
72  }
73 
74  Trajectory fitOne(const Trajectory& aTraj, fitType) const override;
75  Trajectory fitOne(const TrajectorySeed& aSeed, const RecHitContainer& hits, fitType) const override;
76 
77  Trajectory fitOne(const TrajectorySeed& aSeed,
78  const RecHitContainer& hits,
79  const TSOS& firstPredTsos,
80  fitType) const override;
81 
82  const Propagator* propagator() const { return thePropagator; }
83  const TrajectoryStateUpdator* updator() const { return theUpdator; }
84  const MeasurementEstimator* estimator() const { return theEstimator; }
85 
86  std::unique_ptr<TrajectoryFitter> clone() const override {
87  return owner ? std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
89  : std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(
91  }
92 
93  // FIXME a prototype: final inplementaiton may differ
94  void setHitCloner(TkCloner const* hc) override { theHitCloner = hc; }
95 
96 private:
97  KFTrajectoryFitter(KFTrajectoryFitter const&) = delete;
98 
103  TkCloner const* theHitCloner = nullptr;
105  int minHits_;
106  bool owner;
107 };
108 
109 #endif //CD_KFTrajectoryFitter_H_
FreeTrajectoryState FTS
std::unique_ptr< TrajectoryFitter > clone() const override
const TrajectoryStateUpdator * updator() const
const MeasurementEstimator * estimator() const
const MeasurementEstimator * theEstimator
TrajectoryMeasurement TM
Trajectory fitOne(const Trajectory &aTraj, fitType) const override
const TrajectoryStateUpdator * theUpdator
static const DetLayerGeometry dummyGeometry
~KFTrajectoryFitter() override
TrajectoryStateOnSurface TSOS
void setHitCloner(TkCloner const *hc) override
const DetLayerGeometry * theGeometry
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0, TkCloner const *hc=0)
KFTrajectoryFitter(const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0, TkCloner const *hc=0)
const Propagator * propagator() const
const Propagator * thePropagator
susybsm::HSCParticleCollection hc
Definition: classes.h:25
Trajectory::RecHitContainer RecHitContainer
TkCloner const * theHitCloner