CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/PhysicsTools/KinFitter/interface/TAbsFitParticle.h

Go to the documentation of this file.
00001 #ifndef TAbsFitParticle_hh
00002 #define TAbsFitParticle_hh
00003 
00004 #include "TMatrixD.h"
00005 #include "TLorentzVector.h"
00006 #include "TVector3.h"
00007 #include "TNamed.h"
00008 
00009 class TAbsFitParticle : public TNamed {
00010 
00011 public :
00012 
00013   TAbsFitParticle();
00014   TAbsFitParticle(const TString &name, const TString &title);
00015   virtual ~TAbsFitParticle();
00016   virtual TAbsFitParticle* clone( TString newname = "" ) const = 0;
00017 
00018   // returns derivative dP/dy with P=(p,E) and y=(par1, par2, par3, ...) 
00019   // the free parameters of the fit. The columns of the matrix contain 
00020   // (dP/dpar1, dP/dpar2, ...).
00021   virtual TMatrixD* getDerivative() = 0;
00022 
00023   virtual void applycorr(TMatrixD* corrMatrix);
00024   virtual TMatrixD* transform(const TLorentzVector& vec) = 0;
00025   virtual void setCovMatrix(const TMatrixD* theCovMatrix);
00026   virtual const TMatrixD* getCovMatrix() const { return &_covMatrix; }
00027   virtual void setCovMatrixFit(const TMatrixD* theCovMatrixFit);
00028   virtual const TMatrixD* getCovMatrixFit() const { return &_covMatrixFit; }
00029   virtual const TMatrixD* getCovMatrixDeltaY();  
00030   virtual const TMatrixD* getPull();
00031 
00032   Int_t getNPar() const { return _nPar; }
00033   const TLorentzVector* getCurr4Vec() { return &_pcurr; }
00034   const TLorentzVector* getIni4Vec() { return &_pini; }
00035   virtual TLorentzVector* calc4Vec( const TMatrixD* params ) = 0;
00036   virtual void setIni4Vec(const TLorentzVector* pini) = 0;
00037   const TMatrixD* getParIni() { return &_iniparameters; }
00038   void  setParIni(const TMatrixD* parini);
00039   const TMatrixD* getParCurr(){ return &_parameters; }
00040   const TVector3* getu1()    { return &_u1; }
00041   const TVector3* getu2(){ return &_u2; }
00042   const TVector3* getu3()  { return &_u3; }
00043 
00044   TString getInfoString();
00045   virtual void print(); 
00046   virtual void reset();
00047 
00048 protected :
00049 
00050   void calcCovMatrixDeltaY();
00051 
00052   Int_t _nPar;        // Number of free parameters
00053   TVector3 _u1;       // base vector 1
00054   TVector3 _u2;       // base vector 2
00055   TVector3 _u3;       // base vector 3
00056 
00057   TMatrixD _covMatrix;      // covariance matrix
00058   TMatrixD _covMatrixFit;   // fitted covariance matrix
00059   TMatrixD _covMatrixDeltaY;  // V(deltaY) == V(y_meas) - V(y_fit)
00060   TMatrixD _pull;           // pull values for all parameters
00061   TMatrixD _iniparameters;  // initialized parameters (parameters values before the fit)
00062   TMatrixD _parameters;     // fitted parameters
00063   TLorentzVector _pini;     // measured 4vector
00064   TLorentzVector _pcurr;    // fitted 4vector
00065   
00066 };
00067 
00068 #endif