FairRoot/PandaRoot
|
Track object for genfit. genfit algorithms work on these objects. More...
#include <GFTrack.h>
Public Member Functions | |
GFTrack () | |
Default constructor – needed for compatibility with ROOT. More... | |
GFTrack (const GFTrack &) | |
Copy constructor. More... | |
GFTrack & | operator= (const GFTrack &) |
assignement operator More... | |
GFTrack (GFAbsTrackRep *, bool smooth=false) | |
Initializing constructor. More... | |
virtual | ~GFTrack () |
void | reset () |
Resets the GFTrack – deletes RecoHits! More... | |
int | getFailedHits (int repId=-1) |
return the number of failed Hits in track fit repId == -1 will use cardinal rep More... | |
std::vector< GFAbsRecoHit * > | getHits () |
const GFTrackCand & | getCand () const |
GFAbsRecoHit * | getHit (int id) const |
unsigned int | getNumHits () const |
void | mergeHits (GFTrack *trk) |
Merge two GFTracks. Only hits will be merged. More... | |
void | releaseHits () |
Clear hit vector. Note that hits will not be deleted! More... | |
void | releaseTrackReps () |
Clear TrackRep vector. Note that the Reps will not be deleted! More... | |
unsigned int | getNextHitToFit () const |
Accessor for fNextHitToFit. More... | |
void | setNextHitToFit (unsigned int i) |
Set next hit to be used in a fit. More... | |
GFAbsTrackRep * | getTrackRep (int id) const |
Accessor for track representations. More... | |
unsigned int | getNumReps () const |
Get number of track represenatations. More... | |
GFAbsTrackRep * | getCardinalRep () const |
Get cardinal track representation. More... | |
TVector3 | getMom () const |
Get momentum at the present position. More... | |
TVector3 | getMom (const GFDetPlane &pl) const |
Get momentum at GFDetPlane. More... | |
TVector3 | getPos () const |
Get present position. More... | |
TVector3 | getPos (const GFDetPlane &pl) const |
Get position at GFDetPlane. More... | |
void | getPosMomCov (TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov) |
Get position, momentum, and 6x6 covariance at current position. More... | |
void | getPosMomCov (const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov) |
Get position, momentum, and 6x6 covariance at GFDetPlane. More... | |
double | getChiSqu () const |
Get chi2. More... | |
unsigned int | getNDF () const |
Get NDF. More... | |
double | getRedChiSqu () const |
Get chi2/NDF. More... | |
double | getCharge () const |
Get charge from fit. More... | |
void | fillGeoTrack (TVirtualGeoTrack *tr) const |
Fill TVirtualGeoTrack object Cardinal representation is used. More... | |
void | fillGeoTrack (TVirtualGeoTrack *tr, unsigned int repid) const |
Fill TVirtualGeoTrack object with data from specified track rep. More... | |
void | addFailedHit (unsigned int irep, unsigned int id) |
void | addHit (GFAbsRecoHit *theHit) |
deprecated! More... | |
void | addHit (GFAbsRecoHit *theHit, unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0) |
Add single hit. Updates the GFTrackCand. More... | |
void | addHitVector (std::vector< GFAbsRecoHit * > hits) |
Add collection of hits. More... | |
void | addTrackRep (GFAbsTrackRep *theTrackRep) |
Add track represenation. More... | |
GFBookkeeping * | getBK (int index=-1) |
get GFBookKeeping object for particular track rep (default is cardinal rep) More... | |
void | setCandidate (const GFTrackCand &cand, bool doreset=false) |
set track candidate More... | |
void | setCardinalRep (unsigned int r) |
Choose cardinal track represenatation. More... | |
void | getResiduals (unsigned int detId, unsigned int dim, unsigned int rep, std::vector< double > &result) |
Get residuals. More... | |
void | setRepAtHit (unsigned int irep, int ihit) |
set the hit index at which plane,state&cov of rep irep is defined More... | |
int | getRepAtHit (unsigned int irep) |
get the hit index at which plane,state&cov of rep irep is defined More... | |
void | clearRepAtHit () |
clear the hit indices at which plane,state&cov of reps are defined More... | |
void | printBookkeeping () |
print bookkeeping More... | |
void | Print () |
void | clearBookkeeping () |
void | clearFailedHits () |
void | getHitsByPlane (std::vector< std::vector< int > * > &retVal) |
void | setSmoothing (bool smooth=true) |
Switch smoothing on or off for this track. More... | |
bool | getSmoothing () |
Read back if smoothing is/was turned on or off for this track. More... | |
void | blowUpCovs (double blowUpFactor) |
this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and blows up diagonal by blowUpFactor More... | |
Private Attributes | |
TObjArray * | fTrackReps |
Collection of track representations. More... | |
std::vector< GFAbsRecoHit * > | fHits |
Collection of RecoHits. More... | |
std::vector< GFBookkeeping * > | fBookkeeping |
Collection of Bookeeping objects for failed hits in every trackrep. More... | |
std::vector< int > | fRepAtHit |
repAtHit keeps track of at which hit index which rep is currently defined, to avoid null extrapolations More... | |
GFTrackCand | fCand |
Helper to store the indices of the hits in the track. See GFTrackCand for details. More... | |
unsigned int | fCardinal_rep |
unsigned int | fNextHitToFit |
bool | fSmooth |
Static Private Attributes | |
static const int | fDefNumTrackReps = 10 |
Track object for genfit. genfit algorithms work on these objects.
Can be used as transient (only in memory) or persistent (written to ROOT-file) object.
A GFTrack contains a collection of RecoHits plus a collection of track representations. The GFTrackCand member is a helper object to store the indices of the hits in the GFTrack.
For a GFTrack one so called "cardinal representation" can be defined. It is that track representation that is used to access the fit results. Usually one will after the fit choose the best fitting representation to be the cardinal rep.
The GFTRack takes ownership over the GFAbsRecoHit pointers it holds.
GFTrack::GFTrack | ( | ) |
Default constructor – needed for compatibility with ROOT.
Definition at line 32 of file GFTrack.cxx.
GFTrack::GFTrack | ( | const GFTrack & | _tr | ) |
Copy constructor.
Definition at line 53 of file GFTrack.cxx.
References addTrackRep(), fBookkeeping, fCand, fCardinal_rep, fHits, fNextHitToFit, fRepAtHit, fSmooth, fTrackReps, getHit(), getNumHits(), getNumReps(), getTrackRep(), and i.
GFTrack::GFTrack | ( | GFAbsTrackRep * | defaultRep, |
bool | smooth = false |
||
) |
Initializing constructor.
A track needs at least one track representation to be useable. The given track representation has to contain starting values for the fit!
Definition at line 25 of file GFTrack.cxx.
References addTrackRep(), and fSmooth.
|
virtual |
Definition at line 38 of file GFTrack.cxx.
References fBookkeeping, fHits, fTrackReps, getNumReps(), and i.
|
inline |
Definition at line 284 of file GFTrack.h.
Referenced by GFKalman::fittingPass().
|
inline |
deprecated!
Definition at line 291 of file GFTrack.h.
Referenced by mergeHits(), and GFDaf::processTrack().
|
inline |
Add single hit. Updates the GFTrackCand.
Definition at line 297 of file GFTrack.h.
References GFTrackCand::addHit().
|
inline |
Add collection of hits.
This is the standard way to fill the track with hit data
Definition at line 310 of file GFTrack.h.
References hits.
Referenced by PndHypDKalmanTask::Exec(), PndLmdKalmanTask::Exec(), PndRecoDafFit::Fit(), and PndRecoKalmanFit::Fit().
|
inline |
Add track represenation.
The given track representation has to contain starting values for fit!
Definition at line 318 of file GFTrack.h.
Referenced by GFTrack(), operator=(), and GFDaf::processTrack().
void GFTrack::blowUpCovs | ( | double | blowUpFactor | ) |
this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and blows up diagonal by blowUpFactor
Definition at line 257 of file GFTrack.cxx.
References GFAbsTrackRep::getCov(), getNumReps(), GFAbsTrackRep::getStatusFlag(), getTrackRep(), i, and GFAbsTrackRep::setCov().
Referenced by GFKalman::blowUpCovs().
|
inline |
Definition at line 383 of file GFTrack.h.
References getNumReps(), and i.
|
inline |
Definition at line 389 of file GFTrack.h.
References getNumReps(), and i.
|
inline |
clear the hit indices at which plane,state&cov of reps are defined
Definition at line 371 of file GFTrack.h.
References getNumReps(), and i.
Referenced by GFKalman::processTrack().
|
inline |
Fill TVirtualGeoTrack object Cardinal representation is used.
Definition at line 274 of file GFTrack.h.
References fillGeoTrack().
Referenced by fillGeoTrack().
void GFTrack::fillGeoTrack | ( | TVirtualGeoTrack * | tr, |
unsigned int | repid | ||
) | const |
Fill TVirtualGeoTrack object with data from specified track rep.
Definition at line 160 of file GFTrack.cxx.
References fCand, fHits, GFTrackCand::getNHits(), GFAbsTrackRep::getPos(), GFAbsTrackRep::getState(), getTrackRep(), i, n, and pos.
|
inline |
get GFBookKeeping object for particular track rep (default is cardinal rep)
Definition at line 326 of file GFTrack.h.
References getNumReps().
Referenced by GFDaf::copySmoothing(), GFKalman::fittingPass(), GFTools::getBiasedSmoothedData(), GFTools::getSmoothedData(), GFTools::getSmoothingPlane(), GFKalman::processHit(), and GFKalman::processTrack().
|
inline |
Definition at line 142 of file GFTrack.h.
References fCand.
Referenced by PndHypMicroIdealWriter::Exec(), PndHypMicroWriter::Exec(), PndHypDKalmanTask::Exec(), PndLmdKalmanTask::Exec(), PndRecoDafFit::Fit(), PndRecoKalmanFit::Fit(), GenfitTrack2PndTrack(), and mergeHits().
|
inline |
Get cardinal track representation.
The user has to choose which track rep should be considered the best one after the fit. Usually the track representation giving the smallest chi2 is choosen. By default the first in the list is returned.
Definition at line 202 of file GFTrack.h.
Referenced by PndHypMicroIdealWriter::Exec(), PndHypMicroWriter::Exec(), PndHypDKalmanTask::Exec(), for(), GenfitTrack2PndTrack(), getCharge(), getChiSqu(), getMom(), getNDF(), getPos(), getPosMomCov(), getRedChiSqu(), and trackProximity().
|
inline |
Get charge from fit.
Cardinal representation is used.
Definition at line 270 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getCharge().
|
inline |
Get chi2.
Cardinal representation is used.
Definition at line 252 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getChiSqu().
Referenced by PndHypDKalmanTask::Exec(), PndLmdKalmanTask::Exec(), and GenfitTrack2PndTrack().
|
inline |
return the number of failed Hits in track fit repId == -1 will use cardinal rep
Definition at line 133 of file GFTrack.h.
References fCardinal_rep.
|
inline |
Definition at line 144 of file GFTrack.h.
Referenced by GFDaf::calcWeights(), GFDaf::copySmoothing(), GFTools::getBiasedSmoothedCov(), GFTools::getBiasedSmoothedPos(), getResiduals(), GFTools::getSmoothedChiSqu(), GFTools::getSmoothedCov(), GFTools::getSmoothedPos(), GFTrack(), GFDaf::initHitsWeights(), mergeHits(), operator=(), GFKalman::processHit(), and GFDaf::processTrack().
|
inline |
void GFTrack::getHitsByPlane | ( | std::vector< std::vector< int > * > & | retVal | ) |
use planeId information of GFTrackCand and return by ref groups of hit ids which are in the same planes.
Definition at line 227 of file GFTrack.cxx.
References fCand, fHits, GFTrackCand::getHitWithPlane(), GFTrackCand::getNHits(), i, and push_back().
Referenced by GFDaf::initHitsWeights().
|
inline |
Get momentum at the present position.
Cardinal representation is used.
Definition at line 209 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getMom().
Referenced by PndHypDKalmanTask::Exec().
|
inline |
Get momentum at GFDetPlane.
The track will be extrapolated to GFDetPlane to get the momentum there. The track will not be modified. Cardinal representation is used.
Definition at line 216 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getMom().
|
inline |
Get NDF.
Cardinal representation is used.
Definition at line 258 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getNDF().
Referenced by GenfitTrack2PndTrack().
|
inline |
Accessor for fNextHitToFit.
Definition at line 178 of file GFTrack.h.
References fNextHitToFit.
Referenced by GFKalman::fittingPass().
|
inline |
Definition at line 148 of file GFTrack.h.
Referenced by GFDaf::calcWeights(), GFDaf::copySmoothing(), PndHypDKalmanTask::Exec(), PndLmdKalmanTask::Exec(), PndRecoDafFit::Fit(), PndRecoKalmanFit::Fit(), GFKalman::fittingPass(), GFTools::getBiasedSmoothedData(), getResiduals(), GFTools::getSmoothedData(), GFTrack(), mergeHits(), operator=(), Print(), GFDaf::processTrack(), and GFKalman::processTrack().
|
inline |
Get number of track represenatations.
Definition at line 192 of file GFTrack.h.
Referenced by blowUpCovs(), clearBookkeeping(), clearFailedHits(), clearRepAtHit(), GFDaf::copySmoothing(), PndHypDKalmanTask::Exec(), GFKalman::fittingPass(), getBK(), getRepAtHit(), getResiduals(), GFTrack(), GFDaf::initHitsWeights(), operator=(), Print(), printBookkeeping(), GFDaf::processTrack(), GFKalman::processTrack(), reset(), setCandidate(), setRepAtHit(), GFKalman::switchDirection(), and ~GFTrack().
|
inline |
Get present position.
Cardinal representation is used.
Definition at line 222 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getPos().
Referenced by PndHypDKalmanTask::Exec().
|
inline |
Get position at GFDetPlane.
The track will be extrapolated to GFDetPlane to get the position there. The track will not be modified. Cardinal representation is used.
Definition at line 229 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getPos().
|
inline |
Get position, momentum, and 6x6 covariance at current position.
Cardinal representation is used.
Definition at line 235 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getPosMomCov().
|
inline |
Get position, momentum, and 6x6 covariance at GFDetPlane.
The track will be extrapolated to GFDetPlane to get everything there. The track will not be modified. Cardinal representation is used.
Definition at line 244 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getPosMomCov().
|
inline |
Get chi2/NDF.
Cardinal representation is used.
Definition at line 264 of file GFTrack.h.
References getCardinalRep(), and GFAbsTrackRep::getRedChiSqu().
Referenced by PndHypDKalmanTask::Exec().
|
inline |
get the hit index at which plane,state&cov of rep irep is defined
Definition at line 364 of file GFTrack.h.
References getNumReps().
Referenced by GFKalman::processHit().
void GFTrack::getResiduals | ( | unsigned int | detId, |
unsigned int | dim, | ||
unsigned int | rep, | ||
std::vector< double > & | result | ||
) |
Get residuals.
detId | which detector? |
dim | = index of coordinate to choose from resiudal vector |
rep | which track representation? |
result | results are written to this vector |
Definition at line 175 of file GFTrack.cxx.
References GFAbsTrackRep::extrapolate(), fCand, GFAbsRecoHit::getDetPlane(), GFAbsTrackRep::getDim(), GFTrackCand::getHit(), getHit(), getNumHits(), getNumReps(), GFAbsTrackRep::getState(), getTrackRep(), hit(), nhits, res, and GFAbsRecoHit::residualVector().
|
inline |
Read back if smoothing is/was turned on or off for this track.
Definition at line 405 of file GFTrack.h.
References fSmooth.
Referenced by GFTools::getBiasedSmoothedData(), GFTools::getSmoothedData(), GFDaf::processTrack(), and GFKalman::processTrack().
|
inline |
Accessor for track representations.
Definition at line 186 of file GFTrack.h.
Referenced by blowUpCovs(), GFDaf::calcWeights(), GFDaf::copySmoothing(), PndHypMicroIdealWriter::Exec(), PndHypMicroWriter::Exec(), PndHypDKalmanTask::Exec(), fillGeoTrack(), GFKalman::fittingPass(), for(), GFTools::getBiasedSmoothedCov(), GFTools::getBiasedSmoothedData(), GFTools::getBiasedSmoothedPos(), getResiduals(), GFTools::getSmoothedChiSqu(), GFTools::getSmoothedCov(), GFTools::getSmoothedData(), GFTools::getSmoothedPos(), GFTrack(), operator=(), Print(), GFKalman::processHit(), GFDaf::processTrack(), GFKalman::processTrack(), and GFKalman::switchDirection().
void GFTrack::mergeHits | ( | GFTrack * | trk | ) |
Merge two GFTracks. Only hits will be merged.
All hits from trk will be merged into this GFTrack. trk will be empty afterwards.
Kalman::continueTrack can be used to include the newly added hits in the fit.
Note that the new hits are inserted at the end of the present track!
Definition at line 134 of file GFTrack.cxx.
References addHit(), fHits, getCand(), GFTrackCand::getHit(), getHit(), getNumHits(), hit(), i, and nhits.
assignement operator
Definition at line 75 of file GFTrack.cxx.
References addTrackRep(), GFAbsTrackRep::clone(), fBookkeeping, fCand, fCardinal_rep, fHits, fNextHitToFit, fRepAtHit, fSmooth, fTrackReps, getHit(), getNumHits(), getNumReps(), getTrackRep(), and i.
void GFTrack::Print | ( | ) |
Definition at line 217 of file GFTrack.cxx.
References fBookkeeping, getNumHits(), getNumReps(), getTrackRep(), i, and GFAbsTrackRep::Print().
Referenced by PndLmdKalmanTask::Exec().
void GFTrack::printBookkeeping | ( | ) |
print bookkeeping
Definition at line 208 of file GFTrack.cxx.
References fBookkeeping, getNumReps(), and i.
|
inline |
|
inline |
Clear TrackRep vector. Note that the Reps will not be deleted!
Be carefull not to create memory leaks here.
Definition at line 174 of file GFTrack.h.
Referenced by GFDaf::processTrack().
void GFTrack::reset | ( | ) |
Resets the GFTrack – deletes RecoHits!
Definition at line 116 of file GFTrack.cxx.
References fBookkeeping, fHits, fRepAtHit, fTrackReps, getNumReps(), and i.
Referenced by setCandidate().
void GFTrack::setCandidate | ( | const GFTrackCand & | cand, |
bool | doreset = false |
||
) |
set track candidate
Definition at line 148 of file GFTrack.cxx.
References fCand, fTrackReps, getNumReps(), i, and reset().
Referenced by PndHypKalmanTask::Exec(), PndLmdKalmanTask::Exec(), PndHypDPatternRecoTask::Exec(), PndRecoDafFit::Fit(), and PndRecoKalmanFit::Fit().
|
inline |
Choose cardinal track represenatation.
Definition at line 339 of file GFTrack.h.
References GetEntriesFast(), and r.
|
inline |
Set next hit to be used in a fit.
Definition at line 182 of file GFTrack.h.
References i.
Referenced by GFKalman::fittingPass(), and GFKalman::processTrack().
|
inline |
set the hit index at which plane,state&cov of rep irep is defined
Definition at line 357 of file GFTrack.h.
References getNumReps().
Referenced by GFKalman::processHit().
|
inline |
Switch smoothing on or off for this track.
Definition at line 401 of file GFTrack.h.
Referenced by GFDaf::processTrack().
|
private |
Collection of Bookeeping objects for failed hits in every trackrep.
Definition at line 83 of file GFTrack.h.
Referenced by GFTrack(), operator=(), Print(), printBookkeeping(), reset(), and ~GFTrack().
|
private |
Helper to store the indices of the hits in the track. See GFTrackCand for details.
Definition at line 93 of file GFTrack.h.
Referenced by fillGeoTrack(), getCand(), getHitsByPlane(), getResiduals(), GFTrack(), operator=(), and setCandidate().
|
private |
Definition at line 96 of file GFTrack.h.
Referenced by getFailedHits(), GFTrack(), and operator=().
|
private |
Collection of RecoHits.
Definition at line 77 of file GFTrack.h.
Referenced by fillGeoTrack(), getHits(), getHitsByPlane(), GFTrack(), mergeHits(), operator=(), reset(), and ~GFTrack().
|
private |
Definition at line 98 of file GFTrack.h.
Referenced by getNextHitToFit(), GFTrack(), and operator=().
|
private |
repAtHit keeps track of at which hit index which rep is currently defined, to avoid null extrapolations
Definition at line 88 of file GFTrack.h.
Referenced by GFTrack(), operator=(), and reset().
|
private |
Definition at line 100 of file GFTrack.h.
Referenced by getSmoothing(), GFTrack(), and operator=().
|
private |
Collection of track representations.
this array is only to be added to in the addTrackRep method because the synchronized construction of bookkeeping objects and repAtHit array is ensured there. NEVER delete elements from this array! If this functionality will be need, it has to be done synchronized with bookkeeping!!
Definition at line 73 of file GFTrack.h.
Referenced by GFTrack(), operator=(), reset(), setCandidate(), and ~GFTrack().