Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:08

0001 #ifndef RecoBTag_GhostTrackFitter_h
0002 #define RecoBTag_GhostTrackFitter_h
0003 
0004 #include <memory>
0005 #include <vector>
0006 
0007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0008 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0009 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
0010 
0011 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0012 
0013 #include "RecoVertex/GhostTrackFitter/interface/GhostTrack.h"
0014 #include "RecoVertex/GhostTrackFitter/interface/GhostTrackState.h"
0015 #include "RecoVertex/GhostTrackFitter/interface/GhostTrackPrediction.h"
0016 
0017 namespace reco {
0018 
0019   class GhostTrackFitter {
0020   public:
0021     GhostTrackFitter();
0022     virtual ~GhostTrackFitter();
0023 
0024     GhostTrack fit(const GlobalPoint &priorPosition,
0025                    const GlobalError &priorError,
0026                    const GlobalVector &direction,
0027                    double coneRadius,
0028                    const std::vector<TransientTrack> &tracks) const;
0029 
0030     GhostTrack fit(const GlobalPoint &priorPosition,
0031                    const GlobalError &priorError,
0032                    const GlobalVector &direction,
0033                    const GlobalError &directionError,
0034                    const std::vector<TransientTrack> &tracks) const;
0035 
0036     GhostTrack fit(const GhostTrackPrediction &prior,
0037                    const GlobalPoint &origin,
0038                    const std::vector<TransientTrack> &tracks) const;
0039 
0040     GhostTrack fit(const GhostTrackPrediction &prior, const std::vector<TransientTrack> &tracks) const;
0041 
0042     class PredictionUpdater {
0043     public:
0044       virtual ~PredictionUpdater() {}
0045 
0046       virtual PredictionUpdater *clone() const = 0;
0047 
0048       virtual GhostTrackPrediction update(const GhostTrackPrediction &pred,
0049                                           const GhostTrackState &state,
0050                                           double &ndof,
0051                                           double &chi2) const = 0;
0052 
0053       virtual void contribution(const GhostTrackPrediction &pred,
0054                                 const GhostTrackState &state,
0055                                 double &ndof,
0056                                 double &chi2,
0057                                 bool withPredError = false) const = 0;
0058     };
0059 
0060     class FitterImpl {
0061     public:
0062       virtual ~FitterImpl() {}
0063 
0064       virtual FitterImpl *clone() const = 0;
0065 
0066       virtual GhostTrackPrediction fit(const PredictionUpdater &updater,
0067                                        const GhostTrackPrediction &pred,
0068                                        std::vector<GhostTrackState> &states,
0069                                        double &ndof,
0070                                        double &chi2) = 0;
0071     };
0072 
0073     void setFitterImpl(const FitterImpl &fitterImpl) { fitter.reset(fitterImpl.clone()); }
0074 
0075   protected:
0076     GhostTrack fit(FitterImpl &fitterImpl,
0077                    const GhostTrackPrediction &prior,
0078                    const std::vector<GhostTrackState> &states) const;
0079 
0080   private:
0081     std::unique_ptr<FitterImpl> fitter;
0082     std::unique_ptr<PredictionUpdater> updater;
0083   };
0084 
0085 }  // namespace reco
0086 #endif  // RecoBTag_GhostTrackFitter_h