Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TAbsFitParticle_hh
0002 #define TAbsFitParticle_hh
0003 
0004 #include "TMatrixD.h"
0005 #include "TLorentzVector.h"
0006 #include "TVector3.h"
0007 #include "TNamed.h"
0008 
0009 class TAbsFitParticle : public TNamed {
0010 public:
0011   TAbsFitParticle();
0012   TAbsFitParticle(const TString& name, const TString& title);
0013   ~TAbsFitParticle() override;
0014   virtual TAbsFitParticle* clone(const TString& newname = "") const = 0;
0015 
0016   // returns derivative dP/dy with P=(p,E) and y=(par1, par2, par3, ...)
0017   // the free parameters of the fit. The columns of the matrix contain
0018   // (dP/dpar1, dP/dpar2, ...).
0019   virtual TMatrixD* getDerivative() = 0;
0020 
0021   virtual void applycorr(TMatrixD* corrMatrix);
0022   virtual TMatrixD* transform(const TLorentzVector& vec) = 0;
0023   virtual void setCovMatrix(const TMatrixD* theCovMatrix);
0024   virtual const TMatrixD* getCovMatrix() const { return &_covMatrix; }
0025   virtual void setCovMatrixFit(const TMatrixD* theCovMatrixFit);
0026   virtual const TMatrixD* getCovMatrixFit() const { return &_covMatrixFit; }
0027   virtual const TMatrixD* getCovMatrixDeltaY();
0028   virtual const TMatrixD* getPull();
0029 
0030   Int_t getNPar() const { return _nPar; }
0031   const TLorentzVector* getCurr4Vec() { return &_pcurr; }
0032   const TLorentzVector* getIni4Vec() { return &_pini; }
0033   virtual TLorentzVector* calc4Vec(const TMatrixD* params) = 0;
0034   virtual void setIni4Vec(const TLorentzVector* pini) = 0;
0035   const TMatrixD* getParIni() { return &_iniparameters; }
0036   void setParIni(const TMatrixD* parini);
0037   const TMatrixD* getParCurr() { return &_parameters; }
0038   const TVector3* getu1() { return &_u1; }
0039   const TVector3* getu2() { return &_u2; }
0040   const TVector3* getu3() { return &_u3; }
0041 
0042   TString getInfoString();
0043   virtual void print();
0044   virtual void reset();
0045 
0046 protected:
0047   void calcCovMatrixDeltaY();
0048 
0049   Int_t _nPar;   // Number of free parameters
0050   TVector3 _u1;  // base vector 1
0051   TVector3 _u2;  // base vector 2
0052   TVector3 _u3;  // base vector 3
0053 
0054   TMatrixD _covMatrix;        // covariance matrix
0055   TMatrixD _covMatrixFit;     // fitted covariance matrix
0056   TMatrixD _covMatrixDeltaY;  // V(deltaY) == V(y_meas) - V(y_fit)
0057   TMatrixD _pull;             // pull values for all parameters
0058   TMatrixD _iniparameters;    // initialized parameters (parameters values before the fit)
0059   TMatrixD _parameters;       // fitted parameters
0060   TLorentzVector _pini;       // measured 4vector
0061   TLorentzVector _pcurr;      // fitted 4vector
0062 };
0063 
0064 #endif