CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KFTrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef CD_KFTrajectoryFitter_H_
2 #define CD_KFTrajectoryFitter_H_
3 
21 
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=0) :
39  thePropagator(aPropagator.clone()),
40  theUpdator(aUpdator.clone()),
41  theEstimator(aEstimator.clone()),
42  theGeometry(detLayerGeometry),
43  minHits_(minHits),
44  owner(true){
45  if(!theGeometry) theGeometry = &dummyGeometry;
46  // FIXME. Why this first constructor is needed? who is using it? Can it be removed?
47  // it is uses in many many places
48  }
49 
50 
51  KFTrajectoryFitter(const Propagator* aPropagator,
52  const TrajectoryStateUpdator* aUpdator,
53  const MeasurementEstimator* aEstimator,
54  int minHits = 3,
55  const DetLayerGeometry* detLayerGeometry=0) :
56  thePropagator(aPropagator),
57  theUpdator(aUpdator),
58  theEstimator(aEstimator),
59  theGeometry(detLayerGeometry),
60  minHits_(minHits),
61  owner(false){
62  if(!theGeometry) theGeometry = &dummyGeometry;
63  }
64 
66  if (owner) {
67  delete thePropagator;
68  delete theUpdator;
69  delete theEstimator;
70  }
71  }
72 
73  Trajectory fitOne(const Trajectory& aTraj,fitType) const;
74  Trajectory fitOne(const TrajectorySeed& aSeed,
75  const RecHitContainer& hits,fitType) const;
76 
77  Trajectory fitOne(const TrajectorySeed& aSeed,
78  const RecHitContainer& hits,
79  const TSOS& firstPredTsos,fitType) const;
80 
81  const Propagator* propagator() const {return thePropagator;}
82  const TrajectoryStateUpdator* updator() const {return theUpdator;}
83  const MeasurementEstimator* estimator() const {return theEstimator;}
84 
85  virtual KFTrajectoryFitter* clone() const
86  {
87  return owner ?
88  new KFTrajectoryFitter(*thePropagator,*theUpdator,*theEstimator,minHits_,theGeometry) :
89  new KFTrajectoryFitter(thePropagator,theUpdator,theEstimator,minHits_,theGeometry);
90  }
91 
92 private:
94 
95 
97  const Propagator* thePropagator;
98  const TrajectoryStateUpdator* theUpdator;
99  const MeasurementEstimator* theEstimator;
100  const DetLayerGeometry* theGeometry;
101  int minHits_;
102  bool owner;
103 };
104 
105 #endif //CD_KFTrajectoryFitter_H_
const TrajectoryStateUpdator * updator() const
KFTrajectoryFitter(const Propagator &aPropagator, const TrajectoryStateUpdator &aUpdator, const MeasurementEstimator &aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)
static const DetLayerGeometry dummyGeometry
TrajectoryMeasurement TM
virtual KFTrajectoryFitter * clone() const
TrajectoryStateOnSurface TSOS
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
const MeasurementEstimator * estimator() const
FreeTrajectoryState FTS
KFTrajectoryFitter(const Propagator *aPropagator, const TrajectoryStateUpdator *aUpdator, const MeasurementEstimator *aEstimator, int minHits=3, const DetLayerGeometry *detLayerGeometry=0)
const Propagator * propagator() const
Unlimited (trivial) bounds.