Belle II Software  release-08-01-10
PxPyPzMFitObject Class Reference
Inheritance diagram for PxPyPzMFitObject:
Collaboration diagram for PxPyPzMFitObject:

Public Member Functions

 PxPyPzMFitObject (CLHEP::HepLorentzVector &particle, const CLHEP::HepSymMatrix &covmatrix)
 
 PxPyPzMFitObject (const PxPyPzMFitObject &rhs)
 
PxPyPzMFitObjectoperator= (const PxPyPzMFitObject &rhs)
 
virtual PxPyPzMFitObjectcopy () const override
 Return a new copy of itself.
 
virtual PxPyPzMFitObjectassign (const BaseFitObject &source) override
 Assign from anther object, if of same type. More...
 
virtual const char * getParamName (int ilocal) const override
 Get name of parameter ilocal. More...
 
virtual bool updateParams (double p[], int idim) override
 Read values from global vector, readjust vector; return: significant change. More...
 
virtual double getDPx (int ilocal) const override
 Return d p_x / d par_ilocal (derivative of px w.r.t. local parameter ilocal) More...
 
virtual double getDPy (int ilocal) const override
 Return d p_y / d par_ilocal (derivative of py w.r.t. local parameter ilocal) More...
 
virtual double getDPz (int ilocal) const override
 Return d p_z / d par_ilocal (derivative of pz w.r.t. local parameter ilocal) More...
 
virtual double getDE (int ilocal) const override
 Return d E / d par_ilocal (derivative of E w.r.t. local parameter ilocal) More...
 
virtual double getFirstDerivative_Meta_Local (int iMeta, int ilocal, int metaSet) const override
 
virtual double getSecondDerivative_Meta_Local (int iMeta, int ilocal, int jlocal, int metaSet) const override
 
virtual int getNPar () const override
 Get total number of parameters of this FitObject.
 
virtual bool setMass (double mass_)
 Set mass of particle; return=success.
 
virtual double getMass () const
 Get mass of particle.
 
virtual std::ostream & print4Vector (std::ostream &os) const
 print the four-momentum (E, px, py, pz) More...
 
virtual FourVector getFourMomentum () const
 
virtual double getE () const
 Return E.
 
virtual double getPx () const
 Return px.
 
virtual double getPy () const
 Return py.
 
virtual double getPz () const
 Return pz.
 
virtual double getP () const
 Return p (momentum)
 
virtual double getP2 () const
 Return p (momentum) squared.
 
virtual double getPt () const
 Return pt (transverse momentum)
 
virtual double getPt2 () const
 Return pt (transverse momentum) squared.
 
virtual void getDerivatives (double der[], int idim) const override
 
virtual void addToGlobalChi2DerMatrixNum (double *M, int idim, double eps)
 Add numerically determined derivatives of chi squared to global covariance matrix. More...
 
virtual void addToGlobalChi2DerVectorNum (double *y, int idim, double eps)
 Add numerically determined derivatives of chi squared to global derivative vector. More...
 
virtual std::ostream & print (std::ostream &os) const override
 print object to ostream More...
 
void test1stDerivatives ()
 
void test2ndDerivatives ()
 
double num1stDerivative (int ilocal, double eps)
 Evaluates numerically the 1st derivative of chi2 w.r.t. a parameter. More...
 
double num2ndDerivative (int ilocal1, double eps1, int ilocal2, double eps2)
 Evaluates numerically the 2nd derivative of chi2 w.r.t. 2 parameters. More...
 
virtual double getChi2 () const override
 Get chi squared from measured and fitted parameters.
 
virtual bool setParam (int ilocal, double par_, bool measured_, bool fixed_=false)
 Set value and measured flag of parameter i; return: significant change. More...
 
virtual bool setParam (int ilocal, double par_)
 Set value of parameter ilocal; return: significant change. More...
 
virtual bool setMParam (int ilocal, double mpar_)
 Set measured value of parameter ilocal; return: success. More...
 
virtual bool setError (int ilocal, double err_)
 Set error of parameter ilocal; return: success. More...
 
virtual bool setCov (int ilocal, int jlocal, double cov_)
 Set covariance of parameters ilocal and jlocal; return: success. More...
 
virtual bool setGlobalParNum (int ilocal, int iglobal)
 Set number of parameter ilocal in global list return true signals OK. More...
 
virtual bool fixParam (int ilocal, bool fix=true)
 Fix a parameter (fix=true), or release it (fix=false) More...
 
virtual bool releaseParam (int ilocal)
 Release a parameter. More...
 
virtual bool isParamFixed (int ilocal) const
 Returns whether parameter is fixed. More...
 
virtual double getParam (int ilocal) const
 Get current value of parameter ilocal. More...
 
virtual const char * getName () const
 Get object's name.
 
void setName (const char *name_)
 Set object's name.
 
virtual double getMParam (int ilocal) const
 Get measured value of parameter ilocal. More...
 
virtual double getError (int ilocal) const
 Get error of parameter ilocal. More...
 
virtual double getCov (int ilocal, int jlocal) const
 Get covariance between parameters ilocal and jlocal. More...
 
virtual double getRho (int ilocal, int jlocal) const
 Get correlation coefficient between parameters ilocal and jlocal. More...
 
virtual bool isParamMeasured (int ilocal) const
 Get measured flag for parameter ilocal. More...
 
virtual int getGlobalParNum (int ilocal) const
 Get global parameter number of parameter ilocal. More...
 
virtual int getNMeasured () const
 Get number of measured parameters of this FitObject.
 
virtual int getNUnmeasured () const
 Get number of unmeasured parameters of this FitObject.
 
virtual int getNFree () const
 Get number of free parameters of this FitObject.
 
virtual int getNFixed () const
 Get number of fixed parameters of this FitObject.
 
virtual double getDChi2DParam (int ilocal) const
 Get derivative of chi squared w.r.t. parameter ilocal. More...
 
virtual double getD2Chi2DParam2 (int ilocal, int jlocal) const
 Get second derivative of chi squared w.r.t. parameters ilocal1 and ilocal2. More...
 
virtual std::ostream & printParams (std::ostream &os) const
 print the parameters and errors More...
 
virtual std::ostream & printRhoValues (std::ostream &os) const
 print the correlation coefficients More...
 
virtual std::ostream & print1stDerivatives (std::ostream &os) const
 print the 1st derivatives wrt metaSet 0 (E, px, py, pz) More...
 
virtual std::ostream & print2ndDerivatives (std::ostream &os) const
 print the 2nd derivatives wrt metaSet 0 (E, px, py, pz) More...
 
void invalidateCache () const
 invalidate any cached quantities
 
virtual void addToGlobCov (double *glcov, int idim) const
 Add covariance matrix elements to global covariance matrix of size idim x idim. More...
 
virtual int addToGlobalChi2DerVector (double *y, int idim) const
 Add derivatives of chi squared to global derivative vector. More...
 
virtual void addToGlobalChi2DerVector (double *y, int idim, double lambda, double der[], int metaSet) const
 Add derivatives of momentum vector to global derivative vector. More...
 
virtual void addToGlobalChi2DerMatrix (double *M, int idim) const
 Add 2nd derivatives of chi squared to global derivative matrix. More...
 
virtual void addTo1stDerivatives (double M[], int idim, double der[], int kglobal, int metaSet) const
 
virtual void addTo2ndDerivatives (double der2[], int idim, double factor[], int metaSet) const
 
virtual void addTo2ndDerivatives (double M[], int idim, double lambda, double der[], int metaSet) const
 
virtual void initCov ()
 
virtual double getError2 (double der[], int metaset) const
 

Protected Types

enum  { NPAR = 3 }
 

Protected Member Functions

void updateCache () const override
 
virtual bool calculateCovInv () const
 Calculate the inverse of the covariance matrix.
 

Protected Attributes

bool cachevalid
 
double chi2
 
double dEdpx
 
double dEdpy
 
double dEdpz
 
double dE2dpxdpx
 
double dE2dpxdpy
 
double dE2dpxdpz
 
double dE2dpydpy
 
double dE2dpydpz
 
double dE2dpzdpz
 
double mass
 mass of particle
 
FourVector fourMomentum
 
double paramCycl [BaseDefs::MAXPAR]
 
char * name
 
double par [BaseDefs::MAXPAR]
 fit parameters
 
double mpar [BaseDefs::MAXPAR]
 measured parameters
 
bool measured [BaseDefs::MAXPAR]
 measured flag
 
bool fixed [BaseDefs::MAXPAR]
 fixed flag
 
int globalParNum [BaseDefs::MAXPAR]
 global parameter number for each parameter
 
double cov [BaseDefs::MAXPAR][BaseDefs::MAXPAR]
 local covariance matrix
 
double covinv [BaseDefs::MAXPAR][BaseDefs::MAXPAR]
 inverse pf local covariance matrix
 
bool covinvvalid
 flag for valid inverse covariance matrix
 

Static Protected Attributes

static const double eps2 = 0.0001
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const BaseFitObject &bfo)
 Prints out a BaseFitObject, using its print method. More...
 

Detailed Description

Definition at line 26 of file PxPyPzMFitObject.h.

Constructor & Destructor Documentation

◆ PxPyPzMFitObject()

Parameters
rhsright hand side

Definition at line 58 of file PxPyPzMFitObject.cc.

59  : ParticleFitObject(rhs), cachevalid(false), chi2(0), dEdpx(0), dEdpy(0), dEdpz(0),
60  dE2dpxdpx(0), dE2dpxdpy(0), dE2dpxdpz(0), dE2dpydpy(0), dE2dpydpz(0), dE2dpzdpz(0)
61  {
62 
64  }
virtual PxPyPzMFitObject & assign(const BaseFitObject &source) override
Assign from anther object, if of same type.

Member Function Documentation

◆ addToGlobalChi2DerMatrix()

void addToGlobalChi2DerMatrix ( double *  M,
int  idim 
) const
virtualinherited

Add 2nd derivatives of chi squared to global derivative matrix.

Parameters
MGlobal derivative matrix
idimFirst dimension of global derivative matrix

Definition at line 462 of file BaseFitObject.cc.

◆ addToGlobalChi2DerMatrixNum()

void addToGlobalChi2DerMatrixNum ( double *  M,
int  idim,
double  eps 
)
virtualinherited

Add numerically determined derivatives of chi squared to global covariance matrix.

Parameters
MGlobal covariance matrix
idimFirst dimension of global covariance matrix
epsParameter variation

Definition at line 162 of file ParticleFitObject.cc.

◆ addToGlobalChi2DerVector() [1/2]

int addToGlobalChi2DerVector ( double *  y,
int  idim 
) const
virtualinherited

Add derivatives of chi squared to global derivative vector.

Parameters
yVector of chi2 derivatives
idimVector size

Definition at line 482 of file BaseFitObject.cc.

◆ addToGlobalChi2DerVector() [2/2]

void addToGlobalChi2DerVector ( double *  y,
int  idim,
double  lambda,
double  der[],
int  metaSet 
) const
virtualinherited

Add derivatives of momentum vector to global derivative vector.

Parameters
yVector of chi2 derivatives
idimVector size
lambdaThe lambda value
derderivatives of constraint wrt intermediate variables (e.g. 4-vector with dg/dE, dg/dpx, dg/dpy, dg/dpz)
metaSetwhich set of intermediate variables

Definition at line 498 of file BaseFitObject.cc.

◆ addToGlobalChi2DerVectorNum()

void addToGlobalChi2DerVectorNum ( double *  y,
int  idim,
double  eps 
)
virtualinherited

Add numerically determined derivatives of chi squared to global derivative vector.

Parameters
yVector of chi2 derivatives
idimVector size
epsParameter variation

Definition at line 152 of file ParticleFitObject.cc.

◆ addToGlobCov()

void addToGlobCov ( double *  glcov,
int  idim 
) const
virtualinherited

Add covariance matrix elements to global covariance matrix of size idim x idim.

Parameters
glcovGlobal covariance matrix
idimFirst dimension of global derivative matrix

Definition at line 217 of file BaseFitObject.cc.

◆ assign()

PxPyPzMFitObject & assign ( const BaseFitObject source)
overridevirtual

Assign from anther object, if of same type.

Parameters
sourceThe source object

Reimplemented from ParticleFitObject.

Definition at line 79 of file PxPyPzMFitObject.cc.

◆ fixParam()

bool fixParam ( int  ilocal,
bool  fix = true 
)
virtualinherited

Fix a parameter (fix=true), or release it (fix=false)

Parameters
ilocalLocal parameter number
fixfix if true, release if false

Definition at line 352 of file BaseFitObject.cc.

◆ getCov()

double getCov ( int  ilocal,
int  jlocal 
) const
virtualinherited

Get covariance between parameters ilocal and jlocal.

Parameters
ilocalLocal parameter number i
jlocalLocal parameter number j

Reimplemented in JetFitObject.

Definition at line 389 of file BaseFitObject.cc.

◆ getD2Chi2DParam2()

double getD2Chi2DParam2 ( int  ilocal,
int  jlocal 
) const
virtualinherited

Get second derivative of chi squared w.r.t. parameters ilocal1 and ilocal2.

Parameters
ilocalLocal parameter number i
jlocalLocal parameter number j

Definition at line 449 of file BaseFitObject.cc.

◆ getDChi2DParam()

double getDChi2DParam ( int  ilocal) const
virtualinherited

Get derivative of chi squared w.r.t. parameter ilocal.

Parameters
ilocalLocal parameter number

Definition at line 435 of file BaseFitObject.cc.

◆ getDE()

double getDE ( int  ilocal) const
overridevirtual

Return d E / d par_ilocal (derivative of E w.r.t. local parameter ilocal)

Parameters
ilocalLocal parameter number

Implements ParticleFitObject.

Definition at line 170 of file PxPyPzMFitObject.cc.

◆ getDPx()

double getDPx ( int  ilocal) const
overridevirtual

Return d p_x / d par_ilocal (derivative of px w.r.t. local parameter ilocal)

Parameters
ilocalLocal parameter number

Implements ParticleFitObject.

Definition at line 133 of file PxPyPzMFitObject.cc.

◆ getDPy()

double getDPy ( int  ilocal) const
overridevirtual

Return d p_y / d par_ilocal (derivative of py w.r.t. local parameter ilocal)

Parameters
ilocalLocal parameter number

Implements ParticleFitObject.

Definition at line 145 of file PxPyPzMFitObject.cc.

◆ getDPz()

double getDPz ( int  ilocal) const
overridevirtual

Return d p_z / d par_ilocal (derivative of pz w.r.t. local parameter ilocal)

Parameters
ilocalLocal parameter number

Implements ParticleFitObject.

Definition at line 158 of file PxPyPzMFitObject.cc.

◆ getError()

double getError ( int  ilocal) const
virtualinherited

Get error of parameter ilocal.

Parameters
ilocalLocal parameter number

Reimplemented in JetFitObject.

Definition at line 383 of file BaseFitObject.cc.

◆ getGlobalParNum()

int getGlobalParNum ( int  ilocal) const
virtualinherited

Get global parameter number of parameter ilocal.

Parameters
ilocalLocal parameter number

Definition at line 365 of file BaseFitObject.cc.

◆ getMParam()

double getMParam ( int  ilocal) const
virtualinherited

Get measured value of parameter ilocal.

Parameters
ilocalLocal parameter number

Definition at line 377 of file BaseFitObject.cc.

◆ getParam()

double getParam ( int  ilocal) const
virtualinherited

Get current value of parameter ilocal.

Parameters
ilocalLocal parameter number

Definition at line 371 of file BaseFitObject.cc.

◆ getParamName()

const char * getParamName ( int  ilocal) const
overridevirtual

Get name of parameter ilocal.

Parameters
ilocalLocal parameter number

Implements BaseFitObject.

Definition at line 92 of file PxPyPzMFitObject.cc.

◆ getRho()

double getRho ( int  ilocal,
int  jlocal 
) const
virtualinherited

Get correlation coefficient between parameters ilocal and jlocal.

Parameters
ilocalLocal parameter number i
jlocalLocal parameter number j

Definition at line 396 of file BaseFitObject.cc.

◆ isParamFixed()

bool isParamFixed ( int  ilocal) const
virtualinherited

Returns whether parameter is fixed.

Parameters
ilocalLocal parameter number

Definition at line 408 of file BaseFitObject.cc.

◆ isParamMeasured()

bool isParamMeasured ( int  ilocal) const
virtualinherited

Get measured flag for parameter ilocal.

Parameters
ilocalLocal parameter number

Definition at line 402 of file BaseFitObject.cc.

◆ num1stDerivative()

double num1stDerivative ( int  ilocal,
double  eps 
)
inherited

Evaluates numerically the 1st derivative of chi2 w.r.t. a parameter.

Parameters
ilocalLocal parameter number
epsvariation of local parameter

Definition at line 230 of file ParticleFitObject.cc.

◆ num2ndDerivative()

double num2ndDerivative ( int  ilocal1,
double  eps1,
int  ilocal2,
double  eps2 
)
inherited

Evaluates numerically the 2nd derivative of chi2 w.r.t. 2 parameters.

Parameters
ilocal11st local parameter number
eps1variation of 1st local parameter
ilocal21st local parameter number
eps2variation of 2nd local parameter

Definition at line 242 of file ParticleFitObject.cc.

◆ operator=()

PxPyPzMFitObject & operator= ( const PxPyPzMFitObject rhs)
Parameters
rhsright hand side

Definition at line 66 of file PxPyPzMFitObject.cc.

◆ print()

std::ostream & print ( std::ostream &  os) const
overridevirtualinherited

print object to ostream

Parameters
osThe output stream

Implements BaseFitObject.

Definition at line 140 of file ParticleFitObject.cc.

◆ print1stDerivatives()

std::ostream & print1stDerivatives ( std::ostream &  os) const
virtualinherited

print the 1st derivatives wrt metaSet 0 (E, px, py, pz)

Parameters
osThe output stream

Definition at line 164 of file BaseFitObject.cc.

◆ print2ndDerivatives()

std::ostream & print2ndDerivatives ( std::ostream &  os) const
virtualinherited

print the 2nd derivatives wrt metaSet 0 (E, px, py, pz)

Parameters
osThe output stream

Definition at line 178 of file BaseFitObject.cc.

◆ print4Vector()

std::ostream & print4Vector ( std::ostream &  os) const
virtualinherited

print the four-momentum (E, px, py, pz)

Parameters
osThe output stream

Definition at line 94 of file ParticleFitObject.cc.

◆ printParams()

std::ostream & printParams ( std::ostream &  os) const
virtualinherited

print the parameters and errors

Parameters
osThe output stream

Definition at line 137 of file BaseFitObject.cc.

◆ printRhoValues()

std::ostream & printRhoValues ( std::ostream &  os) const
virtualinherited

print the correlation coefficients

Parameters
osThe output stream

Definition at line 151 of file BaseFitObject.cc.

◆ releaseParam()

virtual bool releaseParam ( int  ilocal)
inlinevirtualinherited

Release a parameter.

Parameters
ilocalLocal parameter number

Definition at line 157 of file BaseFitObject.h.

◆ setCov()

bool setCov ( int  ilocal,
int  jlocal,
double  cov_ 
)
virtualinherited

Set covariance of parameters ilocal and jlocal; return: success.

Parameters
ilocalLocal parameter number
jlocalLocal parameter number
cov_New error value

Definition at line 340 of file BaseFitObject.cc.

◆ setError()

bool setError ( int  ilocal,
double  err_ 
)
virtualinherited

Set error of parameter ilocal; return: success.

Parameters
ilocalLocal parameter number
err_New error value

Definition at line 330 of file BaseFitObject.cc.

◆ setGlobalParNum()

bool setGlobalParNum ( int  ilocal,
int  iglobal 
)
virtualinherited

Set number of parameter ilocal in global list return true signals OK.

Parameters
ilocalLocal parameter number
iglobalNew global parameter number

Definition at line 358 of file BaseFitObject.cc.

◆ setMParam()

bool setMParam ( int  ilocal,
double  mpar_ 
)
virtualinherited

Set measured value of parameter ilocal; return: success.

Parameters
ilocalLocal parameter number
mpar_New measured parameter value

Definition at line 320 of file BaseFitObject.cc.

◆ setParam() [1/2]

bool setParam ( int  ilocal,
double  par_ 
)
virtualinherited

Set value of parameter ilocal; return: significant change.

Parameters
ilocalLocal parameter number
par_New parameter value

Definition at line 309 of file BaseFitObject.cc.

◆ setParam() [2/2]

bool setParam ( int  ilocal,
double  par_,
bool  measured_,
bool  fixed_ = false 
)
virtualinherited

Set value and measured flag of parameter i; return: significant change.

Parameters
ilocalLocal parameter number
par_New parameter value
measured_New "measured" flag
fixed_New "fixed" flag

Definition at line 299 of file BaseFitObject.cc.

◆ updateParams()

bool updateParams ( double  p[],
int  idim 
)
overridevirtual

Read values from global vector, readjust vector; return: significant change.

Parameters
pThe parameter vector
idimLength of the vector

Reimplemented from BaseFitObject.

Definition at line 103 of file PxPyPzMFitObject.cc.

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const BaseFitObject bfo 
)
related

Prints out a BaseFitObject, using its print method.

Parameters
osThe output stream
bfoThe object to print

Definition at line 341 of file BaseFitObject.h.


The documentation for this class was generated from the following files: