Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

BaseFitObject Class Reference

Abstract base class for particle objects of kinematic fits. More...

#include <BaseFitObject.h>

Inheritance diagram for BaseFitObject:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~BaseFitObject ()
virtual bool setParam (int ilocal, double par_, bool measured_, bool fixed_=false)=0
 Set value and measured flag of parameter i; return: success.

virtual bool setParam (int ilocal, double par_)=0
 Set value of parameter ilocal; return: success.

virtual bool setMParam (int ilocal, double mpar_)=0
 Set measured value of parameter ilocal; return: success.

virtual bool setError (int ilocal, double err_)=0
 Set error of parameter ilocal; return: success.

virtual bool setCov (int ilocal, int jlocal, double cov_)=0
 Set covariance of parameters ilocal and jlocal; return: success.

virtual bool setGlobalParNum (int ilocal, int iglobal)=0
virtual bool fixParam (int ilocal, bool fix=true)=0
 Fix a parameter (fix=true), or release it (fix=false).

virtual bool releaseParam (int ilocal)
 Release a parameter.

virtual bool isParamFixed (int ilocal) const=0
 Returns whether parameter is fixed.

virtual double getParam (int ilocal) const=0
 Get current value of parameter ilocal.

virtual const char * getParamName (int ilocal) const
 Get name of parameter ilocal.

virtual const char * getName () const
 Get object's name.

virtual void setName (const char *name_)
 Set object's name.

virtual double getMParam (int ilocal) const=0
 Get measured value of parameter ilocal.

virtual double getError (int ilocal) const=0
 Get error of parameter ilocal.

virtual double getCov (int ilocal, int jlocal) const=0
 Get covariance between parameters ilocal and jlocal.

virtual bool isParamMeasured (int ilocal) const=0
 Get measured flag for parameter ilocal.

virtual int getGlobalParNum (int ilocal) const=0
 Get global parameter number of parameter ilocal.

virtual int getNPar () const=0
 Get total number of parameters of this FitObject.

virtual int getNMeasured () const
 Get number of measured parameters of this FitObject.

virtual int getNUnmeasrd () 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 void addToGlobCov (double *glcov, int idim) const=0
virtual double getChi2 () const=0
 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 std::ostream & printParams (std::ostream &os) const
 print the parameters

virtual std::ostream & print (std::ostream &os) const=0
 print object to ostream


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.


Detailed Description

Abstract base class for particle objects of kinematic fits.

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 BaseFitObject has a set of parameters, some of them measured (i.e., they contribute to the $\chi^2$). These parameters have a local numbering, running from 0 to n-1. Global numbers can be assigned by the BaseFitter using setGlobalParNum.

The class WWFitter needs the following routines from BaseFitObject:

Author: Benno List, Jenny Böhme

Date
2007/09/14 10:58:42
Author
blist

Changelog:

Definition at line 85 of file BaseFitObject.h.


Constructor & Destructor Documentation

virtual BaseFitObject::~BaseFitObject  )  [inline, virtual]
 

Definition at line 87 of file BaseFitObject.h.


Member Function Documentation

virtual void BaseFitObject::addToGlobalChi2DerMatrix int  idim,
double *  M
const [pure virtual]
 

Add derivatives of chi squared to global covariance matrix.

Parameters:
idim  First dimension of global covariance matrix
M  Global covariance matrix

Implemented in ChargedParticleTrack, NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual void BaseFitObject::addToGlobalDerMatrix int  idim,
double  c,
double *  M
const [pure virtual]
 

Add derivatives to global covariance matrix.

Parameters:
idim  First dimension of global covariance matrix
c  Constant by which to multiply derivatives
M  First dimension of global covariance matrix

Implemented in ChargedParticleTrack, JetFitObject, NeutralParticleTrack, NeutrinoFitObject, ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by NewtonFitter::fit().

virtual void BaseFitObject::addToGlobCov double *  glcov,
int  idim
const [pure virtual]
 

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

Implemented in NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual bool BaseFitObject::fixParam int  ilocal,
bool  fix = true
[pure virtual]
 

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

Parameters:
ilocal  Local parameter number
fix  fix if true, release if false

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by releaseParam().

virtual double BaseFitObject::getChi2  )  const [pure virtual]
 

Get chi squared from measured and fitted parameters.

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual double BaseFitObject::getCov int  ilocal,
int  jlocal
const [pure virtual]
 

Get covariance between parameters ilocal and jlocal.

Parameters:
ilocal  Local parameter number i
jlocal  Local parameter number j

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual double BaseFitObject::getD2Chi2DParam2 int  ilocal,
int  jlocal
const [pure virtual]
 

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

Parameters:
ilocal  Local parameter number i
jlocal  Local parameter number j

Implemented in ChargedParticleTrack, NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual double BaseFitObject::getDChi2DParam int  ilocal  )  const [pure virtual]
 

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

Parameters:
ilocal  Local parameter number

Implemented in ChargedParticleTrack, NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual double BaseFitObject::getError int  ilocal  )  const [pure virtual]
 

Get error of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by printParams().

virtual int BaseFitObject::getGlobalParNum int  ilocal  )  const [pure virtual]
 

Get global parameter number of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by NewtonFitter::fit().

virtual double BaseFitObject::getMParam int  ilocal  )  const [pure virtual]
 

Get measured value of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual const char* BaseFitObject::getName  )  const [inline, virtual]
 

Get object's name.

Reimplemented in TrackFitObject, and VertexFitObject.

Definition at line 138 of file BaseFitObject.h.

Referenced by ParticleFitObject::calculateCovInv().

int BaseFitObject::getNFixed  )  const [virtual]
 

Get number of fixed parameters of this FitObject.

Definition at line 33 of file BaseFitObject.C.

References getNPar(), and isParamFixed().

int BaseFitObject::getNFree  )  const [virtual]
 

Get number of free parameters of this FitObject.

Definition at line 28 of file BaseFitObject.C.

References getNPar(), and isParamFixed().

int BaseFitObject::getNMeasured  )  const [virtual]
 

Get number of measured parameters of this FitObject.

Definition at line 18 of file BaseFitObject.C.

References getNPar(), isParamFixed(), and isParamMeasured().

virtual int BaseFitObject::getNPar  )  const [pure virtual]
 

Get total number of parameters of this FitObject.

Implemented in ChargedParticleTrack, NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by NewtonFitter::fit(), getNFixed(), getNFree(), getNMeasured(), getNUnmeasrd(), and printParams().

int BaseFitObject::getNUnmeasrd  )  const [virtual]
 

Get number of unmeasured parameters of this FitObject.

Definition at line 23 of file BaseFitObject.C.

References getNPar(), isParamFixed(), and isParamMeasured().

virtual double BaseFitObject::getParam int  ilocal  )  const [pure virtual]
 

Get current value of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by NewtonFitter::fit(), and printParams().

virtual const char* BaseFitObject::getParamName int  ilocal  )  const [inline, virtual]
 

Get name of parameter ilocal.

Parameters:
ilocal  Local parameter number

Reimplemented in ChargedParticleTrack, JetFitObject, NeutralParticleTrack, NeutrinoFitObject, and VertexFitObject.

Definition at line 135 of file BaseFitObject.h.

Referenced by TrackFitObject::printCov().

virtual bool BaseFitObject::isParamFixed int  ilocal  )  const [pure virtual]
 

Returns whether parameter is fixed.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by getNFixed(), getNFree(), getNMeasured(), getNUnmeasrd(), and printParams().

virtual bool BaseFitObject::isParamMeasured int  ilocal  )  const [pure virtual]
 

Get measured flag for parameter ilocal.

Parameters:
ilocal  Local parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by getNMeasured(), and getNUnmeasrd().

virtual std::ostream& BaseFitObject::print std::ostream &  os  )  const [pure virtual]
 

print object to ostream

Parameters:
os  The output stream

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

Referenced by operator<<().

std::ostream & BaseFitObject::printParams std::ostream &  os  )  const [virtual]
 

print the parameters

Parameters:
os  The output stream

Definition at line 39 of file BaseFitObject.C.

References getError(), getNPar(), getParam(), and isParamFixed().

Referenced by VertexFitObject::print(), TrackFitObject::print(), and ParticleFitObject::print().

virtual bool BaseFitObject::releaseParam int  ilocal  )  [inline, virtual]
 

Release a parameter.

Parameters:
ilocal  Local parameter number

Definition at line 123 of file BaseFitObject.h.

References fixParam().

virtual bool BaseFitObject::setCov int  ilocal,
int  jlocal,
double  cov_
[pure virtual]
 

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

Parameters:
ilocal  Local parameter number
jlocal  Local parameter number
cov_  New error value

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual bool BaseFitObject::setError int  ilocal,
double  err_
[pure virtual]
 

Set error of parameter ilocal; return: success.

Parameters:
ilocal  Local parameter number
err_  New error value

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual bool BaseFitObject::setGlobalParNum int  ilocal,
int  iglobal
[pure virtual]
 

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

Parameters:
ilocal  Local parameter number
iglobal  New global parameter number

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual bool BaseFitObject::setMParam int  ilocal,
double  mpar_
[pure virtual]
 

Set measured value of parameter ilocal; return: success.

Parameters:
ilocal  Local parameter number
mpar_  New measured parameter value

Implemented in ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual void BaseFitObject::setName const char *  name_  )  [inline, virtual]
 

Set object's name.

Reimplemented in TrackFitObject, and VertexFitObject.

Definition at line 140 of file BaseFitObject.h.

virtual bool BaseFitObject::setParam int  ilocal,
double  par_
[pure virtual]
 

Set value of parameter ilocal; return: success.

Parameters:
ilocal  Local parameter number
par_  New parameter value

Implemented in ChargedParticleTrack, NeutralParticleTrack, NeutrinoFitObject, ParticleFitObject, TrackFitObject, and VertexFitObject.

virtual bool BaseFitObject::setParam int  ilocal,
double  par_,
bool  measured_,
bool  fixed_ = false
[pure virtual]
 

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

Parameters:
ilocal  Local parameter number
par_  New parameter value
measured_  New "measured" flag
fixed_  New "fixed" flag

Implemented in ChargedParticleTrack, NeutralParticleTrack, ParticleFitObject, TrackFitObject, and VertexFitObject.


Friends And Related Function Documentation

std::ostream & operator<< std::ostream &  os,
const BaseFitObject bfo
[related]
 

Prints out a BaseFitObject, using its print method.

Parameters:
os  The output stream
bfo  The object to print

Definition at line 203 of file BaseFitObject.h.

References print().


The documentation for this class was generated from the following files:
Generated on Fri Sep 14 17:38:35 2007 for Kinfit by doxygen 1.3.2