CMS 3D CMS Logo

TAbsFitParticle.h
Go to the documentation of this file.
1 #ifndef TAbsFitParticle_hh
2 #define TAbsFitParticle_hh
3 
4 #include "TMatrixD.h"
5 #include "TLorentzVector.h"
6 #include "TVector3.h"
7 #include "TNamed.h"
8 
9 class TAbsFitParticle : public TNamed {
10 public:
12  TAbsFitParticle(const TString& name, const TString& title);
13  ~TAbsFitParticle() override;
14  virtual TAbsFitParticle* clone(const TString& newname = "") const = 0;
15 
16  // returns derivative dP/dy with P=(p,E) and y=(par1, par2, par3, ...)
17  // the free parameters of the fit. The columns of the matrix contain
18  // (dP/dpar1, dP/dpar2, ...).
19  virtual TMatrixD* getDerivative() = 0;
20 
21  virtual void applycorr(TMatrixD* corrMatrix);
22  virtual TMatrixD* transform(const TLorentzVector& vec) = 0;
23  virtual void setCovMatrix(const TMatrixD* theCovMatrix);
24  virtual const TMatrixD* getCovMatrix() const { return &_covMatrix; }
25  virtual void setCovMatrixFit(const TMatrixD* theCovMatrixFit);
26  virtual const TMatrixD* getCovMatrixFit() const { return &_covMatrixFit; }
27  virtual const TMatrixD* getCovMatrixDeltaY();
28  virtual const TMatrixD* getPull();
29 
30  Int_t getNPar() const { return _nPar; }
31  const TLorentzVector* getCurr4Vec() { return &_pcurr; }
32  const TLorentzVector* getIni4Vec() { return &_pini; }
33  virtual TLorentzVector* calc4Vec(const TMatrixD* params) = 0;
34  virtual void setIni4Vec(const TLorentzVector* pini) = 0;
35  const TMatrixD* getParIni() { return &_iniparameters; }
36  void setParIni(const TMatrixD* parini);
37  const TMatrixD* getParCurr() { return &_parameters; }
38  const TVector3* getu1() { return &_u1; }
39  const TVector3* getu2() { return &_u2; }
40  const TVector3* getu3() { return &_u3; }
41 
42  TString getInfoString();
43  virtual void print();
44  virtual void reset();
45 
46 protected:
47  void calcCovMatrixDeltaY();
48 
49  Int_t _nPar; // Number of free parameters
50  TVector3 _u1; // base vector 1
51  TVector3 _u2; // base vector 2
52  TVector3 _u3; // base vector 3
53 
54  TMatrixD _covMatrix; // covariance matrix
55  TMatrixD _covMatrixFit; // fitted covariance matrix
56  TMatrixD _covMatrixDeltaY; // V(deltaY) == V(y_meas) - V(y_fit)
57  TMatrixD _pull; // pull values for all parameters
58  TMatrixD _iniparameters; // initialized parameters (parameters values before the fit)
59  TMatrixD _parameters; // fitted parameters
60  TLorentzVector _pini; // measured 4vector
61  TLorentzVector _pcurr; // fitted 4vector
62 };
63 
64 #endif
TMatrixD _covMatrixFit
TString getInfoString()
virtual void setIni4Vec(const TLorentzVector *pini)=0
const TLorentzVector * getIni4Vec()
virtual void reset()
virtual const TMatrixD * getCovMatrixDeltaY()
~TAbsFitParticle() override
virtual TLorentzVector * calc4Vec(const TMatrixD *params)=0
const TVector3 * getu3()
virtual TMatrixD * transform(const TLorentzVector &vec)=0
TLorentzVector _pini
virtual TMatrixD * getDerivative()=0
virtual const TMatrixD * getCovMatrixFit() const
TMatrixD _parameters
TLorentzVector _pcurr
virtual void setCovMatrix(const TMatrixD *theCovMatrix)
const TVector3 * getu1()
virtual void applycorr(TMatrixD *corrMatrix)
TMatrixD _covMatrixDeltaY
virtual void print()
virtual const TMatrixD * getCovMatrix() const
const TVector3 * getu2()
const TMatrixD * getParIni()
const TLorentzVector * getCurr4Vec()
TMatrixD _iniparameters
void setParIni(const TMatrixD *parini)
virtual void setCovMatrixFit(const TMatrixD *theCovMatrixFit)
virtual const TMatrixD * getPull()
virtual TAbsFitParticle * clone(const TString &newname="") const =0
const TMatrixD * getParCurr()
Int_t getNPar() const