Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef BasicSingleVertexState_H
0002 #define BasicSingleVertexState_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/BasicVertexState.h"
0005 
0006 //#include "CommonReco/CommonVertex/interface/RefCountedVertexSeed.h"
0007 
0008 /** Single state measurement of a vertex.
0009  * Some data is calculated on demand to improve performance.
0010  */
0011 
0012 class BasicSingleVertexState final : public BasicVertexState {
0013 public:
0014   /** Constructors
0015    */
0016   BasicSingleVertexState();
0017   BasicSingleVertexState(const GlobalPoint& pos, const GlobalError& posErr, const double& weightInMix = 1.0);
0018   BasicSingleVertexState(const GlobalPoint& pos, const GlobalWeight& posWeight, const double& weightInMix = 1.0);
0019   BasicSingleVertexState(const AlgebraicVector3& weightTimesPosition,
0020                          const GlobalWeight& posWeight,
0021                          const double& weightInMix = 1.0);
0022 
0023   // constructors with time (ignores off-diagonals in fit)
0024   BasicSingleVertexState(const GlobalPoint& pos,
0025                          const GlobalError& posErr,
0026                          const double time,
0027                          const double timeError,
0028                          const double& weightInMix = 1.0);
0029   BasicSingleVertexState(const GlobalPoint& pos,
0030                          const GlobalWeight& posWeight,
0031                          const double time,
0032                          const double timeWeight,
0033                          const double& weightInMix = 1.0);
0034   BasicSingleVertexState(const AlgebraicVector3& weightTimesPosition,
0035                          const GlobalWeight& posWeight,
0036                          const double weightTimesTime,
0037                          const double timeWeight,
0038                          const double& weightInMix = 1.0);
0039 
0040   // constructors with time, full cov
0041   BasicSingleVertexState(const GlobalPoint& pos,
0042                          const double time,
0043                          const GlobalError& posTimeErr,
0044                          const double& weightInMix = 1.0);
0045   BasicSingleVertexState(const GlobalPoint& pos,
0046                          const double time,
0047                          const GlobalWeight& posTimeWeight,
0048                          const double& weightInMix = 1.0);
0049   BasicSingleVertexState(const AlgebraicVector4& weightTimesPosition,
0050                          const GlobalWeight& posTimeWeight,
0051                          const double& weightInMix = 1.0);
0052 
0053   /** Access methods
0054    */
0055   pointer clone() const override { return build<BasicSingleVertexState>(*this); }
0056 
0057   GlobalPoint position() const override;
0058   GlobalError error() const override;
0059   GlobalError error4D() const override;
0060   double time() const override;
0061   double timeError() const override;
0062   GlobalWeight weight() const override;
0063   GlobalWeight weight4D() const override;
0064   AlgebraicVector3 weightTimesPosition() const override;
0065   AlgebraicVector4 weightTimesPosition4D() const override;
0066   double weightInMixture() const override;
0067 
0068   /**
0069    * The validity of the vertex
0070    */
0071   bool isValid() const override { return valid; }
0072   bool is4D() const override { return vertexIs4D; }
0073 
0074 private:
0075   void computePosition() const;
0076   void computeError() const;
0077   void computeWeight() const;
0078   void computeWeightTimesPos() const;
0079 
0080   mutable GlobalPoint thePos;
0081   mutable double theTime;
0082 
0083   mutable GlobalError theErr;
0084   mutable GlobalWeight theWeight;
0085 
0086   mutable AlgebraicVector4 theWeightTimesPos;
0087   double theWeightInMix;
0088 
0089   mutable bool thePosAvailable;
0090   mutable bool theTimeAvailable;
0091   mutable bool theErrAvailable;
0092   mutable bool theWeightAvailable;
0093   mutable bool theWeightTimesPosAvailable;
0094 
0095   bool valid;
0096   bool vertexIs4D;
0097 };
0098 
0099 #endif