CMS 3D CMS Logo

TrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef _TrajectoryFitter_H_
2 #define _TrajectoryFitter_H_
3 
6 
7 #include <memory>
8 
9 class TrajectorySeed;
11 class TkCloner;
12 
18 
20 public:
21  enum fitType { standard = 0, looper = 1 };
22 
25 
26  virtual ~TrajectoryFitter() {}
27  virtual std::unique_ptr<TrajectoryFitter> clone() const = 0;
28 
29  // FIXME a prototype: final inplementaiton may differ
30  virtual void setHitCloner(TkCloner const*) = 0;
31 
32  // new interface return one trajectory: if fit fails trajectory is invalid...
33  virtual Trajectory fitOne(const Trajectory& traj, fitType type = standard) const = 0;
34  virtual Trajectory fitOne(const TrajectorySeed& seed,
35  const RecHitContainer& hits,
36  fitType typee = standard) const = 0;
37  virtual Trajectory fitOne(const TrajectorySeed& seed,
38  const RecHitContainer& hits,
39  const TrajectoryStateOnSurface& tsos,
40  fitType type = standard) const = 0;
41 
42  // backward compatible interface...
43  std::vector<Trajectory> fit(const Trajectory& traj, fitType type = standard) const {
44  return makeVect(fitOne(traj, type));
45  }
46 
47  std::vector<Trajectory> fit(const TrajectorySeed& seed, const RecHitContainer& hits, fitType type = standard) const {
48  return makeVect(fitOne(seed, hits, type));
49  }
50  std::vector<Trajectory> fit(const TrajectorySeed& seed,
51  const RecHitContainer& hits,
52  const TrajectoryStateOnSurface& tsos,
53  fitType type = standard) const {
54  return makeVect(fitOne(seed, hits, tsos, type));
55  }
56 
57 private:
58  static std::vector<Trajectory> makeVect(Trajectory&& outTraj) {
59  if (outTraj.isValid())
60  return std::vector<Trajectory>(1, outTraj);
61  return std::vector<Trajectory>();
62  }
63 };
64 
65 #endif
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, const TrajectoryStateOnSurface &tsos, fitType type=standard) const
Definition: looper.py:1
virtual void setHitCloner(TkCloner const *)=0
virtual ~TrajectoryFitter()
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
static std::vector< Trajectory > makeVect(Trajectory &&outTraj)
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:42
TrajectoryFitterRecord Record
Trajectory::RecHitContainer RecHitContainer
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, fitType type=standard) const
virtual std::unique_ptr< TrajectoryFitter > clone() const =0