Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:16

0001 #ifndef KinematicVertex_H
0002 #define KinematicVertex_H
0003 
0004 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0005 #include "RecoVertex/VertexPrimitives/interface/CachingVertex.h"
0006 #include "RecoVertex/VertexPrimitives/interface/VertexState.h"
0007 #include "DataFormats/VertexReco/interface/Vertex.h"
0008 class KinematicTree;
0009 
0010 /**
0011  * Class representing a Decay Vertex
0012  * Caches a vertex position, covariance
0013  * matrix, chi squared and number of
0014  * degrees of freedom. Class is usually
0015  * created by KinematicParticleVertexFitter
0016  *
0017  * Kirill Prokofiev, December 2002
0018  */
0019 
0020 class KinematicVertex : public ReferenceCounted {
0021 public:
0022   friend class KinematicTree;
0023 
0024   /**
0025  * Empty default constructor
0026  * for invalid vertices
0027  */
0028   KinematicVertex();
0029 
0030   /**
0031  * Constructor with vertex state, chi2 and ndf.
0032  * Previous state of the vertex pointer is set to 0.
0033  */
0034   KinematicVertex(const VertexState state, float totalChiSq, float degreesOfFr);
0035 
0036   /**
0037  * Constructor with previous (before constraint)
0038  * state of the vertex
0039  */
0040   KinematicVertex(const VertexState state,
0041                   const ReferenceCountingPointer<KinematicVertex> prVertex,
0042                   float totalChiSq,
0043                   float degreesOfFr);
0044 
0045   /**
0046  * Direct transformation from caching vertex
0047  */
0048   KinematicVertex(const CachingVertex<6>& vertex);
0049 
0050   ~KinematicVertex() override;
0051 
0052   /**
0053  * Comparison by contents operator
0054  * is _true_ if position AND
0055  * covariance match
0056  */
0057   bool operator==(const KinematicVertex& other) const;
0058 
0059   bool operator==(const ReferenceCountingPointer<KinematicVertex> other) const;
0060 
0061   /**
0062  * comparison by adress operator
0063  * Has NO physical meaning
0064  * To be used inside the graph only
0065  */
0066 
0067   bool operator<(const KinematicVertex& other) const;
0068   /**
0069  * Access methods
0070  */
0071 
0072   /**
0073  * Checking the validity of the vertex
0074  * Example: production vertex for the
0075  * first decayed particle or decay vertices
0076  * of final state particles can be invalid
0077  * since we don't know them.
0078  */
0079   bool vertexIsValid() const;
0080 
0081   /**
0082  * Returns the pointer to the kinematic
0083  * tree (if any) current vertex belongs to
0084  * returned in case of not any tree build yet
0085  */
0086   KinematicTree* correspondingTree() const;
0087 
0088   /**
0089  * Previous (before constraint) state of the vertex
0090  */
0091   ReferenceCountingPointer<KinematicVertex> vertexBeforeConstraint() const;
0092 
0093   VertexState vertexState() const;
0094 
0095   GlobalPoint position() const;
0096 
0097   GlobalError error() const;
0098 
0099   float chiSquared() const;
0100 
0101   float degreesOfFreedom() const;
0102 
0103   operator reco::Vertex();
0104 
0105 private:
0106   void setTreePointer(KinematicTree* tr) const;
0107 
0108   //kinematic tree this
0109   //vertex belongs to (can be 0)
0110   mutable KinematicTree* tree;
0111   mutable bool vl;
0112 
0113   VertexState theState;
0114   // GlobalPoint theVertexPosition;
0115   // GlobalError theVPositionError;
0116   float theChiSquared;
0117   float theNDF;
0118   mutable ReferenceCountingPointer<KinematicVertex> pVertex;
0119 };
0120 
0121 #endif