Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef KalmanVertexTrackUpdator_H
0002 #define KalmanVertexTrackUpdator_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/VertexTrackUpdator.h"
0005 #include "RecoVertex/VertexPrimitives/interface/CachingVertex.h"
0006 #include "RecoVertex/VertexPrimitives/interface/VertexTrack.h"
0007 #include "RecoVertex/VertexTools/interface/VertexTrackFactory.h"
0008 #include "RecoVertex/KalmanVertexFit/interface/KVFHelper.h"
0009 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexUpdator.h"
0010 
0011 /** \class KalmanVertexTrackUpdator
0012  *  Performs the refit of the tracks with the vertex constraint, 
0013  *  using the Kalman filter algorithms.
0014  */
0015 
0016 template <unsigned int N>
0017 class KalmanVertexTrackUpdator : public VertexTrackUpdator<N> {
0018 public:
0019   typedef typename CachingVertex<N>::RefCountedVertexTrack RefCountedVertexTrack;
0020   typedef typename VertexTrack<N>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;
0021   typedef typename VertexTrack<N>::RefCountedRefittedTrackState RefCountedRefittedTrackState;
0022 
0023   /**
0024    *  Default constructor
0025    */
0026 
0027   KalmanVertexTrackUpdator() {}
0028 
0029   ~KalmanVertexTrackUpdator() override {}
0030 
0031   /**
0032    *   Refit of the track with the vertex constraint.
0033    *   \param vertex The vertex which has to be used as constraint.
0034    *   \param track  The track to refit.
0035    *   \return  The VertexTrack containing the refitted track and 
0036    *        the track-to-vertex covariance.
0037    */
0038 
0039   RefCountedVertexTrack update(const CachingVertex<N>& vertex, RefCountedVertexTrack track) const override;
0040 
0041   /**
0042    *  Clone method
0043    */
0044 
0045   KalmanVertexTrackUpdator<N>* clone() const override { return new KalmanVertexTrackUpdator(*this); }
0046 
0047   typedef ROOT::Math::SMatrix<double, 3, N - 2, ROOT::Math::MatRepStd<double, 3, N - 2> > AlgebraicMatrix3M;
0048   typedef ROOT::Math::SMatrix<double, N + 1, N + 1, ROOT::Math::MatRepSym<double, N + 1> > AlgebraicSymMatrixOO;
0049   typedef std::pair<RefCountedRefittedTrackState, AlgebraicSymMatrixOO> trackMatrixPair;
0050 
0051   /**
0052    *   Refit of the track with the vertex constraint.
0053    *   \param vertex The vertex which has to be used as constraint.
0054    *   \param track  The track to refit.
0055    *   \return  The refitted state with the track-to-vertex covariance.
0056    */
0057 
0058   trackMatrixPair trackRefit(const VertexState& vertex,
0059                              RefCountedLinearizedTrackState linTrackState,
0060                              float weight) const;
0061 
0062 private:
0063   VertexTrackFactory<N> theVTFactory;
0064   KVFHelper<N> helper;
0065   KalmanVertexUpdator<N> updator;
0066 };
0067 
0068 #endif