Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef VertexDistance_H
0002 #define VertexDistance_H
0003 
0004 #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h"
0005 #include "DataFormats/VertexReco/interface/Vertex.h"
0006 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
0007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0008 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
0009 
0010 /** \class VertexDistance
0011  *  Abstact class which defines a distance and compatibility between vertices.
0012  */
0013 
0014 class VertexState;
0015 
0016 class VertexDistance {
0017 public:
0018   virtual ~VertexDistance() {}
0019 
0020   Measurement1D distance(const reco::Vertex &, const reco::Vertex &) const;
0021 
0022   Measurement1D distance(const VertexState &, const VertexState &) const;
0023 
0024   Measurement1D distance(const reco::Vertex &, const VertexState &) const;
0025 
0026   Measurement1D distance(const VertexState &, const reco::Vertex &) const;
0027 
0028   /**
0029    * The signed distance is computed using a vector
0030    * from the primary to the secondary vertex and
0031    * a given reference vector.
0032    * for the 2D case:
0033    *   The sign is determined by the scalar product of the x,y component of
0034    *   the vector connecting the vertices and the reference vector:
0035    *   if the scalar product is greater than zero, the sign is +1, else -1
0036    *
0037    * for the 3D case:
0038    *   Follows same approach, using all three components of the two vectors
0039    */
0040   virtual Measurement1D signedDistance(const reco::Vertex &primVtx,
0041                                        const reco::Vertex &secVtx,
0042                                        const GlobalVector &momentum) const = 0;
0043 
0044   virtual float compatibility(const reco::Vertex &, const reco::Vertex &) const;
0045 
0046   virtual float compatibility(const VertexState &, const VertexState &) const;
0047 
0048   virtual float compatibility(const reco::Vertex &, const VertexState &) const;
0049 
0050   virtual float compatibility(const VertexState &, const reco::Vertex &) const;
0051 
0052   virtual VertexDistance *clone() const = 0;
0053 
0054 protected:
0055   virtual Measurement1D distance(const GlobalPoint &vtx1Position,
0056                                  const GlobalError &vtx1PositionError,
0057                                  const GlobalPoint &vtx2Position,
0058                                  const GlobalError &vtx2PositionError) const = 0;
0059 
0060   virtual float compatibility(const GlobalPoint &vtx1Position,
0061                               const GlobalError &vtx1PositionError,
0062                               const GlobalPoint &vtx2Position,
0063                               const GlobalError &vtx2PositionError) const = 0;
0064 };
0065 #endif  //  Tracker_VertexDistance_H