Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef ColinearityKinematicConstraint_H
0002 #define ColinearityKinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/MultiTrackKinematicConstraint.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicState.h"
0006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0007 
0008 /** 
0009  * Consstraint to force the two tracks to be colinear (parallel), in 2D (phi) or 3D (phi-theta).
0010  *
0011  * Warning: Since this constraint makes only sense with two tracks, two and only 
0012  * two tracks should be used in the fit.
0013  *
0014  */
0015 
0016 class ColinearityKinematicConstraint : public MultiTrackKinematicConstraint {
0017 public:
0018   enum ConstraintDim { Phi, PhiTheta };
0019 
0020   ColinearityKinematicConstraint(ConstraintDim dim = Phi);
0021 
0022   /**
0023  * Returns a vector of values of constraint
0024  * equations at the point where the input
0025  * particles are defined.
0026  */
0027   AlgebraicVector value(const std::vector<KinematicState>& states, const GlobalPoint& point) const override;
0028 
0029   /**
0030  * Returns a matrix of derivatives of
0031  * constraint equations w.r.t. 
0032  * particle parameters
0033  */
0034   AlgebraicMatrix parametersDerivative(const std::vector<KinematicState>& states,
0035                                        const GlobalPoint& point) const override;
0036 
0037   /**
0038  * Returns a matrix of derivatives of
0039  * constraint equations w.r.t. 
0040  * vertex position
0041  */
0042   AlgebraicMatrix positionDerivative(const std::vector<KinematicState>& states,
0043                                      const GlobalPoint& point) const override;
0044 
0045   /**
0046  * Number of equations per track used for the fit
0047  */
0048   int numberOfEquations() const override { return size; }
0049 
0050   ColinearityKinematicConstraint* clone() const override { return new ColinearityKinematicConstraint(*this); }
0051 
0052 private:
0053   ConstraintDim dimension;
0054   unsigned int size;
0055 };
0056 #endif