Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:35

0001 #ifndef TAbsFitConstraint_hh
0002 #define TAbsFitConstraint_hh
0003 
0004 #include <vector>
0005 #include "PhysicsTools/KinFitter/interface/TAbsFitParticle.h"
0006 #include "TMatrixD.h"
0007 #include "TNamed.h"
0008 #include "TString.h"
0009 
0010 class TAbsFitConstraint : public TNamed {
0011 public:
0012   TAbsFitConstraint();
0013   TAbsFitConstraint(const TString& name, const TString& title);
0014   ~TAbsFitConstraint() override;
0015 
0016   // returns derivative df/dP with P=(p,E) and f the constraint f=0.
0017   // The matrix contains one row (df/dp, df/dE).
0018   virtual TMatrixD* getDerivative(TAbsFitParticle* particle) = 0;
0019   virtual Double_t getInitValue() = 0;
0020   virtual Double_t getCurrentValue() = 0;
0021 
0022   // new ---  additional parameters
0023   Int_t getNPar() { return _nPar; }
0024 
0025   virtual TMatrixD* getDerivativeAlpha() { return nullptr; }
0026 
0027   virtual const TMatrixD* getCovMatrix() const { return &_covMatrix; }
0028   virtual void setCovMatrix(const TMatrixD* theCovMatrix);
0029 
0030   virtual const TMatrixD* getCovMatrixFit() const { return &_covMatrixFit; }
0031   virtual void setCovMatrixFit(const TMatrixD* theCovMatrixFit);
0032 
0033   virtual const TMatrixD* getCovMatrixDeltaAlpha();
0034 
0035   const TMatrixD* getParIni() { return &_iniparameters; }
0036   void setParIni(const TMatrixD* parini);
0037   virtual void applyDeltaAlpha(TMatrixD* corrMatrix);
0038   const TMatrixD* getParCurr() { return &_parameters; }
0039 
0040   virtual TString getInfoString();
0041   virtual void print();
0042   virtual void reset();
0043 
0044 protected:
0045   void calcCovMatrixDeltaAlpha();
0046 
0047   Int_t _nPar;
0048 
0049   TMatrixD _covMatrix;            // covariance matrix
0050   TMatrixD _covMatrixFit;         // fitted covariance matrix
0051   TMatrixD _covMatrixDeltaAlpha;  // V(deltaAlpha) == V(alpha_meas) - V(alpha_fit)
0052   TMatrixD _iniparameters;        // initialized parameters (parameters values before the fit)
0053   TMatrixD _parameters;           // fitted parameters
0054 };
0055 
0056 #endif