Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FourMomentumKinematicConstraint_H
0002 #define FourMomentumKinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicConstraint.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/ParticleMass.h"
0006 
0007 /**
0008  * 4-Momentum track constraint class provides a way to compute the
0009  * matrix of derivatives and the vector of values for 4-Momentum
0010  * constraint on for given KinematicParticle. Current version does
0011  * not allow working with multiple tracks
0012  * 
0013  * Kirill Prokofiev March 2003
0014  * MultiState version: July 2004
0015  */
0016 
0017 class FourMomentumKinematicConstraint : public KinematicConstraint {
0018 public:
0019   /**
0020  * Constructor with desired 4-momentum vector  and 
0021  * vector of deviations to be used forcovariance matrix as
0022  * arguments
0023  */
0024   FourMomentumKinematicConstraint(const AlgebraicVector& momentum, const AlgebraicVector& deviation);
0025 
0026   /**
0027  * Vector of values and  matrix of derivatives
0028  * calculated at given  7*NumberOfStates expansion point
0029  */
0030   std::pair<AlgebraicVector, AlgebraicVector> value(const AlgebraicVector& exPoint) const override;
0031 
0032   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(const AlgebraicVector& exPoint) const override;
0033 
0034   /**
0035  * Vector of values and matrix of derivatives calculated using 
0036  * current state as an expansion point
0037  */
0038   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(
0039       const std::vector<RefCountedKinematicParticle>& par) const override;
0040 
0041   std::pair<AlgebraicVector, AlgebraicVector> value(const std::vector<RefCountedKinematicParticle>& par) const override;
0042 
0043   /**
0044  * Returns number of constraint equations used for fitting. Method is relevant for proper NDF
0045  * calculations.
0046  */
0047   int numberOfEquations() const override;
0048 
0049   AlgebraicVector deviations(int nStates) const override;
0050 
0051   FourMomentumKinematicConstraint* clone() const override { return new FourMomentumKinematicConstraint(*this); }
0052 
0053 private:
0054   AlgebraicVector mm;
0055   AlgebraicVector dd;
0056 };
0057 #endif