32 #include "TClonesArray.h" 33 #include "TObjArray.h" 38 class TVirtualGeoTrack;
70 TObjArray *fTrackReps;
74 std::vector<GFAbsRecoHit *> fHits;
80 std::vector<GFBookkeeping *> fBookkeeping;
85 std::vector<int> fRepAtHit;
92 static const int fDefNumTrackReps = 10;
93 unsigned int fCardinal_rep;
95 unsigned int fNextHitToFit;
133 theRep = fCardinal_rep;
136 return fBookkeeping.at(theRep)->getNumFailed();
139 std::vector<GFAbsRecoHit *>
getHits() {
return fHits; }
171 fTrackReps->SetOwner(kFALSE);
189 unsigned int getNumReps()
const {
return fTrackReps->GetEntriesFast(); }
268 void fillGeoTrack(TVirtualGeoTrack *tr,
unsigned int repid)
const;
276 assert(irep < fBookkeeping.size());
277 fBookkeeping.at(irep)->addFailedHit(
id);
286 void addHit(
GFAbsRecoHit *theHit,
unsigned int detId,
unsigned int hitId,
double rho = 0.,
unsigned int planeId = 0)
288 fHits.push_back(theHit);
289 fCand.
addHit(detId, hitId, rho, planeId);
304 if (fTrackReps ==
nullptr)
305 fTrackReps =
new TObjArray(fDefNumTrackReps);
306 fTrackReps->Add(theTrackRep);
308 fRepAtHit.push_back(-1);
315 return fBookkeeping.at(fCardinal_rep);
317 return fBookkeeping.at(index);
329 if ((
int)r < fTrackReps->GetEntriesFast())
343 std::vector<double> &result);
350 fRepAtHit.at(irep) = ihit;
358 return fRepAtHit.at(irep);
366 fRepAtHit.at(
i) = -1;
379 fBookkeeping.at(
i)->clearAll();
386 fBookkeeping.at(
i)->clearFailedHits();
TVector3 getPos(const GFDetPlane &pl) const
Get position at GFDetPlane.
Base Class for genfit track representations. Defines interface for track parameterizations.
GFBookkeeping * getBK(int index=-1)
get GFBookKeeping object for particular track rep (default is cardinal rep)
void addFailedHit(unsigned int irep, unsigned int id)
unsigned int getNumHits() const
GFTrack()
Default constructor – needed for compatibility with ROOT.
TVector3 getPos() const
Get present position.
void addHit(GFAbsRecoHit *theHit)
deprecated!
Detector plane genfit geometry class.
Track object for genfit. genfit algorithms work on these objects.
bool getSmoothing()
Read back if smoothing is/was turned on or off for this track.
unsigned int getNextHitToFit() const
Accessor for fNextHitToFit.
void setSmoothing(bool smooth=true)
Switch smoothing on or off for this track.
TVector3 getMom() const
Get momentum at the present position.
void getResiduals(unsigned int detId, unsigned int dim, unsigned int rep, std::vector< double > &result)
Get residuals.
void setCandidate(const GFTrackCand &cand, bool doreset=false)
set track candidate
virtual void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
method which gets position, momentum and 6x6 covariance matrix
void getPosMomCov(const GFDetPlane &pl, TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
Get position, momentum, and 6x6 covariance at GFDetPlane.
double getChiSqu() const
Get chi2.
GFAbsTrackRep * getCardinalRep() const
Get cardinal track representation.
virtual TVector3 getMom(const GFDetPlane &pl)=0
void addHitVector(std::vector< GFAbsRecoHit *> hits)
Add collection of hits.
unsigned int getNDF() const
GFAbsTrackRep * getTrackRep(int id) const
Accessor for track representations.
virtual TVector3 getPos(const GFDetPlane &pl)=0
TVector3 getMom(const GFDetPlane &pl) const
Get momentum at GFDetPlane.
void fillGeoTrack(TVirtualGeoTrack *tr) const
Fill TVirtualGeoTrack object Cardinal representation is used.
void blowUpCovs(double blowUpFactor)
this is needed to blow up the covariance matrix before a fitting pass drops off-diagonal elements and...
void setRepAtHit(unsigned int irep, int ihit)
set the hit index at which plane,state&cov of rep irep is defined
void releaseHits()
Clear hit vector. Note that hits will not be deleted!
void clearRepAtHit()
clear the hit indices at which plane,state&cov of reps are defined
void getPosMomCov(TVector3 &pos, TVector3 &mom, TMatrixT< double > &cov)
Get position, momentum, and 6x6 covariance at current position.
unsigned int getNDF() const
Get NDF.
double getRedChiSqu() const
Get chi2/NDF.
std::vector< GFAbsRecoHit * > getHits()
const GFTrackCand & getCand() const
void reset()
Resets the GFTrack – deletes RecoHits!
Track candidate – a list of cluster indices.
int getRepAtHit(unsigned int irep)
get the hit index at which plane,state&cov of rep irep is defined
void addHit(GFAbsRecoHit *theHit, unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
Add single hit. Updates the GFTrackCand.
GFAbsRecoHit * getHit(int id) const
unsigned int getNumReps() const
Get number of track represenatations.
Base Class for representing a Hit in GENFIT.
int getFailedHits(int repId=-1)
return the number of failed Hits in track fit repId == -1 will use cardinal rep
double getRedChiSqu() const
returns chi2/ndf
void releaseTrackReps()
Clear TrackRep vector. Note that the Reps will not be deleted!
double getCharge() const
Get charge from fit.
void addTrackRep(GFAbsTrackRep *theTrackRep)
Add track represenation.
void addHit(unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
void setCardinalRep(unsigned int r)
Choose cardinal track represenatation.
void mergeHits(GFTrack *trk)
Merge two GFTracks. Only hits will be merged.
GFTrack & operator=(const GFTrack &)
assignement operator
void getHitsByPlane(std::vector< std::vector< int > *> &retVal)
void printBookkeeping()
print bookkeeping
void setNextHitToFit(unsigned int i)
Set next hit to be used in a fit.
virtual double getCharge() const =0