Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef KalmanVertexTrackCompatibilityEstimator_H
0002 #define KalmanVertexTrackCompatibilityEstimator_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/VertexTrackCompatibilityEstimator.h"
0005 //#include "TrackingTools/PatternTools/interface/TSCPBuilderNoMaterial.h"
0006 #include "RecoVertex/VertexPrimitives/interface/VertexTrack.h"
0007 #include "RecoVertex/VertexPrimitives/interface/CachingVertex.h"
0008 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexUpdator.h"
0009 #include "RecoVertex/KalmanVertexFit/interface/KalmanVertexTrackUpdator.h"
0010 #include "RecoVertex/VertexTools/interface/VertexTrackFactory.h"
0011 #include "RecoVertex/KalmanVertexFit/interface/KVFHelper.h"
0012 
0013 /**
0014    * Calculates the compatiblity of a track with respect to a vertex 
0015    * using the Kalman filter algorithms. 
0016    * The compatibility is computed from the squared standardized residuals 
0017    * between the track and the vertex. 
0018    * If track and vertex errors are Gaussian and correct, 
0019    * this quantity is distributed as chi**2(ndf=2)). 
0020    * Can be used to identify outlying tracks.
0021    */
0022 
0023 template <unsigned int N>
0024 class KalmanVertexTrackCompatibilityEstimator : public VertexTrackCompatibilityEstimator<N> {
0025 public:
0026   typedef typename CachingVertex<N>::RefCountedVertexTrack RefCountedVertexTrack;
0027   typedef typename VertexTrack<N>::RefCountedLinearizedTrackState RefCountedLinearizedTrackState;
0028   typedef typename VertexTrack<N>::RefCountedRefittedTrackState RefCountedRefittedTrackState;
0029   typedef typename std::pair<bool, double> BDpair;
0030 
0031   KalmanVertexTrackCompatibilityEstimator() {}
0032 
0033   ~KalmanVertexTrackCompatibilityEstimator() override {}
0034 
0035   /**
0036    * Track-to-vertex compatibility. 
0037    * The track weight is taken into account.
0038    * \param track The track for which the chi**2 has to be estimated.
0039    * \param v The vertex against which the chi**2 has to be estimated.
0040    * \return The chi**2.
0041    */
0042 
0043   BDpair estimate(const CachingVertex<N>& vrt,
0044                   const RefCountedVertexTrack track,
0045                   unsigned int hint = UINT_MAX) const override;
0046 
0047   BDpair estimate(const CachingVertex<N>& v,
0048                   const RefCountedLinearizedTrackState track,
0049                   unsigned int hint = UINT_MAX) const override;
0050 
0051   BDpair estimate(const reco::Vertex& vertex, const reco::TransientTrack& track) const override;
0052 
0053   KalmanVertexTrackCompatibilityEstimator<N>* clone() const override {
0054     return new KalmanVertexTrackCompatibilityEstimator(*this);
0055   }
0056 
0057 private:
0058   BDpair estimateFittedTrack(const CachingVertex<N>& v, const RefCountedVertexTrack track) const;
0059   BDpair estimateNFittedTrack(const CachingVertex<N>& v, const RefCountedVertexTrack track) const;
0060   BDpair estimateDifference(const CachingVertex<N>& more,
0061                             const CachingVertex<N>& less,
0062                             const RefCountedVertexTrack track) const;
0063   KalmanVertexUpdator<N> updator;
0064   KalmanVertexTrackUpdator<N> trackUpdator;
0065   VertexTrackFactory<N> vTrackFactory;
0066   KVFHelper<N> helper;
0067 };
0068 
0069 #endif