Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:03:17

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