Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef KalmanVertexUpdator_H
0002 #define KalmanVertexUpdator_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/VertexUpdator.h"
0005 #include "RecoVertex/KalmanVertexFit/interface/KVFHelper.h"
0006 
0007 /**
0008  *  Vertex updator for the Kalman vertex filter.
0009  *  (c.f. R. Fruewirth et.al., Comp.Phys.Comm 96 (1996) 189
0010  */
0011 
0012 template <unsigned int N>
0013 class KalmanVertexUpdator : public VertexUpdator<N> {
0014 public:
0015   typedef typename CachingVertex<N>::RefCountedVertexTrack RefCountedVertexTrack;
0016   typedef typename VertexTrack<N>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;
0017 
0018   /**
0019  *  Method to add a track to an existing CachingVertex
0020  * An invalid vertex is returned in case of problems during the update.
0021  */
0022 
0023   CachingVertex<N> add(const CachingVertex<N>& oldVertex, const RefCountedVertexTrack track) const override;
0024 
0025   /**
0026  *  Method removing already used VertexTrack from existing CachingVertex
0027  * An invalid vertex is returned in case of problems during the update.
0028  */
0029 
0030   CachingVertex<N> remove(const CachingVertex<N>& oldVertex, const RefCountedVertexTrack track) const override;
0031 
0032   /**
0033  * Clone method
0034  */
0035 
0036   VertexUpdator<N>* clone() const override { return new KalmanVertexUpdator(*this); }
0037 
0038   /**
0039      * The methode which actually does the vertex update.
0040      * An invalid vertex is returned in case of problems during the update.
0041      */
0042   CachingVertex<N> update(const CachingVertex<N>& oldVertex,
0043                           const RefCountedVertexTrack track,
0044                           float weight,
0045                           int sign) const;
0046 
0047   VertexState positionUpdate(const VertexState& oldVertex,
0048                              const RefCountedLinearizedTrackState linearizedTrack,
0049                              const float weight,
0050                              int sign) const;
0051 
0052   std::pair<bool, double> chi2Increment(const VertexState& oldVertex,
0053                                         const VertexState& newVertexState,
0054                                         const RefCountedLinearizedTrackState linearizedTrack,
0055                                         float weight) const;
0056 
0057 private:
0058   typedef ROOT::Math::SVector<double, N> AlgebraicVectorN;
0059   typedef ROOT::Math::SVector<double, N - 2> AlgebraicVectorM;
0060   typedef ROOT::Math::SMatrix<double, N, 3, ROOT::Math::MatRepStd<double, N, 3> > AlgebraicMatrixN3;
0061   typedef ROOT::Math::SMatrix<double, N, N - 2, ROOT::Math::MatRepStd<double, N, N - 2> > AlgebraicMatrixNM;
0062   typedef ROOT::Math::SMatrix<double, N - 2, 3, ROOT::Math::MatRepStd<double, N - 2, 3> > AlgebraicMatrixM3;
0063   typedef ROOT::Math::SMatrix<double, N, N, ROOT::Math::MatRepSym<double, N> > AlgebraicSymMatrixNN;
0064   typedef ROOT::Math::SMatrix<double, N + 1, N + 1, ROOT::Math::MatRepSym<double, N + 1> > AlgebraicSymMatrixOO;
0065   typedef ROOT::Math::SMatrix<double, N + 1, N + 1, ROOT::Math::MatRepStd<double, N + 1, N + 1> > AlgebraicMatrixOO;
0066   typedef ROOT::Math::SMatrix<double, N - 2, N - 2, ROOT::Math::MatRepSym<double, N - 2> > AlgebraicSymMatrixMM;
0067 
0068   KVFHelper<N> helper;
0069 };
0070 
0071 #endif