Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef BasicMultiVertexState_H
0002 #define BasicMultiVertexState_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/BasicVertexState.h"
0005 #include "RecoVertex/VertexPrimitives/interface/VertexState.h"
0006 #include "RecoVertex/GaussianSumVertexFit/interface/MultiVertexStateCombiner.h"
0007 
0008 /** Multi state measurement of a vertex.
0009  * Some data is calculated on demand to improve performance.
0010  */
0011 
0012 class BasicMultiVertexState final : public BasicVertexState {
0013 public:
0014   /** Constructors
0015    */
0016   BasicMultiVertexState() : valid(false) {}
0017 
0018   BasicMultiVertexState(const std::vector<VertexState>& vsComp);
0019 
0020   /** Access methods
0021    */
0022   pointer clone() const override { return build<BasicMultiVertexState>(*this); }
0023 
0024   /**
0025    * Mean position of the mixture (position of the collapsed state)
0026    */
0027   GlobalPoint position() const override;
0028 
0029   /**
0030    * Mean time of the mixture (time of the collapsed state)
0031    */
0032   double time() const override;
0033 
0034   /**
0035    * Mean covariance matrix of the mixture
0036    * (covariance matrix of the collapsed state)
0037    */
0038   GlobalError error() const override;
0039 
0040   /**
0041    * Mean covariance matrix of the mixture
0042    * (covariance matrix of the collapsed state)
0043    */
0044   double timeError() const override;
0045 
0046   /**
0047    * Mean covariance matrix of the mixture
0048    * (covariance matrix of the collapsed state)
0049    */
0050   GlobalError error4D() const override;
0051 
0052   /**
0053    * Mean weight matrix (inverse of covariance) of the mixture
0054    * ( weight matrix of the collapsed state)
0055    */
0056   GlobalWeight weight() const override;
0057 
0058   /**
0059    * Mean weight matrix (inverse of covariance) of the mixture
0060    * ( weight matrix of the collapsed state)
0061    */
0062   GlobalWeight weight4D() const override;
0063 
0064   /**
0065    * Mean (weight*position) matrix of the mixture
0066    */
0067   AlgebraicVector3 weightTimesPosition() const override;
0068 
0069   /**
0070    * Mean (weight*position) matrix of the mixture
0071    */
0072   AlgebraicVector4 weightTimesPosition4D() const override;
0073 
0074   /**
0075    * The weight of this state. It will be the sum of the weights of the
0076    * individual components in the mixture.
0077    */
0078   double weightInMixture() const override;
0079 
0080   /**
0081    * Vector of individual components in the mixture.
0082    */
0083   std::vector<VertexState> components() const override { return theComponents; }
0084 
0085   /**
0086    * The validity of the vertex
0087    */
0088   bool isValid() const override { return valid; }
0089 
0090   bool is4D() const override {
0091     checkCombinedState();
0092     return theCombinedState.is4D();
0093   }
0094 
0095 private:
0096   void checkCombinedState() const;
0097 
0098   bool valid;
0099   mutable std::vector<VertexState> theComponents;
0100   mutable VertexState theCombinedState;
0101   mutable bool theCombinedStateUp2Date;
0102 
0103   MultiVertexStateCombiner theCombiner;
0104 };
0105 
0106 #endif