#include <ParticleFitObject.h>
Inheritance diagram for ParticleFitObject:
Public Member Functions | |
ParticleFitObject () | |
Default constructor. | |
virtual | ~ParticleFitObject () |
Virtual destructor. | |
virtual bool | setParam (int ilocal, double par_, bool measured_, bool fixed_=false) |
Set value and measured flag of parameter ilocal; return=success. | |
virtual bool | setParam (int ilocal, double par_) |
Set value of parameter ilocal; return=success. | |
virtual bool | setMParam (int i, double mpar_) |
Set measured value of parameter ilocal; return=success. | |
virtual bool | setError (int ilocal, double err_) |
Set error of parameter ilocal; return=success. | |
virtual bool | setCov (int ilocal, int jlocal, double cov_) |
Set covariance of parameters ilocal and jlocal; return=success. | |
virtual bool | setMass (double mass_) |
Set mass of particle; return=success. | |
virtual bool | setGlobalParNum (int ilocal, int iglobal) |
virtual bool | fixParam (int ilocal, bool fix=true) |
Fix a parameter (fix=true), or release it (fix=false). | |
virtual double * | getCovMatrix () |
Get covariance matrix. | |
virtual double | getParam (int ilocal) const |
Get current value of parameter ilocal. | |
virtual double | getMParam (int iocal) const |
Get measured value of parameter ilocal. | |
virtual double | getError (int ilocal) const |
Get error of parameter ilocal. | |
virtual double | getCov (int ilocal, int jlocal) const |
Get covariance between parameters ilocal and jlocal. | |
virtual bool | isParamMeasured (int ilocal) const |
Get measured flag for parameter i. | |
virtual bool | isParamFixed (int ilocal) const |
Get fixed flag for parameter i. | |
virtual int | getGlobalParNum (int ilocal) const |
Get global parameter number of parameter ilocal. | |
virtual int | getNPar () const |
Get number of parameters of this FitObject. | |
virtual void | addToGlobCov (double *globCov, int idim) const |
Add covariance matrix elements to global covariance matrix. | |
virtual std::ostream & | print4Vector (std::ostream &os) const |
print the four-momentum (E, px, py, pz) | |
virtual double | getPx () const=0 |
these depend on actual parametrisation! | |
virtual double | getPy () const=0 |
virtual double | getPz () const=0 |
virtual double | getE () const=0 |
virtual double | getP () const=0 |
virtual double | getP2 () const=0 |
virtual double | getPt () const=0 |
virtual double | getPt2 () const=0 |
virtual double | getDPx (int ilocal) const=0 |
virtual double | getDPy (int ilocal) const=0 |
virtual double | getDPz (int ilocal) const=0 |
virtual double | getDE (int ilocal) const=0 |
virtual void | addToDerivatives (double der[], int idim, double pxfact=0, double pyfact=0, double pzfact=0, double efact=0) const=0 |
virtual void | addTo2ndDerivatives (double der2[], int idim, double pxfact, double pyfact, double pzfact, double efact) const=0 |
virtual double | getChi2 () const |
Get chi squared from measured and fitted parameters. | |
virtual double | getDChi2DParam (int ilocal) const |
Get derivative of chi squared w.r.t. parameter ilocal. | |
virtual double | getD2Chi2DParam2 (int ilocal, int jlocal) const |
Get second derivative of chi squared w.r.t. parameters ilocal and jlocal. | |
virtual void | addToGlobalChi2DerMatrix (int idim, double *M) const |
Add derivatives of chi squared to global covariance matrix. | |
virtual void | addToGlobalDerMatrix (int idim, double c, double *M) const=0 |
Add derivatives to global covariance matrix. | |
virtual void | invalidateCache () const |
invalidate any cached quantities | |
virtual std::ostream & | print (std::ostream &os) const |
print object to ostream | |
Protected Types | |
enum | { NPAR = 3 } |
number of parameters More... | |
Protected Member Functions | |
virtual bool | calculateCovInv () const |
Calculate the inverse of the covariance matrix. | |
Protected Attributes | |
double | mass |
mass of particle | |
double | par [NPAR] |
fit parameters | |
double | mpar [NPAR] |
measured parameters | |
bool | measured [NPAR] |
measured flag | |
bool | fixed [NPAR] |
fixed flag | |
int | globalParNum [NPAR] |
global paramter number for each parameter | |
double | cov [NPAR][NPAR] |
local covariance matrix | |
double | covinv [NPAR][NPAR] |
inverse pf local covariance matrix | |
bool | covinvvalid |
flag for valid inverse covariance matrix |
This class defines the minimal functionality any fit object must provide. The main task of a fit object is to keep parameters (and errors) that define the four-momentum of a particle and encapsulate the actually chosen parametrisation from the rest of the fitting machinery.
Since for the fit a parametrisation distributed like a gaussian is most favorable, different kinds of particles (implying different kinds of measurements!) might require different parametrisations. For each desired parametrisation a concrete class should be derived from this abstract base class. It needs to be able to convert its parameters to E, px, py, pz and to provide the derivatives of E, px, py, pz with respect to the internal parameters.
Depending on the type of particle, some or all parameters might be unmeasured (neutrinos!), meaning that they come with a very large and/or unknown error. They are treated differently by the fit algorithm and are thus flagged accordingly.
In order to insert its derivatives into the global covariance matrix of all FitObjects in the event, each FitObjects needs to know the position of its parameters in the overall parameter list.
THIS iS JUNK!!!! It is done like this in JetFitObject.C, but using measured[i] which is the bool giving the measured/unmeasured status and NOT a bool containing the START VALUES!!!!! From its stored initial parameters and the current fit parameters the FitObject calculates its contribution to the $^2$ of the fit.
In its current state, a ParticleFitObject has a set of parameters, some of them measured (i.e., they contribute to the ). These parameters have a local numbering, running from 0 to n-1. Global numbers can be assigned by the BaseFitter using setGlobalParNum.
Author: Benno List, Jenny List
Changelog:
Definition at line 62 of file ParticleFitObject.h.
|
number of parameters
Definition at line 200 of file ParticleFitObject.h. |
|
Default constructor.
Definition at line 27 of file ParticleFitObject.C. References globalParNum, and NPAR. |
|
Virtual destructor.
Definition at line 31 of file ParticleFitObject.C. |
|
add second order derivatives to matrix der2 of size idim x idim pxfact*d^2px/(dx_i dx_j) + pyfact...
Implemented in JetFitObject. Referenced by PzConstraint::add2ndDerivativesToMatrix(), PyConstraint::add2ndDerivativesToMatrix(), PxConstraint::add2ndDerivativesToMatrix(), and EConstraint::add2ndDerivativesToMatrix(). |
|
add derivatives to vector der of size idim pxfact*dpx/dx_i + pyfact*dpy/dx_i + pzfact*dpz/dx_i + efact*dE/dx_i
Implemented in JetFitObject. |
|
Add derivatives of chi squared to global covariance matrix.
Implements BaseFitObject. Definition at line 206 of file ParticleFitObject.C. References calculateCovInv(), covinv, covinvvalid, getGlobalParNum(), getNPar(), isParamFixed(), and isParamMeasured(). |
|
Add derivatives to global covariance matrix.
Implements BaseFitObject. Implemented in JetFitObject, and NeutrinoFitObject. |
|
Add covariance matrix elements to global covariance matrix.
Implements BaseFitObject. Definition at line 226 of file ParticleFitObject.C. References cov, getGlobalParNum(), getNPar(), isParamFixed(), and isParamMeasured(). |
|
Calculate the inverse of the covariance matrix.
Definition at line 139 of file ParticleFitObject.C. References cov, covinv, covinvvalid, dsinv(), BaseFitObject::getName(), getNPar(), isParamMeasured(), and NPAR. Referenced by addToGlobalChi2DerMatrix(), getChi2(), getD2Chi2DParam2(), and getDChi2DParam(). |
|
Fix a parameter (fix=true), or release it (fix=false).
Implements BaseFitObject. Definition at line 84 of file ParticleFitObject.C. |
|
Get chi squared from measured and fitted parameters.
Implements BaseFitObject. Definition at line 165 of file ParticleFitObject.C. References calculateCovInv(), covinv, covinvvalid, getNPar(), isParamFixed(), isParamMeasured(), mpar, NPAR, and par. |
|
Get covariance between parameters ilocal and jlocal.
Implements BaseFitObject. Definition at line 112 of file ParticleFitObject.C. |
|
Get covariance matrix.
Definition at line 101 of file ParticleFitObject.h. References cov. |
|
Get second derivative of chi squared w.r.t. parameters ilocal and jlocal.
Implements BaseFitObject. Definition at line 195 of file ParticleFitObject.C. References calculateCovInv(), covinv, covinvvalid, isParamFixed(), isParamMeasured(), and NPAR. |
|
Get derivative of chi squared w.r.t. parameter ilocal.
Implements BaseFitObject. Definition at line 183 of file ParticleFitObject.C. References calculateCovInv(), covinv, covinvvalid, getNPar(), isParamFixed(), isParamMeasured(), measured, NPAR, and par. |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by EConstraint::add1stDerivativesToMatrix(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by PxConstraint::add1stDerivativesToMatrix(), and PConstraint::add1stDerivativesToMatrix(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by PyConstraint::add1stDerivativesToMatrix(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by PzConstraint::add1stDerivativesToMatrix(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by print4Vector(). |
|
Get error of parameter ilocal.
Implements BaseFitObject. Definition at line 108 of file ParticleFitObject.C. Referenced by main(). |
|
Get global parameter number of parameter ilocal.
Implements BaseFitObject. Definition at line 94 of file ParticleFitObject.C. References globalParNum, and NPAR. Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), EConstraint::add1stDerivativesToMatrix(), addToGlobalChi2DerMatrix(), and addToGlobCov(). |
|
Get measured value of parameter ilocal.
Implements BaseFitObject. Definition at line 103 of file ParticleFitObject.C. |
|
Get number of parameters of this FitObject.
Implements BaseFitObject. Definition at line 122 of file ParticleFitObject.h. References NPAR. Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), EConstraint::add1stDerivativesToMatrix(), addToGlobalChi2DerMatrix(), addToGlobCov(), calculateCovInv(), getChi2(), and getDChi2DParam(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. |
|
Implemented in JetFitObject. |
|
Get current value of parameter ilocal.
Implements BaseFitObject. Definition at line 99 of file ParticleFitObject.C. Referenced by main(). |
|
Implemented in JetFitObject. |
|
Implemented in JetFitObject. |
|
these depend on actual parametrisation!
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by print4Vector(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by print4Vector(). |
|
Implemented in JetFitObject, and NeutrinoFitObject. Referenced by print4Vector(). |
|
invalidate any cached quantities
Reimplemented in JetFitObject. Definition at line 189 of file ParticleFitObject.h. Referenced by setCov(), setError(), setMass(), setMParam(), and setParam(). |
|
Get fixed flag for parameter i.
Implements BaseFitObject. Definition at line 122 of file ParticleFitObject.C. Referenced by PzConstraint::add1stDerivativesToMatrix(), PyConstraint::add1stDerivativesToMatrix(), PxConstraint::add1stDerivativesToMatrix(), PConstraint::add1stDerivativesToMatrix(), EConstraint::add1stDerivativesToMatrix(), addToGlobalChi2DerMatrix(), addToGlobCov(), getChi2(), getD2Chi2DParam2(), and getDChi2DParam(). |
|
Get measured flag for parameter i.
Implements BaseFitObject. Definition at line 117 of file ParticleFitObject.C. References measured, and NPAR. Referenced by addToGlobalChi2DerMatrix(), addToGlobCov(), calculateCovInv(), getChi2(), getD2Chi2DParam2(), and getDChi2DParam(). |
|
print object to ostream
Implements BaseFitObject. Definition at line 133 of file ParticleFitObject.C. References print4Vector(), and BaseFitObject::printParams(). |
|
print the four-momentum (E, px, py, pz)
Definition at line 127 of file ParticleFitObject.C. References getE(), getPx(), getPy(), and getPz(). Referenced by print(). |
|
Set covariance of parameters ilocal and jlocal; return=success.
Implements BaseFitObject. Definition at line 68 of file ParticleFitObject.C. References cov, covinvvalid, invalidateCache(), and NPAR. |
|
Set error of parameter ilocal; return=success.
Implements BaseFitObject. Definition at line 59 of file ParticleFitObject.C. References cov, covinvvalid, invalidateCache(), and NPAR. Referenced by JetFitObject::JetFitObject(). |
|
Set number of parameter ilocal in global list return true signals OK Implements BaseFitObject. Definition at line 89 of file ParticleFitObject.C. References globalParNum, and NPAR. |
|
Set mass of particle; return=success.
Definition at line 77 of file ParticleFitObject.C. References invalidateCache(), and mass. Referenced by JetFitObject::JetFitObject(), and NeutrinoFitObject::NeutrinoFitObject(). |
|
Set measured value of parameter ilocal; return=success.
Implements BaseFitObject. Definition at line 51 of file ParticleFitObject.C. References invalidateCache(), mpar, and NPAR. Referenced by JetFitObject::JetFitObject(). |
|
Set value of parameter ilocal; return=success.
Implements BaseFitObject. Reimplemented in NeutrinoFitObject. Definition at line 43 of file ParticleFitObject.C. References invalidateCache(), NPAR, and par. |
|
Set value and measured flag of parameter ilocal; return=success.
Implements BaseFitObject. Definition at line 34 of file ParticleFitObject.C. References fixed, invalidateCache(), measured, and NPAR. Referenced by JetFitObject::JetFitObject(). |
|
local covariance matrix
Definition at line 214 of file ParticleFitObject.h. Referenced by addToGlobCov(), calculateCovInv(), getCov(), getCovMatrix(), getError(), JetFitObject::initCov(), setCov(), and setError(). |
|
inverse pf local covariance matrix
Definition at line 216 of file ParticleFitObject.h. Referenced by addToGlobalChi2DerMatrix(), calculateCovInv(), getChi2(), getD2Chi2DParam2(), and getDChi2DParam(). |
|
flag for valid inverse covariance matrix
Definition at line 218 of file ParticleFitObject.h. Referenced by addToGlobalChi2DerMatrix(), calculateCovInv(), getChi2(), getD2Chi2DParam2(), getDChi2DParam(), setCov(), and setError(). |
|
fixed flag
Definition at line 210 of file ParticleFitObject.h. Referenced by fixParam(), isParamFixed(), and setParam(). |
|
global paramter number for each parameter
Definition at line 212 of file ParticleFitObject.h. Referenced by JetFitObject::addTo2ndDerivatives(), JetFitObject::addToDerivatives(), getGlobalParNum(), ParticleFitObject(), and setGlobalParNum(). |
|
mass of particle
Definition at line 202 of file ParticleFitObject.h. Referenced by JetFitObject::addTo2ndDerivatives(), NeutrinoFitObject::getD2Px(), NeutrinoFitObject::getD2Py(), NeutrinoFitObject::getD2Pz(), NeutrinoFitObject::getP(), setMass(), NeutrinoFitObject::setParam(), and JetFitObject::updateCache(). |
|
measured flag
Definition at line 208 of file ParticleFitObject.h. Referenced by getDChi2DParam(), isParamMeasured(), setParam(), and NeutrinoFitObject::setParam(). |
|
measured parameters
Definition at line 206 of file ParticleFitObject.h. Referenced by getChi2(), getMParam(), and setMParam(). |
|