Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef KinematicConstraint_H
0002 #define KinematicConstraint_H
0003 
0004 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicParticle.h"
0005 #include "RecoVertex/KinematicFitPrimitives/interface/RefCountedKinematicVertex.h"
0006 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0007 
0008 /**
0009  * Pure abstract base class to implement different types 
0010  * of constraints for single tracks.
0011  * Class caches the information about calculation of
0012  * of constraint equation derivatives and values at given
0013  * linearization 7-point (x,y,z,p_x,p_y,p_z,m)_0. Fitter
0014  * usually takes current parameters as the first step point
0015  * and the change it to the result of the first iteration.
0016  *
0017  * Kirill Prokofiev, December 2002
0018  * Change for multistate refit: July 2004
0019  */
0020 
0021 class KinematicConstraint {
0022 public:
0023   /**
0024  *  Default constructor and destructor
0025  */
0026 
0027   KinematicConstraint() {}
0028 
0029   virtual ~KinematicConstraint() {}
0030 
0031   /**
0032  * Methods returning the constraint derivative matrix and value.
0033  * The equation expansion is done at the 7-point specified by user:
0034  * (x,y,z,p_x,p_y,p_z,m)_0. In case of multiple state refit
0035  * vector should be of dimension 7xNumberOfStates
0036  */
0037 
0038   virtual std::pair<AlgebraicVector, AlgebraicVector> value(const AlgebraicVector& exPoint) const = 0;
0039 
0040   virtual std::pair<AlgebraicMatrix, AlgebraicVector> derivative(const AlgebraicVector& exPoint) const = 0;
0041 
0042   /**
0043  * Methods making value and derivative
0044  * matrix using current state parameters
0045  * as expansion 7-point. Constraint can be 
0046  * made equaly for single and multiple states
0047  */
0048   virtual std::pair<AlgebraicVector, AlgebraicVector> value(
0049       const std::vector<RefCountedKinematicParticle>& par) const = 0;
0050 
0051   virtual std::pair<AlgebraicMatrix, AlgebraicVector> derivative(
0052       const std::vector<RefCountedKinematicParticle>& par) const = 0;
0053 
0054   /**
0055  * Returns vector of sigma squared  associated to the KinematicParameters
0056  * of refitted particles 
0057  * Initial deviations are given by user for the constraining parameters
0058  * (mass, momentum components etc).
0059  * In case of multiple states exactly the same values are added to
0060  * every particle parameters
0061  */
0062   virtual AlgebraicVector deviations(int nStates) const = 0;
0063 
0064   /**
0065  * Returns an actual number of equations in 
0066  * particular constraint (corresponds to 
0067  * the number of strings in constraint derivative matrix,
0068  * for example)
0069  */
0070   virtual int numberOfEquations() const = 0;
0071 
0072   /**
0073  * Clone method
0074  */
0075   virtual KinematicConstraint* clone() const = 0;
0076 };
0077 
0078 #endif