Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef SmartPointingConstraint_H
0002 #define SmartPointingConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicConstraint.h"
0005 
0006 /**
0007  *  Topological constraint making a momentum vector to point to
0008  *  the given location in space.
0009  *  Example: if b-meson momentum is reconstructed at b-meson decay position
0010  *  (secondary vertex), making reconstructed momentum  pointing the the primary 
0011  *  vertex
0012  *
0013  * Multiple track refit is not supported in current version
0014  *
0015  *  Kirill Prokofiev, March 2004
0016  *  MultiState version: July 2004
0017  */
0018 
0019 class SmartPointingConstraint : public KinematicConstraint {
0020 public:
0021   SmartPointingConstraint(const GlobalPoint& ref) : refPoint(ref) {}
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
0044  * for fitting. Method is relevant for proper NDF
0045  * calculations.
0046  */
0047   int numberOfEquations() const override;
0048 
0049   SmartPointingConstraint* clone() const override { return new SmartPointingConstraint(*this); }
0050 
0051 private:
0052   std::pair<AlgebraicVector, AlgebraicVector> makeValue(const AlgebraicVector& exPoint) const;
0053   std::pair<AlgebraicMatrix, AlgebraicVector> makeDerivative(const AlgebraicVector& exPoint) const;
0054 
0055   GlobalPoint refPoint;
0056 };
0057 
0058 #endif