31 #include "TObjArray.h" 37 class TVirtualGeoTrack;
80 std::vector<GFAbsRecoHit*>
fHits;
154 return fBookkeeping.at(theRep)->getNumFailed();
200 unsigned int getNumReps()
const {
return fTrackReps->GetEntriesFast(); }
243 void getPosMomCov(TVector3& pos, TVector3& mom, TMatrixT<Double_t>& cov)
288 void fillGeoTrack(TVirtualGeoTrack* tr,
unsigned int repid)
const;
296 fBookkeeping.at(irep)->addFailedHit(
id);
309 unsigned int planeId = 0)
311 fHits.push_back(theHit);
312 fCand.
addHit(detId, hitId, rho, planeId);
327 if (fTrackReps == NULL) fTrackReps =
new TObjArray(fDefNumTrackReps);
328 fTrackReps->Add(theTrackRep);
330 fRepAtHit.push_back(-1);
336 if (index == -1)
return fBookkeeping.at(fCardinal_rep);
338 throw GFException(
"genf::GFTrack::getBK(): index out of range", __LINE__, __FILE__)
340 return fBookkeeping.at(index);
352 if ((
int)r < fTrackReps->GetEntriesFast()) fCardinal_rep =
r;
388 std::vector<double>& result);
395 throw GFException(
"genf::GFTrack::setRepAtHit(): index out of range", __LINE__, __FILE__)
397 fRepAtHit.at(irep) = ihit;
405 throw GFException(
"genf::GFTrack::getRepAtHit(): index out of range", __LINE__, __FILE__)
407 return fRepAtHit.at(irep);
414 for (
unsigned int i = 0; i <
getNumReps(); ++i) {
415 fRepAtHit.at(i) = -1;
423 void Print(std::ostream& out = std::cout)
const;
427 for (
unsigned int i = 0; i <
getNumReps(); ++i) {
428 fBookkeeping.at(i)->clearAll();
434 for (
unsigned int i = 0; i <
getNumReps(); ++i) {
435 fBookkeeping.at(i)->clearFailedHits();
446 throw std::logic_error(std::string(__func__) +
"::Print(Option_t*) not available");
void clearRepAtHit()
clear the hit indices at which plane,state&cov of reps are defined
unsigned int getNDF() const
std::vector< Double_t > fHitChi2
std::vector< TVector3 > getHitPlaneUxUyUz()
void printBookkeeping(std::ostream &out=std::cout) const
print bookkeeping
GFTrack & operator=(const GFTrack &)
assignement operator
std::vector< TVector3 > fHitPlaneXYZ
std::vector< TMatrixT< Double_t > > fHitCov
void setNextHitToFit(unsigned int i)
Set next hit to be used in a fit.
TObjArray * fTrackReps
Collection of track representations.
void setRepAtHit(unsigned int irep, int ihit)
set the hit index at which plane,state&cov of rep irep is defined
Generic Interface to magnetic fields in GENFIT.
TVector3 getPos(const GFDetPlane &pl) const
Get position at GFDetPlane.
std::vector< GFBookkeeping * > fBookkeeping
Collection of Bookeeping objects for failed hits in every trackrep.
virtual TVector3 getPos(const GFDetPlane &pl)=0
std::vector< Double_t > getHitChi2()
std::vector< TMatrixT< Double_t > > fHitCov7x7
GFAbsTrackRep * getTrackRep(int id) const
Accessor for track representations.
std::vector< TMatrixT< Double_t > > getHitCov7x7()
std::vector< TMatrixT< Double_t > > getHitState()
std::vector< TVector3 > getHitPlaneU()
std::vector< TMatrixT< Double_t > > fHitMeasCov
virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
method which gets position, momentum and 6x6 covariance matrix
unsigned int fNextHitToFit
std::vector< int > fRepAtHit
repAtHit keeps track of at which hit index which rep is currently defined, to avoid null extrapolatio...
Base Class for genfit track representations. Defines interface for track parameterizations.
std::vector< TMatrixT< Double_t > > fHitUpdate
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
void fillGeoTrack(TVirtualGeoTrack *tr) const
Fill TVirtualGeoTrack object Cardinal representation is used.
void setCardinalRep(unsigned int r)
Choose cardinal track represenatation.
void setHitState(TMatrixT< Double_t > mat)
TVector3 getPos() const
Get present position.
std::vector< TVector3 > fHitPlaneU
GFAbsTrackRep * getCardinalRep() const
Get cardinal track representation.
GFTrackCand fCand
Helper to store the indices of the hits in the track. See GFTrackCand for details.
virtual TVector3 getMom(const GFDetPlane &pl)=0
unsigned int getNumReps() const
Get number of track represenatations.
void setHitMeasuredCov(TMatrixT< Double_t > mat)
void addFailedHit(unsigned int irep, unsigned int id)
GFTrack()
Default constructor – needed for compatibility with ROOT.
GFAbsRecoHit * getHit(int id) const
int getRepAtHit(unsigned int irep)
get the hit index at which plane,state&cov of rep irep is defined
void setHitPlaneV(TVector3 pl)
void releaseHits()
Clear hit vector. Note that hits will not be deleted!
int getFailedHits(int repId=-1)
return the number of failed Hits in track fit repId == -1 will use cardinal rep
unsigned int fCardinal_rep
void setHitPlaneUxUyUz(TVector3 pl)
void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
Get position, momentum, and 6x6 covariance at GFDetPlane.
double getChiSqu() const
Get chi2.
void setHitChi2(Double_t mat)
double getRedChiSqu() const
Get chi2/NDF.
void Print(std::ostream &out=std::cout) const
std::vector< GFAbsRecoHit * > getHits()
virtual double getCharge() const =0
void getResiduals(unsigned int detId, unsigned int dim, unsigned int rep, std::vector< double > &result)
Get residuals.
GFBookkeeping * getBK(int index=-1)
get GFBookKeeping object for particular track rep (default is cardinal rep)
std::vector< TVector3 > getHitPlaneV()
void setHitCov7x7(TMatrixT< Double_t > mat)
void getPosMomCov(TVector3 &pos, TVector3 &mom, TMatrixT< Double_t > &cov)
Get position, momentum, and 6x6 covariance at current position.
void mergeHits(GFTrack *trk)
Merge two GFTracks. Only hits will be merged.
unsigned int getNumHits() const
void addHitVector(std::vector< GFAbsRecoHit * > hits)
Add collection of hits.
unsigned int getNDF() const
Get NDF.
void setHitCov(TMatrixT< Double_t > mat)
void reset()
Resets the GFTrack – deletes RecoHits!
std::vector< GFAbsRecoHit * > fHits
Collection of RecoHits.
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
TVector3 getMom(const GFDetPlane &pl) const
Get momentum at GFDetPlane.
void setHitUpdate(TMatrixT< Double_t > mat)
virtual void Print(Option_t *) const
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
void addHit(unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
std::vector< TVector3 > fHitPlaneV
void getHitsByPlane(std::vector< std::vector< int > * > &retVal)
std::vector< TMatrixT< Double_t > > getHitUpdate()
const GFTrackCand & getCand() const
void addHit(GFAbsRecoHit *theHit)
deprecated!
double getCharge() const
Get charge from fit.
void setHitPlaneXYZ(TVector3 pl)
std::vector< TMatrixT< Double_t > > getHitCov()
void addHit(GFAbsRecoHit *theHit, unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
Add single hit. Updates the GFTrackCand.
std::vector< TMatrixT< Double_t > > getHitMeasuredCov()
std::vector< TMatrixT< Double_t > > fHitState
unsigned int getNextHitToFit() const
Accessor for fNextHitToFit.
std::vector< TVector3 > fHitPlaneUxUyUz
static const int fDefNumTrackReps
void addTrackRep(GFAbsTrackRep *theTrackRep)
Add track represenation.
void setHitPlaneU(TVector3 pl)
double getRedChiSqu() const
returns chi2/ndf
void setCandidate(const GFTrackCand &cand, bool doreset=false)
set track candidate
std::vector< TVector3 > getHitPlaneXYZ()
TVector3 getMom() const
Get momentum at the present position.