Go to the documentation of this file.00001 #ifndef RecoBTag_GhostTrackFitter_h
00002 #define RecoBTag_GhostTrackFitter_h
00003
00004 #include <memory>
00005 #include <vector>
00006
00007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00008 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00009 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
00010
00011 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00012
00013 #include "RecoVertex/GhostTrackFitter/interface/GhostTrack.h"
00014 #include "RecoVertex/GhostTrackFitter/interface/GhostTrackState.h"
00015 #include "RecoVertex/GhostTrackFitter/interface/GhostTrackPrediction.h"
00016
00017 namespace reco {
00018
00019 class GhostTrackFitter {
00020 public:
00021 GhostTrackFitter();
00022 virtual ~GhostTrackFitter();
00023
00024 GhostTrack fit(const GlobalPoint &priorPosition,
00025 const GlobalError &priorError,
00026 const GlobalVector &direction,
00027 double coneRadius,
00028 const std::vector<TransientTrack> &tracks) const;
00029
00030 GhostTrack fit(const GlobalPoint &priorPosition,
00031 const GlobalError &priorError,
00032 const GlobalVector &direction,
00033 const GlobalError &directionError,
00034 const std::vector<TransientTrack> &tracks) const;
00035
00036 GhostTrack fit(const GhostTrackPrediction &prior,
00037 const GlobalPoint &origin,
00038 const std::vector<TransientTrack> &tracks) const;
00039
00040 GhostTrack fit(const GhostTrackPrediction &prior,
00041 const std::vector<TransientTrack> &tracks) const;
00042
00043 class PredictionUpdater {
00044 public:
00045 virtual ~PredictionUpdater() {}
00046
00047 virtual PredictionUpdater *clone() const = 0;
00048
00049 virtual GhostTrackPrediction update(
00050 const GhostTrackPrediction &pred,
00051 const GhostTrackState &state,
00052 double &ndof, double &chi2) const = 0;
00053
00054 virtual void contribution(
00055 const GhostTrackPrediction &pred,
00056 const GhostTrackState &state,
00057 double &ndof, double &chi2,
00058 bool withPredError = false) const = 0;
00059 };
00060
00061 class FitterImpl {
00062 public:
00063 virtual ~FitterImpl() {}
00064
00065 virtual FitterImpl *clone() const = 0;
00066
00067 virtual GhostTrackPrediction fit(
00068 const PredictionUpdater &updater,
00069 const GhostTrackPrediction &pred,
00070 std::vector<GhostTrackState> &states,
00071 double &ndof, double &chi2) = 0;
00072 };
00073
00074 void setFitterImpl(const FitterImpl &fitterImpl)
00075 { fitter.reset(fitterImpl.clone()); }
00076
00077 protected:
00078 GhostTrack fit(FitterImpl &fitterImpl,
00079 const GhostTrackPrediction &prior,
00080 const std::vector<GhostTrackState> &states) const;
00081
00082 private:
00083 std::auto_ptr<FitterImpl> fitter;
00084 std::auto_ptr<PredictionUpdater> updater;
00085 };
00086
00087 }
00088 #endif // RecoBTag_GhostTrackFitter_h