LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#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 *) | |
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... | |
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_t > &cov) |
Get position, momentum, and 6x6 covariance at current position. More... | |
void | getPosMomCov (const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &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 | setHitMeasuredCov (TMatrixT< Double_t > mat) |
void | setHitUpdate (TMatrixT< Double_t > mat) |
void | setHitChi2 (Double_t mat) |
void | setHitState (TMatrixT< Double_t > mat) |
void | setHitCov (TMatrixT< Double_t > mat) |
void | setHitCov7x7 (TMatrixT< Double_t > mat) |
void | setHitPlaneXYZ (TVector3 pl) |
void | setHitPlaneUxUyUz (TVector3 pl) |
void | setHitPlaneU (TVector3 pl) |
void | setHitPlaneV (TVector3 pl) |
void | setPDG (int pdgt) |
std::vector< TMatrixT< Double_t > > | getHitMeasuredCov () |
std::vector< TMatrixT< Double_t > > | getHitUpdate () |
std::vector< Double_t > | getHitChi2 () |
std::vector< TMatrixT< Double_t > > | getHitState () |
std::vector< TMatrixT< Double_t > > | getHitCov () |
std::vector< TMatrixT< Double_t > > | getHitCov7x7 () |
std::vector< TVector3 > | getHitPlaneXYZ () |
std::vector< TVector3 > | getHitPlaneUxUyUz () |
std::vector< TVector3 > | getHitPlaneU () |
std::vector< TVector3 > | getHitPlaneV () |
int | getPDG () |
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 (std::ostream &out=std::cout) const |
print bookkeeping More... | |
void | Print (std::ostream &out=std::cout) const |
void | clearBookkeeping () |
void | clearFailedHits () |
void | getHitsByPlane (std::vector< std::vector< int > * > &retVal) |
Private Member Functions | |
virtual void | Print (Option_t *) const |
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... | |
std::vector< TMatrixT< Double_t > > | fHitMeasCov |
std::vector< TMatrixT< Double_t > > | fHitUpdate |
std::vector< TMatrixT< Double_t > > | fHitState |
std::vector< Double_t > | fHitChi2 |
std::vector< TMatrixT< Double_t > > | fHitCov7x7 |
std::vector< TMatrixT< Double_t > > | fHitCov |
std::vector< TVector3 > | fHitPlaneXYZ |
std::vector< TVector3 > | fHitPlaneUxUyUz |
std::vector< TVector3 > | fHitPlaneU |
std::vector< TVector3 > | fHitPlaneV |
int | fPDG |
unsigned int | fCardinal_rep |
unsigned int | fNextHitToFit |
Static Private Attributes | |
static const int | fDefNumTrackReps = 10 |
genf::GFTrack::GFTrack | ( | ) |
Default constructor – needed for compatibility with ROOT.
Definition at line 30 of file GFTrack.cxx.
genf::GFTrack::GFTrack | ( | const GFTrack & | _tr | ) |
Copy constructor.
Definition at line 51 of file GFTrack.cxx.
References addTrackRep(), fBookkeeping, fCand, fCardinal_rep, fHits, fNextHitToFit, fRepAtHit, fTrackReps, getHit(), getNumHits(), getNumReps(), and getTrackRep().
genf::GFTrack::GFTrack | ( | GFAbsTrackRep * | defaultRep | ) |
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 24 of file GFTrack.cxx.
References addTrackRep().
|
virtual |
Definition at line 36 of file GFTrack.cxx.
References fBookkeeping, fHits, fTrackReps, and getNumReps().
|
inline |
Definition at line 293 of file GFTrack.h.
Referenced by genf::GFKalman::fittingPass(), and genf::GFDaf::processTrack().
|
inline |
deprecated!
Definition at line 299 of file GFTrack.h.
Referenced by mergeHits(), trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().
|
inline |
Add single hit. Updates the GFTrackCand.
Definition at line 305 of file GFTrack.h.
References genf::GFTrackCand::addHit().
|
inline |
Add collection of hits.
This is the standard way to fill the track with hit data
Definition at line 318 of file GFTrack.h.
References hits().
|
inline |
Add track represenation.
The given track representation has to contain starting values for fit!
Definition at line 326 of file GFTrack.h.
Referenced by GFTrack(), and operator=().
|
inline |
Definition at line 416 of file GFTrack.h.
References getNumReps().
Referenced by genf::GFDaf::processTrack().
|
inline |
Definition at line 422 of file GFTrack.h.
References getHitsByPlane(), getNumReps(), and lar::dump::vector().
Referenced by genf::GFDaf::processTrack().
|
inline |
clear the hit indices at which plane,state&cov of reps are defined
Definition at line 404 of file GFTrack.h.
References getNumReps(), Print(), and printBookkeeping().
Referenced by genf::GFKalman::processTrack().
|
inline |
Fill TVirtualGeoTrack object Cardinal representation is used.
Definition at line 283 of file GFTrack.h.
References fillGeoTrack().
Referenced by fillGeoTrack().
void genf::GFTrack::fillGeoTrack | ( | TVirtualGeoTrack * | tr, |
unsigned int | repid | ||
) | const |
Fill TVirtualGeoTrack object with data from specified track rep.
Definition at line 151 of file GFTrack.cxx.
References fCand, fHits, genf::GFTrackCand::getNHits(), genf::GFAbsTrackRep::getPos(), genf::GFAbsTrackRep::getState(), getTrackRep(), n, and genf::PrintROOTobject().
|
inline |
get GFBookKeeping object for particular track rep (default is cardinal rep)
Definition at line 334 of file GFTrack.h.
References getNumReps(), setCandidate(), and GFException::setFatal().
Referenced by genf::GFKalman::fittingPass(), and genf::GFDaf::processTrack().
|
inline |
Definition at line 157 of file GFTrack.h.
References fCand.
Referenced by 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 211 of file GFTrack.h.
Referenced by getCharge(), getChiSqu(), getMom(), getNDF(), getPos(), getPosMomCov(), and getRedChiSqu().
|
inline |
Get charge from fit.
Cardinal representation is used.
Definition at line 279 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getCharge().
|
inline |
Get chi2.
Cardinal representation is used.
Definition at line 261 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getChiSqu().
|
inline |
return the number of failed Hits in track fit repId == -1 will use cardinal rep
Definition at line 148 of file GFTrack.h.
References fCardinal_rep.
Referenced by trkf::Track3DKalman::produce(), and trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 159 of file GFTrack.h.
Referenced by getResiduals(), GFTrack(), mergeHits(), operator=(), genf::GFKalman::processHit(), and genf::GFDaf::processTrack().
|
inline |
Definition at line 363 of file GFTrack.h.
References fHitChi2.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 365 of file GFTrack.h.
References fHitCov.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 366 of file GFTrack.h.
References fHitCov.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 361 of file GFTrack.h.
References fHitMeasCov.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 369 of file GFTrack.h.
References fHitPlaneU.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 368 of file GFTrack.h.
References fHitPlaneUxUyUz.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 370 of file GFTrack.h.
References fHitPlaneV.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 367 of file GFTrack.h.
References fHitPlaneXYZ.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 155 of file GFTrack.h.
References fHits.
void genf::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 219 of file GFTrack.cxx.
References fCand, fHits, genf::GFTrackCand::getHitWithPlane(), genf::GFTrackCand::getNHits(), and GFException::setFatal().
Referenced by clearFailedHits(), and genf::GFDaf::processTrack().
|
inline |
Definition at line 364 of file GFTrack.h.
References fHitState.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Definition at line 362 of file GFTrack.h.
References fHitUpdate.
Referenced by trkf::Track3DKalmanSPS::produce().
|
inline |
Get momentum at the present position.
Cardinal representation is used.
Definition at line 218 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getMom().
|
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 225 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getMom().
|
inline |
Get NDF.
Cardinal representation is used.
Definition at line 267 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getNDF().
|
inline |
Accessor for fNextHitToFit.
Definition at line 187 of file GFTrack.h.
References fNextHitToFit.
Referenced by genf::GFKalman::fittingPass().
|
inline |
Definition at line 163 of file GFTrack.h.
References mergeHits().
Referenced by genf::GFKalman::fittingPass(), getResiduals(), GFTrack(), mergeHits(), operator=(), Print(), genf::GFKalman::processHit(), genf::GFDaf::processTrack(), and genf::GFKalman::processTrack().
|
inline |
Get number of track represenatations.
Definition at line 201 of file GFTrack.h.
Referenced by genf::GFDaf::blowUpCovs(), genf::GFKalman::blowUpCovs(), genf::GFKalman::blowUpCovsDiag(), clearBookkeeping(), clearFailedHits(), clearRepAtHit(), genf::GFKalman::fittingPass(), getBK(), getRepAtHit(), getResiduals(), GFTrack(), operator=(), Print(), printBookkeeping(), genf::GFDaf::processTrack(), genf::GFKalman::processTrack(), reset(), setCandidate(), setRepAtHit(), genf::GFKalman::switchDirection(), and ~GFTrack().
|
inline |
Definition at line 372 of file GFTrack.h.
References fPDG, and getResiduals().
Referenced by genf::GFKalman::processHit().
|
inline |
Get present position.
Cardinal representation is used.
Definition at line 231 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getPos().
|
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 238 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getPos().
|
inline |
Get position, momentum, and 6x6 covariance at current position.
Cardinal representation is used.
Definition at line 244 of file GFTrack.h.
References getCardinalRep(), and genf::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 253 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getPosMomCov().
|
inline |
Get chi2/NDF.
Cardinal representation is used.
Definition at line 273 of file GFTrack.h.
References getCardinalRep(), and genf::GFAbsTrackRep::getRedChiSqu().
|
inline |
get the hit index at which plane,state&cov of rep irep is defined
Definition at line 396 of file GFTrack.h.
References getNumReps(), and GFException::setFatal().
Referenced by genf::GFKalman::processHit().
void genf::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 168 of file GFTrack.cxx.
References genf::GFAbsTrackRep::extrapolate(), fCand, genf::GFAbsRecoHit::getDetPlane(), genf::GFAbsTrackRep::getDim(), genf::GFTrackCand::getHit(), getHit(), getNumHits(), getNumReps(), getTrackRep(), and genf::GFAbsRecoHit::residualVector().
Referenced by getPDG().
|
inline |
Accessor for track representations.
Definition at line 195 of file GFTrack.h.
Referenced by genf::GFDaf::blowUpCovs(), genf::GFKalman::blowUpCovs(), genf::GFKalman::blowUpCovsDiag(), fillGeoTrack(), genf::GFKalman::fittingPass(), getResiduals(), GFTrack(), operator=(), Print(), genf::GFKalman::processHit(), genf::GFDaf::processTrack(), genf::GFKalman::processTrack(), and genf::GFKalman::switchDirection().
void genf::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 125 of file GFTrack.cxx.
References addHit(), fHits, getCand(), genf::GFTrackCand::getHit(), getHit(), and getNumHits().
Referenced by getNumHits().
genf::GFTrack & genf::GFTrack::operator= | ( | const GFTrack & | _tr | ) |
assignement operator
Definition at line 71 of file GFTrack.cxx.
References addTrackRep(), genf::GFAbsTrackRep::clone(), fBookkeeping, fCand, fCardinal_rep, fHits, fNextHitToFit, fRepAtHit, fTrackReps, getHit(), getNumHits(), getNumReps(), and getTrackRep().
void genf::GFTrack::Print | ( | std::ostream & | out = std::cout | ) | const |
Definition at line 209 of file GFTrack.cxx.
References fBookkeeping, getNumHits(), getNumReps(), getTrackRep(), and genf::GFAbsTrackRep::Print().
Referenced by clearRepAtHit().
|
inlineprivatevirtual |
void genf::GFTrack::printBookkeeping | ( | std::ostream & | out = std::cout | ) | const |
print bookkeeping
Definition at line 200 of file GFTrack.cxx.
References fBookkeeping, and getNumReps().
Referenced by clearRepAtHit().
|
inline |
Clear hit vector. Note that hits will not be deleted!
Be carefull not to create memory leaks here.
Definition at line 183 of file GFTrack.h.
void genf::GFTrack::reset | ( | ) |
Resets the GFTrack – deletes RecoHits!
Definition at line 110 of file GFTrack.cxx.
References fBookkeeping, fHits, fRepAtHit, fTrackReps, and getNumReps().
Referenced by setCandidate().
void genf::GFTrack::setCandidate | ( | const GFTrackCand & | cand, |
bool | doreset = false |
||
) |
set track candidate
Definition at line 139 of file GFTrack.cxx.
References fCand, fTrackReps, getNumReps(), and reset().
Referenced by getBK().
|
inline |
Choose cardinal track represenatation.
Definition at line 348 of file GFTrack.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Set next hit to be used in a fit.
Definition at line 191 of file GFTrack.h.
Referenced by genf::GFKalman::fittingPass(), and genf::GFKalman::processTrack().
|
inline |
|
inline |
set the hit index at which plane,state&cov of rep irep is defined
Definition at line 388 of file GFTrack.h.
References getNumReps(), and GFException::setFatal().
Referenced by genf::GFKalman::processHit().
|
private |
Collection of Bookeeping objects for failed hits in every trackrep.
Definition at line 86 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 96 of file GFTrack.h.
Referenced by fillGeoTrack(), getCand(), getHitsByPlane(), getResiduals(), GFTrack(), operator=(), and setCandidate().
|
private |
Definition at line 113 of file GFTrack.h.
Referenced by getFailedHits(), GFTrack(), and operator=().
|
staticprivate |
|
private |
Definition at line 102 of file GFTrack.h.
Referenced by getHitChi2().
|
private |
Definition at line 104 of file GFTrack.h.
Referenced by getHitCov(), and getHitCov7x7().
|
private |
|
private |
Definition at line 99 of file GFTrack.h.
Referenced by getHitMeasuredCov().
|
private |
Definition at line 107 of file GFTrack.h.
Referenced by getHitPlaneU().
|
private |
Definition at line 106 of file GFTrack.h.
Referenced by getHitPlaneUxUyUz().
|
private |
Definition at line 108 of file GFTrack.h.
Referenced by getHitPlaneV().
|
private |
Definition at line 105 of file GFTrack.h.
Referenced by getHitPlaneXYZ().
|
private |
Collection of RecoHits.
Definition at line 80 of file GFTrack.h.
Referenced by fillGeoTrack(), getHits(), getHitsByPlane(), GFTrack(), mergeHits(), operator=(), reset(), and ~GFTrack().
|
private |
Definition at line 101 of file GFTrack.h.
Referenced by getHitState().
|
private |
Definition at line 100 of file GFTrack.h.
Referenced by getHitUpdate().
|
private |
Definition at line 115 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 91 of file GFTrack.h.
Referenced by GFTrack(), operator=(), and reset().
|
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 76 of file GFTrack.h.
Referenced by GFTrack(), operator=(), reset(), setCandidate(), and ~GFTrack().