Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MultiTrackMassKinematicConstraint_H
0002 #define MultiTrackMassKinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/MultiTrackKinematicConstraint.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicState.h"
0006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0007 #include "RecoVertex/KinematicFitPrimitives/interface/ParticleMass.h"
0008 
0009 /**
0010  * Constraint to force some of the particles in the fit to have a certain invariant mass.
0011  */
0012 
0013 class MultiTrackMassKinematicConstraint : public MultiTrackKinematicConstraint {
0014 public:
0015   /**
0016    * Constructor
0017    * \param theMass the mass to constrain the states
0018    * \param nbrParticles the number of particles to use (in case more than that number are present
0019    * in the fit, the first will be used)
0020    */
0021   MultiTrackMassKinematicConstraint(const ParticleMass& theMass, const unsigned int nbrParticles)
0022       : mass(theMass), nPart(nbrParticles) {}
0023 
0024   /**
0025    * Returns a vector of values of constraint
0026    * equations at the point where the input
0027    * particles are defined.
0028    */
0029   AlgebraicVector value(const std::vector<KinematicState>& states, const GlobalPoint& point) const override;
0030 
0031   /**
0032    * Returns a matrix of derivatives of
0033    * constraint equations w.r.t.
0034    * particle parameters
0035    */
0036   AlgebraicMatrix parametersDerivative(const std::vector<KinematicState>& states,
0037                                        const GlobalPoint& point) const override;
0038 
0039   /**
0040    * Returns a matrix of derivatives of
0041    * constraint equations w.r.t.
0042    * vertex position
0043    */
0044   AlgebraicMatrix positionDerivative(const std::vector<KinematicState>& states,
0045                                      const GlobalPoint& point) const override;
0046 
0047   /**
0048    * Number of equations per track used for the fit
0049    */
0050   int numberOfEquations() const override { return 1; }
0051 
0052   MultiTrackMassKinematicConstraint* clone() const override { return new MultiTrackMassKinematicConstraint(*this); }
0053 
0054 private:
0055   const ParticleMass mass;
0056   const unsigned int nPart;
0057 };
0058 #endif