32 #include "TObjArray.h" 38 class TVirtualGeoTrack;
40 namespace genf {
class GFAbsRecoHit; }
81 std::vector<GFAbsRecoHit*>
fHits;
153 return fBookkeeping.at(theRep)->getNumFailed();
203 return fTrackReps->GetEntriesFast();
288 void fillGeoTrack(TVirtualGeoTrack* tr,
unsigned int repid)
const;
295 fBookkeeping.at(irep)->addFailedHit(
id);
301 fHits.push_back(theHit);
310 unsigned int planeId=0){
311 fHits.push_back(theHit);
328 if(fTrackReps==NULL)fTrackReps=
new TObjArray(fDefNumTrackReps);
329 fTrackReps->Add(theTrackRep);
331 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__).
setFatal();
339 return fBookkeeping.at(
index);
349 void setCardinalRep(
unsigned int r){
if((
int)r<fTrackReps->GetEntriesFast())fCardinal_rep=
r;}
354 void setHitState(TMatrixT<Double_t> mat) {fHitState.push_back(mat);}
355 void setHitCov(TMatrixT<Double_t> mat) {fHitCov.push_back(mat);}
384 std::vector<double>&
result);
391 throw GFException(
"genf::GFTrack::setRepAtHit(): index out of range", __LINE__, __FILE__).
setFatal();
392 fRepAtHit.at(irep) = ihit;
399 throw GFException(
"genf::GFTrack::getRepAtHit(): index out of range", __LINE__, __FILE__).
setFatal();
400 return fRepAtHit.at(irep);
415 void Print(std::ostream& out = std::cout)
const;
419 fBookkeeping.at(i)->clearAll();
425 fBookkeeping.at(i)->clearFailedHits();
436 {
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< TVector3 > getHitPlaneUxUyUz()
std::vector< TMatrixT< Double_t > > getHitUpdate()
std::vector< Double_t > fHitChi2
void printBookkeeping(std::ostream &out=std::cout) const
print bookkeeping
GFTrack & operator=(const GFTrack &)
assignement operator
std::vector< TMatrixT< Double_t > > getHitState()
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.
virtual TVector3 getPos(const GFDetPlane &pl)=0
GFAbsTrackRep * getTrackRep(int id) const
Accessor for track representations.
std::vector< TVector3 > getHitPlaneXYZ()
std::vector< TMatrixT< Double_t > > fHitUpdate
std::vector< TMatrixT< Double_t > > getHitCov()
std::vector< TMatrixT< Double_t > > fHitState
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...
std::vector< TMatrixT< Double_t > > fHitCov7x7
Base Class for genfit track representations. Defines interface for track parameterizations.
std::vector< TVector3 > fHitPlaneV
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.
GFAbsTrackRep * getCardinalRep() const
Get cardinal track representation.
GFTrackCand fCand
Helper to store the indices of the hits in the track. See GFTrackCand for details.
std::vector< TVector3 > getHitPlaneV()
virtual TVector3 getMom(const GFDetPlane &pl)=0
std::vector< Double_t > getHitChi2()
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 > getHitPlaneU()
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.
std::vector< TMatrixT< Double_t > > fHitCov
unsigned int getNumHits() const
std::vector< TMatrixT< Double_t > > getHitCov7x7()
std::vector< TMatrixT< Double_t > > fHitMeasCov
std::vector< TVector3 > fHitPlaneXYZ
void addHitVector(std::vector< GFAbsRecoHit * > hits)
Add collection of hits.
unsigned int getNDF() const
Get NDF.
std::vector< TVector3 > fHitPlaneU
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)
void getHitsByPlane(std::vector< std::vector< int > * > &retVal)
const GFTrackCand & getCand() const
void addHit(GFAbsRecoHit *theHit)
deprecated!
double getCharge() const
Get charge from fit.
std::vector< TVector3 > fHitPlaneUxUyUz
void setHitPlaneXYZ(TVector3 pl)
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< GFBookkeeping * > fBookkeeping
Collection of Bookeeping objects for failed hits in every trackrep.
unsigned int getNextHitToFit() const
Accessor for fNextHitToFit.
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< TMatrixT< Double_t > > getHitMeasuredCov()
TVector3 getMom() const
Get momentum at the present position.