Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:10

0001 #ifndef RecoBTag_TrackGhostTrackState_h
0002 #define RecoBTag_TrackGhostTrackState_h
0003 
0004 #include <utility>
0005 
0006 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0007 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0008 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
0009 
0010 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
0011 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0012 
0013 #include "RecoVertex/GhostTrackFitter/interface/BasicGhostTrackState.h"
0014 
0015 namespace reco {
0016 
0017   class GhostTrackPrediction;
0018 
0019   class TrackGhostTrackState : public BasicGhostTrackState {
0020   public:
0021     TrackGhostTrackState(const TransientTrack &track) : track_(track) {}
0022 
0023     const TransientTrack &track() const { return track_; }
0024     const TrajectoryStateOnSurface &tsos() const { return tsos_; }
0025 
0026     bool isValid() const override { return tsos_.isValid(); }
0027 
0028     GlobalPoint globalPosition() const override { return tsos_.globalPosition(); }
0029     GlobalError cartesianError() const override { return tsos_.cartesianError().position(); }
0030     CovarianceMatrix cartesianCovariance() const override {
0031       return tsos_.cartesianError().matrix().Sub<CovarianceMatrix>(0, 0);
0032     }
0033 
0034     void reset() override { tsos_ = TrajectoryStateOnSurface(); }
0035     bool linearize(const GhostTrackPrediction &pred, bool initial, double lambda) override;
0036     bool linearize(const GhostTrackPrediction &pred, double lambda) override;
0037 
0038     Vertex vertexStateOnGhostTrack(const GhostTrackPrediction &pred, bool withMeasurementError) const override;
0039     Vertex vertexStateOnMeasurement(const GhostTrackPrediction &pred, bool withGhostTrackError) const override;
0040 
0041   private:
0042     pointer clone() const override { return build<TrackGhostTrackState>(*this); }
0043 
0044     TrajectoryStateOnSurface tsos_;
0045     TransientTrack track_;
0046   };
0047 
0048 }  // namespace reco
0049 
0050 #endif  // RecoBTag_TrackGhostTrackState_h