CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrajectoryFitter.h
Go to the documentation of this file.
1 #ifndef _TrajectoryFitter_H_
2 #define _TrajectoryFitter_H_
3 
6 
8 
9 class TrajectorySeed;
11 
17 
19 public:
20  enum fitType {standard=0, looper=1};
21 
24 
25  virtual ~TrajectoryFitter() {}
26  virtual TrajectoryFitter* clone() const = 0;
27 
28  // new interface return one trajectory: if fit fails trajectory is invalid...
29  virtual Trajectory fitOne(const Trajectory& traj, fitType type=standard) const=0;
30  virtual Trajectory fitOne(const TrajectorySeed& seed,
31  const RecHitContainer& hits, fitType typee=standard) const =0;
32  virtual Trajectory fitOne(const TrajectorySeed& seed,
33  const RecHitContainer& hits,
34  const TrajectoryStateOnSurface& tsos, fitType type=standard) const=0;
35 
36 
37  // backward compatible interface...
38  std::vector<Trajectory> fit(const Trajectory& traj, fitType type=standard) const {return makeVect(fitOne(traj,type));}
39 
40  std::vector<Trajectory> fit(const TrajectorySeed& seed,
41  const RecHitContainer& hits, fitType type=standard) const {return makeVect(fitOne(seed,hits,type));}
42  std::vector<Trajectory> fit(const TrajectorySeed& seed,
43  const RecHitContainer& hits,
44  const TrajectoryStateOnSurface& tsos,
45  fitType type=standard) const {return makeVect(fitOne(seed,hits,tsos,type));}
46 
47 private:
48 
49  static std::vector<Trajectory> makeVect(Trajectory && outTraj) {
50  if (outTraj.isValid()) return std::vector<Trajectory>(1,std::move(outTraj));
51  return std::vector<Trajectory>();
52  }
53 
54 };
55 
56 #endif
type
Definition: HCALResponse.h:21
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, const TrajectoryStateOnSurface &tsos, fitType type=standard) const
std::vector< Trajectory > fit(const TrajectorySeed &seed, const RecHitContainer &hits, fitType type=standard) const
virtual TrajectoryFitter * clone() 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:44
TrajectoryFitterRecord Record
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
Trajectory::RecHitContainer RecHitContainer