#include <TrackFitObject.h>
Inheritance diagram for TrackFitObject:
Public Member Functions | |
TrackFitObject (const char *name_=0) | |
Default constructor. | |
TrackFitObject (const TrackFitObject &rhs) | |
Copy Constructor. | |
TrackFitObject & | operator= (const TrackFitObject &rhs) |
Assignment. | |
virtual | ~TrackFitObject () |
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 | setParameters (int ivertex, const ThreeVector &vertex, const FourVector &momentum, double charge_)=0 |
Set parameters such that track passes through a vertex with a given 4-momentum; return=success. | |
virtual bool | setMParam (int ilocal, 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 | 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 | getParam (int i) const |
Get current value of parameter ilocal. | |
virtual double | getMParam (int i) 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=0 |
Get number of parameters of this FitObject. | |
virtual const char * | getName () const |
Get object's name. | |
virtual void | setName (const char *name_) |
Set object's name. | |
virtual void | getTrajectoryPointEx (double s, ThreeVector &p) const=0 |
Get point along trajectory into existing 3-vector. | |
virtual ThreeVector | getTrajectoryPoint (double s) const |
Get point along trajectory. | |
virtual void | getVertexEx (int ivertex, ThreeVector &p) const=0 |
Get start (i=0) or stop (i=1) vertex into existing 3-vector. | |
virtual ThreeVector | getVertex (int ivertex) const |
Get start (i=0) or stop (i=1) vertex. | |
virtual void | setVertex (int ivertex, const TwoVector &v)=0 |
Set start (i=0) or stop (i=1) vertex to a point as close as possible to given point. | |
virtual void | getTrajectoryDerivativeEx (double s, int ilocal, ThreeVector &p) const=0 |
Get derivative of trajectory w.r.t. parameter ilocal into existing 3-vector. | |
virtual ThreeVector | getTrajectoryDerivative (double s, int ilocal) const |
Get derivative of trajectory w.r.t. parameter ilocal. | |
virtual void | getVertexDerivativeEx (int ivertex, int ilocal, ThreeVector &p) const=0 |
Get derivative of vertex w.r.t. parameter ilocal into existing 3-vector. | |
virtual ThreeVector | getVertexDerivative (int ivertex, int ilocal) const |
Get derivative of vertex w.r.t. parameter ilocal. | |
virtual void | getMomentumAtTrajectoryEx (double s, FourVector &p) const=0 |
Get momentum along trajectory into existing 4-vector. | |
virtual FourVector | getMomentumAtTrajectory (double s) const |
Get momentum along trajectory. | |
virtual void | getMomentumEx (int ivertex, FourVector &p) const=0 |
Get momentum at vertex into existing 4-vector. | |
virtual FourVector | getMomentum (int ivertex) const |
Get momentum at vertex. | |
virtual double | getCharge () const=0 |
Get charge in units of e. | |
virtual double | getMass () const=0 |
Get mass in GeV. | |
virtual void | getMomentumDerivativeAtTrajectoryEx (double s, int ilocal, FourVector &p) const=0 |
Get momentum along trajectory into existing 4-vector. | |
virtual FourVector | getMomentumDerivativeAtTrajectory (double s, int ilocal) const |
Get momentum along trajectory. | |
virtual void | getMomentumDerivativeEx (int ivertex, int ilocal, FourVector &p) const=0 |
Get derivative of momentum w.r.t. parameter ilocal into existing 4-vector. | |
virtual FourVector | getMomentumDerivative (int ivertex, int ilocal) const |
Get derivative of momentum w.r.t. parameter ilocal. | |
virtual double | getArcLength (int ivertex) const=0 |
Get s (arclength in r/phi) of vertex ivertex. | |
virtual void | addToGlobCov (double *globvcov, int idim) const |
virtual double | getChi2 () const |
Get chi squared from measured and fitted parameters. | |
virtual double | getDChi2DParam (int ilocal) const=0 |
Get derivative of chi squared w.r.t. parameter ilocal. | |
virtual double | getD2Chi2DParam2 (int ilocal, int jlocal) const=0 |
Get second derivative of chi squared w.r.t. parameters ilocal1 and ilocal2. | |
virtual void | addToGlobalChi2DerMatrix (int idim, double *M) const=0 |
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 JBLHelix | getTangentialHelix (double s)=0 |
Get helix that is tangential at a certain arc length s. | |
virtual std::ostream & | print (std::ostream &os) const |
print object to ostream | |
virtual void | invalidateCache () |
Invalidate the cache. | |
virtual bool | fixVertexParam (int ivertex, bool fix=true)=0 |
Fix parameter(s) pertaining to a vertex, or release it. | |
virtual bool | releaseVertexParam (int ivertex) |
Release parameter(s) pertaining to a vertex. | |
virtual void | printCov (std::ostream &os) const |
Print Covariance matrix. | |
Static Public Member Functions | |
double | setBfield (double bfield_) |
Set the B field for all tracks. | |
double | getBfield () |
Get the B field for all tracks (in Tesla). | |
Static Public Attributes | |
double | bfield = 1.14 |
Global B field in Tesla(!). | |
Protected Types | |
enum | { NPARMAX = 8 } |
Maximum number of parameters. More... | |
Protected Member Functions | |
virtual void | initCov () |
Init covariance matrix to dummy values. | |
virtual void | checkCov () |
Check covariance matrix to dummy values. | |
virtual bool | calculateCovInv () const |
Calculate the inverse of the covariance matrix. | |
virtual void | calculateChi2 () const |
Calculate chi2. | |
virtual void | copy (const TrackFitObject &source) |
Copy another TrackFitObject. | |
Protected Attributes | |
double | par [NPARMAX] |
fit parameters | |
double | mpar [NPARMAX] |
measured parameters | |
double | err [NPARMAX] |
errors | |
bool | measured [NPARMAX] |
measured flag | |
bool | fixed [NPARMAX] |
fixed flag | |
int | globalParNum [NPARMAX] |
global paramter number for each parameter | |
double | cov [NPARMAX][NPARMAX] |
local covariance matrix | |
double | covinv [NPARMAX][NPARMAX] |
inverse of local covariance matrix | |
bool | cachevalid |
flag for valid cache | |
bool | covinvvalid |
flag for valid inverse covariance matrix | |
double | chi2 |
chi^2 | |
double | resid [NPARMAX] |
residuals | |
bool | chi2contr [NPARMAX] |
contributes to chi2? | |
char * | name |
object name (name string must be allocated and deleted outside object!) |
A TrackFitObject has usually 5 track parameters, e.g. (kappa, phi0, theta, dca, z0) for a helix, plus one or two parameters for a start and a possible stop arc length, and a mass. Therefore, the base class provides space to store NPARMAX=8 parameters.
A TrackFitObject is able to calculate a point on its trajectory for a given arclength s, a tangent vector at this point, and a momentum. In general, it will need to know the b-field (assumed to be along z) for this. The b-field can be set as static value for the whole TrackFitObject class.
A TrackFitObject can also return a JBLHelix object that represents a tangential helix at a certain arc length s. The helix object is able to find a point where the helix comes close to another helix, which is needed to determine starting values for fits.
Author:Benno List, Jenny List
Changelog:
Definition at line 60 of file TrackFitObject.h.
|
Maximum number of parameters.
Definition at line 301 of file TrackFitObject.h. |
|
Default constructor.
Definition at line 26 of file TrackFitObject.C. References cov, covinv, err, fixed, globalParNum, measured, mpar, NPARMAX, par, and setName(). |
|
Copy Constructor.
Definition at line 39 of file TrackFitObject.C. References copy(). |
|
Destructor.
Definition at line 68 of file TrackFitObject.C. References name. |
|
Add derivatives of chi squared to global covariance matrix.
Implements BaseFitObject. Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Add derivatives to global covariance matrix.
Implements BaseFitObject. Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Add covariance matrix elements to global covariance matrix of size idim x idim
Implements BaseFitObject. Reimplemented in NeutralParticleTrack. Definition at line 254 of file TrackFitObject.C. References cov, getGlobalParNum(), getNPar(), isParamFixed(), isParamMeasured(), and NPARMAX. |
|
Calculate chi2.
Definition at line 359 of file TrackFitObject.C. References calculateCovInv(), chi2, chi2contr, covinv, covinvvalid, getNPar(), isParamFixed(), isParamMeasured(), mpar, par, and resid. Referenced by getChi2(), NeutralParticleTrack::updateCache(), and ChargedParticleTrack::updateCache(). |
|
Calculate the inverse of the covariance matrix.
Definition at line 333 of file TrackFitObject.C. References cov, covinv, covinvvalid, dsinv(), getNPar(), isParamMeasured(), and NPARMAX. Referenced by calculateChi2(), ChargedParticleTrack::ChargedParticleTrack(), and checkCov(). |
|
Check covariance matrix to dummy values.
Definition at line 284 of file TrackFitObject.C. References calculateCovInv(), cov, covinvvalid, getNPar(), and isParamMeasured(). Referenced by NeutralParticleTrack::initCov(), and ChargedParticleTrack::initCov(). |
|
Copy another TrackFitObject.
Definition at line 49 of file TrackFitObject.C. References cachevalid, cov, covinvvalid, err, fixed, globalParNum, measured, mpar, name, NPARMAX, par, and setName(). Referenced by operator=(), and TrackFitObject(). |
|
Fix a parameter (fix=true), or release it (fix=false).
Implements BaseFitObject. Definition at line 146 of file TrackFitObject.C. References fixed, and NPARMAX. Referenced by NeutralParticleTrack::fixVertexParam(), ChargedParticleTrack::fixVertexParam(), and K0Event::genEvent(). |
|
Fix parameter(s) pertaining to a vertex, or release it.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by K0Event::fitEvent(), H1K0Event2::fitEvent(), H1K0Event::fitEvent(), K0Event::genEvent(), and releaseVertexParam(). |
|
Get s (arclength in r/phi) of vertex ivertex.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get the B field for all tracks (in Tesla).
Definition at line 340 of file TrackFitObject.h. References bfield. |
|
Get charge in units of e.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get chi squared from measured and fitted parameters.
Implements BaseFitObject. Definition at line 328 of file TrackFitObject.C. References calculateChi2(), and chi2. |
|
Get covariance between parameters ilocal and jlocal.
Implements BaseFitObject. Definition at line 170 of file TrackFitObject.C. |
|
Get second derivative of chi squared w.r.t. parameters ilocal1 and ilocal2.
Implements BaseFitObject. Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get derivative of chi squared w.r.t. parameter ilocal.
Implements BaseFitObject. Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get error of parameter ilocal.
Implements BaseFitObject. Definition at line 165 of file TrackFitObject.C. Referenced by main(). |
|
Get global parameter number of parameter ilocal.
Implements BaseFitObject. Definition at line 150 of file TrackFitObject.C. References getNPar(), and globalParNum. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(), addToGlobCov(), NeutralParticleTrack::addToGlobCov(), and VertexConstraint::getDerivatives(). |
|
Get mass in GeV.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get momentum at vertex.
Definition at line 232 of file TrackFitObject.C. References getMomentumEx(). Referenced by H1K0Event::H1K0Event(), H1K0Event2::H1K0Event2(), main(), and print(). |
|
Get momentum along trajectory.
Definition at line 226 of file TrackFitObject.C. References getMomentumAtTrajectoryEx(). |
|
Get momentum along trajectory into existing 4-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getMomentumAtTrajectory(). |
|
Get derivative of momentum w.r.t. parameter ilocal.
Definition at line 246 of file TrackFitObject.C. References getMomentumDerivativeEx(). |
|
Get momentum along trajectory.
Definition at line 238 of file TrackFitObject.C. References getMomentumDerivativeAtTrajectoryEx(). |
|
Get momentum along trajectory into existing 4-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getMomentumDerivativeAtTrajectory(). |
|
Get derivative of momentum w.r.t. parameter ilocal into existing 4-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getMomentumDerivative(). |
|
Get momentum at vertex into existing 4-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getMomentum(). |
|
Get measured value of parameter ilocal.
Implements BaseFitObject. Definition at line 159 of file TrackFitObject.C. References isParamMeasured(), mpar, and NPARMAX. |
|
Get object's name.
Reimplemented from BaseFitObject. Definition at line 118 of file TrackFitObject.C. References name. Referenced by print(). |
|
Get number of parameters of this FitObject.
Implements BaseFitObject. Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(), addToGlobCov(), calculateChi2(), calculateCovInv(), checkCov(), VertexConstraint::getDerivatives(), TTVertexConstraint::getDerivatives(), getGlobalParNum(), initCov(), and printCov(). |
|
Get current value of parameter ilocal.
Implements BaseFitObject. Definition at line 155 of file TrackFitObject.C. Referenced by K0Event::createSmearedChargedTrack(), and main(). |
|
Get helix that is tangential at a certain arc length s.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Get derivative of trajectory w.r.t. parameter ilocal.
Definition at line 210 of file TrackFitObject.C. References getTrajectoryDerivativeEx(). |
|
Get derivative of trajectory w.r.t. parameter ilocal into existing 3-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getTrajectoryDerivative(). |
|
Get point along trajectory.
Definition at line 198 of file TrackFitObject.C. References getTrajectoryPointEx(). Referenced by main(). |
|
Get point along trajectory into existing 3-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getTrajectoryPoint(). |
|
Get start (i=0) or stop (i=1) vertex.
Definition at line 204 of file TrackFitObject.C. References getVertexEx(). Referenced by VertexConstraint::getValue(), TTVertexConstraint::getValue(), main(), and print(). |
|
Get derivative of vertex w.r.t. parameter ilocal.
Definition at line 218 of file TrackFitObject.C. References getVertexDerivativeEx(). Referenced by VertexConstraint::getDerivatives(). |
|
Get derivative of vertex w.r.t. parameter ilocal into existing 3-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getVertexDerivative(). |
|
Get start (i=0) or stop (i=1) vertex into existing 3-vector.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. Referenced by getVertex(). |
|
Init covariance matrix to dummy values.
Definition at line 274 of file TrackFitObject.C. References cov, covinvvalid, and getNPar(). Referenced by ChargedParticleTrack::ChargedParticleTrack(), NeutralParticleTrack::initCov(), ChargedParticleTrack::initCov(), and NeutralParticleTrack::NeutralParticleTrack(). |
|
Invalidate the cache.
Definition at line 194 of file TrackFitObject.C. References cachevalid. Referenced by setCov(), setError(), setMParam(), setParam(), NeutralParticleTrack::setParam(), and ChargedParticleTrack::setParam(). |
|
Get fixed flag for parameter i.
Implements BaseFitObject. Definition at line 181 of file TrackFitObject.C. References fixed, and NPARMAX. Referenced by TrackMomentumConstraint::add1stDerivativesToMatrix(), addToGlobCov(), NeutralParticleTrack::addToGlobCov(), calculateChi2(), VertexConstraint::getDerivatives(), setGlobalParNum(), NeutralParticleTrack::setParameters(), and ChargedParticleTrack::setParameters(). |
|
Get measured flag for parameter i.
Implements BaseFitObject. Definition at line 176 of file TrackFitObject.C. References measured, and NPARMAX. Referenced by addToGlobCov(), NeutralParticleTrack::addToGlobCov(), calculateChi2(), calculateCovInv(), checkCov(), and getMParam(). |
|
Assignment.
Definition at line 44 of file TrackFitObject.C. References copy(). |
|
print object to ostream
Implements BaseFitObject. Definition at line 186 of file TrackFitObject.C. References getMomentum(), getName(), getVertex(), and BaseFitObject::printParams(). Referenced by operator<<(). |
|
Print Covariance matrix.
Definition at line 381 of file TrackFitObject.C. References cov, getNPar(), BaseFitObject::getParamName(), and name. |
|
Release parameter(s) pertaining to a vertex.
Definition at line 377 of file TrackFitObject.C. References fixVertexParam(). |
|
Set the B field for all tracks.
Definition at line 136 of file TrackFitObject.C. References bfield. Referenced by main(). |
|
Set covariance of parameters ilocal and jlocal; return=success.
Implements BaseFitObject. Definition at line 108 of file TrackFitObject.C. References cov, covinvvalid, invalidateCache(), and NPARMAX. |
|
Set error of parameter ilocal; return=success.
Implements BaseFitObject. Definition at line 99 of file TrackFitObject.C. References cov, covinvvalid, invalidateCache(), and NPARMAX. Referenced by K0Event::createSmearedChargedTrack(). |
|
Set number of parameter ilocal in global list return true signals OK
Implements BaseFitObject. Definition at line 140 of file TrackFitObject.C. References globalParNum, isParamFixed(), and NPARMAX. |
|
Set measured value of parameter ilocal; return=success.
Implements BaseFitObject. Definition at line 90 of file TrackFitObject.C. References invalidateCache(), mpar, and NPARMAX. Referenced by ChargedParticleTrack::ChargedParticleTrack(), and NeutralParticleTrack::NeutralParticleTrack(). |
|
Set object's name.
Reimplemented from BaseFitObject. Definition at line 122 of file TrackFitObject.C. References name. Referenced by copy(), K0Event::genEvent(), and TrackFitObject(). |
|
Set value of parameter ilocal; return=success.
Implements BaseFitObject. Reimplemented in ChargedParticleTrack, and NeutralParticleTrack. Definition at line 82 of file TrackFitObject.C. References invalidateCache(), NPARMAX, and par. |
|
Set value and measured flag of parameter ilocal; return=success.
Implements BaseFitObject. Reimplemented in ChargedParticleTrack, and NeutralParticleTrack. Definition at line 73 of file TrackFitObject.C. References fixed, invalidateCache(), measured, and NPARMAX. |
|
Set parameters such that track passes through a vertex with a given 4-momentum; return=success.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Set start (i=0) or stop (i=1) vertex to a point as close as possible to given point.
Implemented in ChargedParticleTrack, and NeutralParticleTrack. |
|
Global B field in Tesla(!).
Definition at line 133 of file TrackFitObject.C. Referenced by ChargedParticleTrack::ChargedParticleTrack(), K0Event::createSmearedChargedTrack(), getBfield(), setBfield(), ChargedParticleTrack::setParameters(), and ChargedParticleTrack::updateCache(). |
|
|
chi^2
Definition at line 325 of file TrackFitObject.h. Referenced by calculateChi2(), and getChi2(). |
|
contributes to chi2?
Definition at line 327 of file TrackFitObject.h. Referenced by calculateChi2(). |
|
local covariance matrix
Definition at line 316 of file TrackFitObject.h. Referenced by addToGlobCov(), NeutralParticleTrack::addToGlobCov(), calculateCovInv(), checkCov(), copy(), getCov(), getError(), initCov(), NeutralParticleTrack::initCov(), ChargedParticleTrack::initCov(), printCov(), setCov(), setError(), and TrackFitObject(). |
|
inverse of local covariance matrix
Definition at line 318 of file TrackFitObject.h. Referenced by calculateChi2(), calculateCovInv(), and TrackFitObject(). |
|
flag for valid inverse covariance matrix
Definition at line 322 of file TrackFitObject.h. Referenced by calculateChi2(), calculateCovInv(), checkCov(), copy(), initCov(), NeutralParticleTrack::initCov(), ChargedParticleTrack::initCov(), setCov(), and setError(). |
|
errors
Definition at line 308 of file TrackFitObject.h. Referenced by copy(), and TrackFitObject(). |
|
fixed flag
Definition at line 312 of file TrackFitObject.h. Referenced by copy(), fixParam(), isParamFixed(), setParam(), NeutralParticleTrack::setParam(), ChargedParticleTrack::setParam(), and TrackFitObject(). |
|
global paramter number for each parameter
Definition at line 314 of file TrackFitObject.h. Referenced by copy(), getGlobalParNum(), setGlobalParNum(), and TrackFitObject(). |
|
measured flag
Definition at line 310 of file TrackFitObject.h. Referenced by copy(), isParamMeasured(), setParam(), NeutralParticleTrack::setParam(), ChargedParticleTrack::setParam(), and TrackFitObject(). |
|
measured parameters
Definition at line 306 of file TrackFitObject.h. Referenced by calculateChi2(), copy(), getMParam(), setMParam(), and TrackFitObject(). |
|
object name (name string must be allocated and deleted outside object!)
Definition at line 329 of file TrackFitObject.h. Referenced by copy(), getName(), printCov(), setName(), and ~TrackFitObject(). |
|
|
residuals
Definition at line 326 of file TrackFitObject.h. Referenced by calculateChi2(). |