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 
24 private:
25 
29 
30 public:
31 
32 
33  // backward compatible (too many places it uses as such...)
34  KFTrajectoryFitter(const Propagator& aPropagator,
35  const TrajectoryStateUpdator& aUpdator,
36  const MeasurementEstimator& aEstimator,
37  int minHits = 3,
38  const DetLayerGeometry* detLayerGeometry=nullptr,
39  TkCloner const * hc=nullptr) :
40  thePropagator(aPropagator.clone()),
41  theUpdator(aUpdator.clone()),
42  theEstimator(aEstimator.clone()),
44  theGeometry(detLayerGeometry),
46  owner(true){
48  // FIXME. Why this first constructor is needed? who is using it? Can it be removed?
49  // it is uses in many many places
50  }
51 
52 
53  KFTrajectoryFitter(const Propagator* aPropagator,
54  const TrajectoryStateUpdator* aUpdator,
55  const MeasurementEstimator* aEstimator,
56  int minHits = 3,
57  const DetLayerGeometry* detLayerGeometry=nullptr,
58  TkCloner const * hc=nullptr) :
59  thePropagator(aPropagator),
60  theUpdator(aUpdator),
61  theEstimator(aEstimator),
63  theGeometry(detLayerGeometry),
65  owner(false){
67  }
68 
69  ~KFTrajectoryFitter() override{
70  if (owner) {
71  delete thePropagator;
72  delete theUpdator;
73  delete theEstimator;
74  }
75  }
76 
77  Trajectory fitOne(const Trajectory& aTraj,fitType) const override;
78  Trajectory fitOne(const TrajectorySeed& aSeed,
79  const RecHitContainer& hits,fitType) const override;
80 
81  Trajectory fitOne(const TrajectorySeed& aSeed,
82  const RecHitContainer& hits,
83  const TSOS& firstPredTsos,fitType) const override;
84 
85  const Propagator* propagator() const {return thePropagator;}
86  const TrajectoryStateUpdator* updator() const {return theUpdator;}
87  const MeasurementEstimator* estimator() const {return theEstimator;}
88 
89  std::unique_ptr<TrajectoryFitter> clone() const override
90  {
91  return owner ?
92  std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(*thePropagator,
93  *theUpdator,
94  *theEstimator,
96  std::unique_ptr<TrajectoryFitter>(new KFTrajectoryFitter(thePropagator,
97  theUpdator,
99  minHits_,
101  }
102 
103  // FIXME a prototype: final inplementaiton may differ
104  void setHitCloner(TkCloner const * hc) override { theHitCloner = hc;}
105 
106 
107 private:
108  KFTrajectoryFitter(KFTrajectoryFitter const&) = delete;
109 
110 
115  TkCloner const * theHitCloner=nullptr;
117  int minHits_;
118  bool owner;
119 };
120 
121 #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