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

VertexFitObject Class Reference

Class that represents vertices. More...

#include <VertexFitObject.h>

Inheritance diagram for VertexFitObject:

Inheritance graph
[legend]
Collaboration diagram for VertexFitObject:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  VX = 1, VY = 2, VZ = 4, VXY = 3,
  VXYZ = 7, PX = 8, PY = 16, PZ = 32,
  PXY = 24, PXYZ = 56, E = 64, EPXYZ = 120,
  THE_FULL_MONTY = 127
}

Public Member Functions

 VertexFitObject (const char *name_, double x, double y, double z)
 Constructor.

 VertexFitObject (const VertexFitObject &rhs)
 Copy Constructor.

VertexFitObjectoperator= (const VertexFitObject &rhs)
 assignment

virtual ~VertexFitObject ()
 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 ilocal, double mpar_)
 Set measured value of parameter ilocal; return=success.

virtual bool setError (int ilocal, double err_)
 Set error of parameter ilocal.

virtual bool setCov (int ilocal, int jlocal, double cov_)
 Set covariance of parameters ilocal and jlocal.

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 ilocal) const
 Get parameter ilocal.

virtual double getMParam (int ilocal) 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 const char * getName () const
 Get object's name.

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

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

virtual void getVertexEx (ThreeVector &p) const
 Get vertex into existing 3-vector.

virtual ThreeVector getVertex () const
 Get vertex.

virtual void getVertexDerivativeEx (int ilocal, ThreeVector &p) const
 Get derivative of vertex w.r.t. parameter ilocal into existing 3-vector.

virtual ThreeVector getVertexDerivative (int ilocal) const
 Get derivative of vertex w.r.t. parameter ilocal.

virtual void addToGlobCov (double *cov, int idim) const
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 ilocal1, int ilocal2) const
 Get second derivative of chi squared w.r.t. parameters ilocal1 and ilocal2.

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
 Add derivatives to global covariance matrix.

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

virtual TrackFitObjectgetTrack (int i) const
 get track i

virtual void addTrack (TrackFitObject *track, bool inbound, bool measured)
 add track

virtual void addConstraints (BaseFitter &fitter, int mask=THE_FULL_MONTY)
 Create constraints and add them to a BaseFit object.

virtual ThreeVector estimatePosition ()
 Estimate vertex position.

virtual void initForFit ()
 Initialize this object and attatched tracks for fit with initial estimates.


Protected Types

typedef std::vector< TrackDescriptorTContainer
typedef TContainer::iterator TIterator
typedef std::vector< BaseConstraint * > CContainer
typedef CContainer::iterator CIterator
enum  { NPAR = 3 }
 Number of parameters. More...


Protected Member Functions

virtual void addVertexConstraints (BaseFitter &fitter, int axis)
 generate vertex constraints

virtual void addMomentumConstraint (BaseFitter &fitter, int axis)
 generate momentum constraints

virtual void initCov ()
 init 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 VertexFitObject &source)
 Copy another VertexFitObject.


Protected Attributes

double par [NPAR]
 fit parameters

double mpar [NPAR]
 measured parameters

double err [NPAR]
 errors

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 of local covariance matrix

bool covinvvalid
 flag for valid inverse covariance matrix

double chi2
 chi^2

double resid [NPAR]
 residuals

bool chi2contr [NPAR]
 contributes to chi2?

char * name
 object name

TContainer tracks
CContainer constraints

Detailed Description

Class that represents vertices.

A VertexFitObject represents a vertex, parametrized by its coordinates (x, y, z).

A VertexFitObject is a BaseFitObject, and therefore the vertex coordinates can enter a fit, either as measured values for a measured (primary) vertex, or as unmeasured values for a decay vertex.

Additionally, a VertexFitObject keeps a list of outgoing tracks and knows its incoming track (if any), which enables the VertexFitObject to set a list of constraints (VertexConstraint and TrackMomentumConstraint objects) for a fitter object.

Author:Benno List, Jenny List

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

Definition at line 56 of file VertexFitObject.h.


Member Typedef Documentation

typedef std::vector<BaseConstraint *> VertexFitObject::CContainer [protected]
 

Definition at line 261 of file VertexFitObject.h.

typedef CContainer::iterator VertexFitObject::CIterator [protected]
 

Definition at line 262 of file VertexFitObject.h.

Referenced by ~VertexFitObject().

typedef std::vector<TrackDescriptor> VertexFitObject::TContainer [protected]
 

Definition at line 258 of file VertexFitObject.h.

typedef TContainer::iterator VertexFitObject::TIterator [protected]
 

Definition at line 259 of file VertexFitObject.h.

Referenced by addMomentumConstraint(), addVertexConstraints(), estimatePosition(), and initForFit().


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
VX 
VY 
VZ 
VXY 
VXYZ 
PX 
PY 
PZ 
PXY 
PXYZ 
E 
EPXYZ 
THE_FULL_MONTY 

Definition at line 181 of file VertexFitObject.h.

anonymous enum [protected]
 

Number of parameters.

Enumeration values:
NPAR 

Definition at line 218 of file VertexFitObject.h.


Constructor & Destructor Documentation

VertexFitObject::VertexFitObject const char *  name_,
double  x,
double  y,
double  z
 

Constructor.

Definition at line 37 of file VertexFitObject.C.

References initCov(), setMParam(), setName(), and setParam().

VertexFitObject::VertexFitObject const VertexFitObject rhs  ) 
 

Copy Constructor.

Definition at line 55 of file VertexFitObject.C.

References copy().

VertexFitObject::~VertexFitObject  )  [virtual]
 

Destructor.

Definition at line 89 of file VertexFitObject.C.

References CIterator, constraints, and name.


Member Function Documentation

void VertexFitObject::addConstraints BaseFitter fitter,
int  mask = THE_FULL_MONTY
[virtual]
 

Create constraints and add them to a BaseFit object.

Definition at line 355 of file VertexFitObject.C.

References addMomentumConstraint(), addVertexConstraints(), E, fixParam(), PX, PY, PZ, VX, VY, and VZ.

Referenced by K0Event::fitEvent(), H1K0Event2::fitEvent(), and H1K0Event::fitEvent().

void VertexFitObject::addMomentumConstraint BaseFitter fitter,
int  axis
[protected, virtual]
 

generate momentum constraints

Definition at line 335 of file VertexFitObject.C.

References BaseFitter::addConstraint(), TrackConstraint::addToFOList(), constraints, TIterator, and tracks.

Referenced by addConstraints().

virtual void VertexFitObject::addToGlobalChi2DerMatrix int  idim,
double *  M
const [inline, virtual]
 

Add derivatives of chi squared to global covariance matrix.

Implements BaseFitObject.

Definition at line 163 of file VertexFitObject.h.

virtual void VertexFitObject::addToGlobalDerMatrix int  idim,
double  c,
double *  M
const [inline, virtual]
 

Add derivatives to global covariance matrix.

Implements BaseFitObject.

Definition at line 165 of file VertexFitObject.h.

void VertexFitObject::addToGlobCov double *  cov,
int  idim
const [virtual]
 

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

Implements BaseFitObject.

Definition at line 246 of file VertexFitObject.C.

References cov, getGlobalParNum(), getNPar(), isParamFixed(), isParamMeasured(), and NPAR.

void VertexFitObject::addTrack TrackFitObject track,
bool  inbound,
bool  measured
[virtual]
 

add track

Parameters:
track  The track
inbound  Is track decaying vertex (inbound=true), or originating?
measured  Is this a measured track?

Definition at line 365 of file VertexFitObject.C.

References tracks.

Referenced by K0Event::fitEvent(), H1K0Event2::fitEvent(), and H1K0Event::fitEvent().

void VertexFitObject::addVertexConstraints BaseFitter fitter,
int  axis
[protected, virtual]
 

generate vertex constraints

Definition at line 325 of file VertexFitObject.C.

References BaseFitter::addConstraint(), constraints, TIterator, and tracks.

Referenced by addConstraints().

void VertexFitObject::calculateChi2  )  const [protected, virtual]
 

Calculate chi2.

Definition at line 307 of file VertexFitObject.C.

References calculateCovInv(), chi2, chi2contr, covinv, covinvvalid, getNPar(), isParamFixed(), isParamMeasured(), mpar, par, and resid.

Referenced by getChi2().

bool VertexFitObject::calculateCovInv  )  const [protected, virtual]
 

Calculate the inverse of the covariance matrix.

Definition at line 282 of file VertexFitObject.C.

References cov, covinv, covinvvalid, dsinv(), getNPar(), isParamMeasured(), and NPAR.

Referenced by calculateChi2().

void VertexFitObject::copy const VertexFitObject source  )  [protected, virtual]
 

Copy another VertexFitObject.

Definition at line 70 of file VertexFitObject.C.

References cov, covinvvalid, err, fixed, globalParNum, measured, mpar, name, NPAR, par, setName(), and tracks.

Referenced by operator=(), and VertexFitObject().

ThreeVector VertexFitObject::estimatePosition  )  [virtual]
 

Estimate vertex position.

Definition at line 370 of file VertexFitObject.C.

References JBLHelix::getClosestApproach(), JBLHelix::getTrajectoryPoint(), TIterator, and tracks.

Referenced by initForFit().

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

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

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

Implements BaseFitObject.

Definition at line 167 of file VertexFitObject.C.

References fixed, and NPAR.

Referenced by addConstraints().

double VertexFitObject::getChi2  )  const [virtual]
 

Get chi squared from measured and fitted parameters.

Implements BaseFitObject.

Definition at line 277 of file VertexFitObject.C.

References calculateChi2(), and chi2.

double VertexFitObject::getCov int  ilocal,
int  jlocal
const [virtual]
 

Get covariance between parameters ilocal and jlocal.

Parameters:
ilocal  Local parameter number
jlocal  Local parameter number

Implements BaseFitObject.

Definition at line 191 of file VertexFitObject.C.

References cov, and NPAR.

virtual double VertexFitObject::getD2Chi2DParam2 int  ilocal1,
int  ilocal2
const [inline, virtual]
 

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

Implements BaseFitObject.

Definition at line 160 of file VertexFitObject.h.

virtual double VertexFitObject::getDChi2DParam int  ilocal  )  const [inline, virtual]
 

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

Implements BaseFitObject.

Definition at line 158 of file VertexFitObject.h.

double VertexFitObject::getError int  ilocal  )  const [virtual]
 

Get error of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implements BaseFitObject.

Definition at line 186 of file VertexFitObject.C.

References cov, and NPAR.

int VertexFitObject::getGlobalParNum int  ilocal  )  const [virtual]
 

Get global parameter number of parameter ilocal.

Implements BaseFitObject.

Definition at line 171 of file VertexFitObject.C.

References getNPar(), and globalParNum.

Referenced by addToGlobCov(), and VertexConstraint::getDerivatives().

double VertexFitObject::getMParam int  ilocal  )  const [virtual]
 

Get measured value of parameter ilocal.

Parameters:
ilocal  Local parameter number

Implements BaseFitObject.

Definition at line 180 of file VertexFitObject.C.

References isParamMeasured(), mpar, and NPAR.

const char * VertexFitObject::getName  )  const [virtual]
 

Get object's name.

Reimplemented from BaseFitObject.

Definition at line 137 of file VertexFitObject.C.

References name.

Referenced by initForFit(), and print().

int VertexFitObject::getNPar  )  const [virtual]
 

Get number of parameters of this FitObject.

Implements BaseFitObject.

Definition at line 66 of file VertexFitObject.C.

References NPAR.

Referenced by addToGlobCov(), calculateChi2(), calculateCovInv(), VertexConstraint::getDerivatives(), getGlobalParNum(), and initCov().

double VertexFitObject::getParam int  ilocal  )  const [virtual]
 

Get parameter ilocal.

Parameters:
ilocal  Local parameter number

Implements BaseFitObject.

Definition at line 176 of file VertexFitObject.C.

References NPAR, and par.

const char * VertexFitObject::getParamName int  ilocal  )  const [virtual]
 

Get name of parameter ilocal.

Parameters:
ilocal  Local parameter number

Reimplemented from BaseFitObject.

Definition at line 141 of file VertexFitObject.C.

virtual TrackFitObject* VertexFitObject::getTrack int  i  )  const [inline, virtual]
 

get track i

Definition at line 172 of file VertexFitObject.h.

References tracks.

ThreeVector VertexFitObject::getVertex  )  const [virtual]
 

Get vertex.

Definition at line 214 of file VertexFitObject.C.

References getVertexEx().

Referenced by VertexConstraint::getValue(), and main().

ThreeVector VertexFitObject::getVertexDerivative int  ilocal  )  const [virtual]
 

Get derivative of vertex w.r.t. parameter ilocal.

Definition at line 224 of file VertexFitObject.C.

References getVertexDerivativeEx().

Referenced by VertexConstraint::getDerivatives().

void VertexFitObject::getVertexDerivativeEx int  ilocal,
ThreeVector p
const [virtual]
 

Get derivative of vertex w.r.t. parameter ilocal into existing 3-vector.

Definition at line 230 of file VertexFitObject.C.

References ThreeVector::setValues().

Referenced by getVertexDerivative().

void VertexFitObject::getVertexEx ThreeVector p  )  const [virtual]
 

Get vertex into existing 3-vector.

Definition at line 220 of file VertexFitObject.C.

References par, and ThreeVector::setValues().

Referenced by getVertex().

void VertexFitObject::initCov  )  [protected, virtual]
 

init covariance matrix to dummy values

Definition at line 267 of file VertexFitObject.C.

References cov, covinvvalid, and getNPar().

Referenced by VertexFitObject().

void VertexFitObject::initForFit  )  [virtual]
 

Initialize this object and attatched tracks for fit with initial estimates.

Definition at line 401 of file VertexFitObject.C.

References estimatePosition(), ThreeVector::getComponent(), FourVector::getE(), getName(), par, TIterator, and tracks.

Referenced by K0Event::fitEvent(), H1K0Event2::fitEvent(), and H1K0Event::fitEvent().

bool VertexFitObject::isParamFixed int  ilocal  )  const [virtual]
 

Get fixed flag for parameter i.

Implements BaseFitObject.

Definition at line 202 of file VertexFitObject.C.

References fixed, and NPAR.

Referenced by addToGlobCov(), calculateChi2(), VertexConstraint::getDerivatives(), and setGlobalParNum().

bool VertexFitObject::isParamMeasured int  ilocal  )  const [virtual]
 

Get measured flag for parameter i.

Implements BaseFitObject.

Definition at line 197 of file VertexFitObject.C.

References measured, and NPAR.

Referenced by addToGlobCov(), calculateChi2(), calculateCovInv(), and getMParam().

VertexFitObject & VertexFitObject::operator= const VertexFitObject rhs  ) 
 

assignment

Definition at line 61 of file VertexFitObject.C.

References copy().

std::ostream & VertexFitObject::print std::ostream &  os  )  const [virtual]
 

print object to ostream

Parameters:
os  The output stream

Implements BaseFitObject.

Definition at line 207 of file VertexFitObject.C.

References getName(), and BaseFitObject::printParams().

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

Set covariance of parameters ilocal and jlocal.

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

Implements BaseFitObject.

Definition at line 128 of file VertexFitObject.C.

References cov, covinvvalid, and NPAR.

bool VertexFitObject::setError int  ilocal,
double  err_
[virtual]
 

Set error of parameter ilocal.

Parameters:
ilocal  Local parameter number
err_  New error value

Implements BaseFitObject.

Definition at line 120 of file VertexFitObject.C.

References cov, covinvvalid, and NPAR.

bool VertexFitObject::setGlobalParNum int  ilocal,
int  iglobal
[virtual]
 

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

Implements BaseFitObject.

Definition at line 161 of file VertexFitObject.C.

References globalParNum, isParamFixed(), and NPAR.

bool VertexFitObject::setMParam int  ilocal,
double  mpar_
[virtual]
 

Set measured value of parameter ilocal; return=success.

Parameters:
ilocal  Local parameter number
mpar_  Measured parameter value

Implements BaseFitObject.

Definition at line 113 of file VertexFitObject.C.

References mpar, and NPAR.

Referenced by VertexFitObject().

void VertexFitObject::setName const char *  name_  )  [virtual]
 

Set object's name.

Reimplemented from BaseFitObject.

Definition at line 150 of file VertexFitObject.C.

References name.

Referenced by copy(), and VertexFitObject().

bool VertexFitObject::setParam int  ilocal,
double  par_
[virtual]
 

Set value of parameter ilocal; return=success.

Parameters:
ilocal  Local parameter number
par_  New parameter value

Implements BaseFitObject.

Definition at line 107 of file VertexFitObject.C.

References NPAR, and par.

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

Set value and measured flag of parameter ilocal; return=success.

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

Implements BaseFitObject.

Definition at line 99 of file VertexFitObject.C.

References fixed, measured, and NPAR.

Referenced by VertexFitObject().


Member Data Documentation

double VertexFitObject::chi2 [mutable, protected]
 

chi^2

Definition at line 240 of file VertexFitObject.h.

Referenced by calculateChi2(), and getChi2().

bool VertexFitObject::chi2contr[NPAR] [mutable, protected]
 

contributes to chi2?

Definition at line 242 of file VertexFitObject.h.

Referenced by calculateChi2().

CContainer VertexFitObject::constraints [protected]
 

Definition at line 263 of file VertexFitObject.h.

Referenced by addMomentumConstraint(), addVertexConstraints(), and ~VertexFitObject().

double VertexFitObject::cov[NPAR][NPAR] [protected]
 

local covariance matrix

Definition at line 233 of file VertexFitObject.h.

Referenced by addToGlobCov(), calculateCovInv(), copy(), getCov(), getError(), initCov(), setCov(), and setError().

double VertexFitObject::covinv[NPAR][NPAR] [mutable, protected]
 

inverse of local covariance matrix

Definition at line 235 of file VertexFitObject.h.

Referenced by calculateChi2(), and calculateCovInv().

bool VertexFitObject::covinvvalid [mutable, protected]
 

flag for valid inverse covariance matrix

Definition at line 237 of file VertexFitObject.h.

Referenced by calculateChi2(), calculateCovInv(), copy(), initCov(), setCov(), and setError().

double VertexFitObject::err[NPAR] [protected]
 

errors

Definition at line 225 of file VertexFitObject.h.

Referenced by copy().

bool VertexFitObject::fixed[NPAR] [protected]
 

fixed flag

Definition at line 229 of file VertexFitObject.h.

Referenced by copy(), fixParam(), isParamFixed(), and setParam().

int VertexFitObject::globalParNum[NPAR] [protected]
 

global paramter number for each parameter

Definition at line 231 of file VertexFitObject.h.

Referenced by copy(), getGlobalParNum(), and setGlobalParNum().

bool VertexFitObject::measured[NPAR] [protected]
 

measured flag

Definition at line 227 of file VertexFitObject.h.

Referenced by copy(), isParamMeasured(), and setParam().

double VertexFitObject::mpar[NPAR] [protected]
 

measured parameters

Definition at line 223 of file VertexFitObject.h.

Referenced by calculateChi2(), copy(), getMParam(), and setMParam().

char* VertexFitObject::name [protected]
 

object name

Definition at line 244 of file VertexFitObject.h.

Referenced by copy(), getName(), setName(), and ~VertexFitObject().

double VertexFitObject::par[NPAR] [protected]
 

fit parameters

Definition at line 221 of file VertexFitObject.h.

Referenced by calculateChi2(), copy(), getParam(), getVertexEx(), initForFit(), and setParam().

double VertexFitObject::resid[NPAR] [mutable, protected]
 

residuals

Definition at line 241 of file VertexFitObject.h.

Referenced by calculateChi2().

TContainer VertexFitObject::tracks [protected]
 

Definition at line 260 of file VertexFitObject.h.

Referenced by addMomentumConstraint(), addTrack(), addVertexConstraints(), copy(), estimatePosition(), getTrack(), and initForFit().


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