Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MassKinematicConstraint_H
0002 #define MassKinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicConstraint.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/ParticleMass.h"
0006 
0007 /**
0008  * Mass track constraint class. Provides a way to compute derivative
0009  * matrix and vector of values for mass constraint on the single trajectory.
0010  * This class does not have the multistate version, since vertex definition
0011  * needed to calculate a joint mass of several particles.
0012  * 
0013  * Kirill Prokofiev December 2002
0014  * Multitrack interface: July 2004
0015  */
0016 
0017 class MassKinematicConstraint : public KinematicConstraint {
0018 public:
0019   /**
0020  * Constructor with mass to be used as constraint value 
0021  */
0022   MassKinematicConstraint(const ParticleMass& m, const float sigma);
0023 
0024   /**
0025  * Vector of values and matrix of derivatives
0026  * calculated at given 7xNumberOfStates point
0027  */
0028   std::pair<AlgebraicVector, AlgebraicVector> value(const AlgebraicVector& exPoint) const override;
0029 
0030   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(const AlgebraicVector& exPoint) const override;
0031 
0032   /**
0033  * Vector of values and  matrix of derivatives calculated 
0034  * using current state parameters as expansion point
0035  */
0036   std::pair<AlgebraicVector, AlgebraicVector> value(const std::vector<RefCountedKinematicParticle>& par) const override;
0037 
0038   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(
0039       const std::vector<RefCountedKinematicParticle>& par) const override;
0040 
0041   /**
0042  * Returns number of constraint equations used
0043  * for fitting. Method is relevant for proper NDF
0044  * calculations.
0045  */
0046   int numberOfEquations() const override;
0047 
0048   AlgebraicVector deviations(int nStates) const override;
0049 
0050   MassKinematicConstraint* clone() const override { return new MassKinematicConstraint(*this); }
0051 
0052 private:
0053   ParticleMass mass;
0054   AlgebraicVector dd;
0055 };
0056 
0057 #endif