Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MomentumKinematicConstraint_H
0002 #define MomentumKinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicConstraint.h"
0005 
0006 /**
0007  * Class constraining total 3-momentum of the particle (p_x,p_y,p_z)
0008  * This constraint can not be implemented on multiple particles,
0009  * without fitting the vertex. Current version supports one state
0010  * refit only.
0011  *
0012  * Kirill Prokofiev, October 2003
0013  * MultiState version: July 2004
0014  */
0015 class MomentumKinematicConstraint : public KinematicConstraint {
0016 public:
0017   /**
0018  * Constructor with the 4-momentum vector as
0019  * an argument
0020  */
0021   MomentumKinematicConstraint(const AlgebraicVector& momentum, const AlgebraicVector& dev);
0022 
0023   /**
0024  * Vector of values and  matrix of derivatives
0025  * calculated at given expansion 7xNumberOfStates point
0026  */
0027   std::pair<AlgebraicVector, AlgebraicVector> value(const AlgebraicVector& exPoint) const override;
0028 
0029   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(const AlgebraicVector& exPoint) const override;
0030 
0031   /**
0032  * Vector of values and  matrix of derivatives calculated using current
0033  * state parameters as expansion point
0034  */
0035   std::pair<AlgebraicMatrix, AlgebraicVector> derivative(
0036       const std::vector<RefCountedKinematicParticle>& par) const override;
0037 
0038   std::pair<AlgebraicVector, AlgebraicVector> value(const std::vector<RefCountedKinematicParticle>& par) const override;
0039 
0040   AlgebraicVector deviations(int nStates) const override;
0041 
0042   /**
0043  * Returns number of constraint equations used  for fitting.
0044  * Method is relevant for proper NDF calculations.
0045  */
0046   int numberOfEquations() const override;
0047 
0048   MomentumKinematicConstraint* clone() const override { return new MomentumKinematicConstraint(*this); }
0049 
0050 private:
0051   AlgebraicVector mm;
0052   AlgebraicVector dd;
0053 };
0054 
0055 #endif