MarlinTPC  1.2.0
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
marlintpc::TrackFitterBase Class Referenceabstract

The TrackFitterBase is a virtual class from which the actual track fitters are derived. More...

#include <TrackFitterBase.h>

Inheritance diagram for marlintpc::TrackFitterBase:
marlintpc::TrackFitterKalman marlintpc::TrackFitterLinearRegression marlintpc::TrackFitterSimpleChiSquare marlintpc::TrackFitterSimpleHelix marlintpc::TrackFitterSimpleMinimizer marlintpc::TrackFitterSimpleChiSquarePads

Classes

struct  FitterTypes
 Defines constants to determine which fitter type was used to perform the fit and calculate the residuals. More...
 

Public Member Functions

 TrackFitterBase ()
 The Constructor. More...
 
virtual std::string getRevision () const
 Get the revision of the actual fitter implementation. More...
 
virtual unsigned char getFitterType () const =0
 Information what fitter implementation this is.
 
virtual IMPL::TrackImpl * fitTrack (EVENT::Track const *seedTrack) const =0
 The function which does the actual fitting. More...
 
virtual EVENT::DoubleVec calculateResiduals (EVENT::Track const *testTrack, unsigned int testHitNumber, EVENT::Track const *referenceTrack=NULL) const
 Return the distance of the hit testHitNumber of the testTrack to the point of closest approach on the referenceTrack wrt. the hit. More...
 
virtual EVENT::DoubleVec calculateResiduals (EVENT::TrackerHit const *testHit, EVENT::Track const *trackWithoutTestHit) const
 Return the distance of the given hit to the test track where this hit has been removed. More...
 
void setD0Start (double d0)
 Set a d0 start value for the fit. More...
 
void setPhiStart (double phi)
 Set a phi start value for the fit. More...
 
void setOmegaStart (double omega)
 Set a omega start value for the fit. More...
 
void setTanLambdaStart (double tanLambda)
 Set a tanLambda start value for the fit. More...
 
void setZ0Start (double z0)
 Set a z0 start value for the fit. More...
 
void setNoZFitFlag (bool noZFit=true)
 Switch to turn off the fitting in z. More...
 
bool getNoZFitFlag () const
 Get the noZFit flag.
 
void fixD0 (bool fix=true)
 Fix or release d0.
 
void fixPhi (bool fix=true)
 Fix or release phi.
 
void fixOmega (bool fix=true)
 Fix or release omega.
 
void fixTanLambda (bool fix=true)
 Fix or release tanLambda.
 
void fixZ0 (bool fix=true)
 Fix or release z0.
 

Static Public Member Functions

static void setTrackFitterType (unsigned char type, IMPL::TrackImpl *track)
 Convenience function to set bits 16-23 to be the track type.
 
static unsigned char getFitterTypeFromTrack (int trackTypeWord)
 Convenicene function to get the tracker type out of the trackType word.
 

Static Public Attributes

static const unsigned char FITFAILEDBIT = 30
 Bit 30 in the TrackType word is fit failed.
 

Protected Member Functions

double distanceOnCircle (double phi1, double phi2) const
 Calculate the angular distance on a circle. More...
 

Protected Attributes

double _d0Start
 The start value for the fit and a flag whether to apply d0Start or the value from the seed track.
 
bool _useD0Start
 
double _phiStart
 The start value for the fit and a flag whether to apply phiStart or the value from the seed track.
 
bool _usePhiStart
 
double _omegaStart
 The start value for the fit and a flag whether to apply omegaStart or the value from the seed track.
 
bool _useOmegaStart
 
double _tanLambdaStart
 The start value for the fit and a flag whether to apply tanLambdaStart or the value from the seed track.
 
bool _useTanLambdaStart
 
double _z0Start
 The start value for the fit and a flag whether to apply z0Start or the value from the seed track.
 
bool _useZ0Start
 
bool _noZFit
 flag whether to perform a 2D or a 3D fit
 
bool _fixD0
 flags whether to fix a fit parameter
 
bool _fixPhi
 
bool _fixOmega
 
bool _fixTanLambda
 
bool _fixZ0
 

Detailed Description

The TrackFitterBase is a virtual class from which the actual track fitters are derived.

It provides a common interface which is accessed by the track fitter processors and analysis processors.
Most members are purely virtual. They have to be overloaded/implemented in the derived classes.

To calculate something like a single point resolution it is required that these "points" are accessed via the EVENT::TrackerHit as an interface. Some methods like the global likelihood method don't use the xy-information from hits but refit a x-position from the charge on the pads using the given track fit . This requires a calculateResiduals method individually for each fitting method. To have a common interface for all methods the TrackerHit is used, through which the more low level information like pulses can be accessed.
The calculateResiduals method is not purely virtual. It is implemented for the generic case which calculates the distance to the point of closest approach (pca) in the readout plane and the z-distance to the pca in the s-z plane.

Constructor & Destructor Documentation

marlintpc::TrackFitterBase::TrackFitterBase ( )

The Constructor.

The fit start values are initialised here and the flags whether to use the are set to false (start values are taken from seed track).

Member Function Documentation

EVENT::DoubleVec marlintpc::TrackFitterBase::calculateResiduals ( EVENT::Track const *  testTrack,
unsigned int  testHitNumber,
EVENT::Track const *  referenceTrack = NULL 
) const
virtual

Return the distance of the hit testHitNumber of the testTrack to the point of closest approach on the referenceTrack wrt. the hit.

If no referenceTrack is given the distance to the testTrack is returned.

Throws EVENT::DataNotAvailableException in case there is no hit number "testHitNumber" on testHit.

Calls calculateResidual(EVENT::TrackerHit *testHit, EVENT::Track *trackWithoutTestHit) in this implementation.

Reimplemented in marlintpc::TrackFitterSimpleChiSquarePads.

Referenced by marlintpc::TimePixHoughTransformNormalProcessor::AddHits(), marlintpc::TrackFitterSimpleMinimizerProcessor::calculateMeanAndRMS(), marlintpc::BiasedResidualsProcessor::processEvent(), marlintpc::GeometricMeanResidualsTupleProcessor::processEvent(), marlintpc::PadResponseProcessor::processEvent(), and marlintpc::TrackFitterSimpleMinimizerProcessor::processEvent().

EVENT::DoubleVec marlintpc::TrackFitterBase::calculateResiduals ( EVENT::TrackerHit const *  testHit,
EVENT::Track const *  trackWithoutTestHit 
) const
virtual

Return the distance of the given hit to the test track where this hit has been removed.

The residual is calculated as the distance to the point of closest approach on the referenceTrack wrt. the hit.

Reimplemented in marlintpc::TrackFitterSimpleChiSquarePads.

double marlintpc::TrackFitterBase::distanceOnCircle ( double  phi1,
double  phi2 
) const
protected

Calculate the angular distance on a circle.

The maximum can be $\pi$.

Referenced by marlintpc::TrackFitterSimpleChiSquarePads::calculateResiduals().

virtual IMPL::TrackImpl* marlintpc::TrackFitterBase::fitTrack ( EVENT::Track const *  seedTrack) const
pure virtual
std::string marlintpc::TrackFitterBase::getRevision ( ) const
virtual

Get the revision of the actual fitter implementation.

This is needed for revision logging. Implementation should look like:

return std::string( "$Rev$" ); 

In case you don't reimplement the calculateResidulas methods you should also state the revision of this base class:

return std::string( "$Rev$ ; TrackFitterBase ") + TrackFitterBase::getRevision(); 

Don't forget to switch on the 'svn Rev' property for this file:

svn propset svn:keywords Rev TrackFitterImpl.cc 

Reimplemented in marlintpc::TrackFitterKalman, marlintpc::TrackFitterSimpleChiSquarePads, marlintpc::TrackFitterSimpleMinimizer, marlintpc::TrackFitterLinearRegression, marlintpc::TrackFitterSimpleHelix, and marlintpc::TrackFitterSimpleChiSquare.

Referenced by marlintpc::TrackFitterSimpleChiSquare::getRevision().

void marlintpc::TrackFitterBase::setD0Start ( double  d0)

Set a d0 start value for the fit.

This overwrites the value from the seed track.

References _d0Start.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().

void marlintpc::TrackFitterBase::setNoZFitFlag ( bool  noZFit = true)

Switch to turn off the fitting in z.

Fit is only performed in x-y / r-phi plane. As default noZFit is false, the fit is performed in three dimensions.

References _noZFit.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().

void marlintpc::TrackFitterBase::setOmegaStart ( double  omega)

Set a omega start value for the fit.

This overwrites the value from the seed track.

References _omegaStart.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().

void marlintpc::TrackFitterBase::setPhiStart ( double  phi)

Set a phi start value for the fit.

This overwrites the value from the seed track.

References _phiStart.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().

void marlintpc::TrackFitterBase::setTanLambdaStart ( double  tanLambda)

Set a tanLambda start value for the fit.

This overwrites the value from the seed track.

References _tanLambdaStart.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().

void marlintpc::TrackFitterBase::setZ0Start ( double  z0)

Set a z0 start value for the fit.

This overwrites the value from the seed track.

References _z0Start.

Referenced by marlintpc::TrackFitterSimpleChiSquareProcessor::processEvent().


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