33 #include "TClonesArray.h" 34 #include "TObjArray.h" 39 class TVirtualGeoTrack;
80 std::vector<GFAbsRecoHit*>
fHits;
152 return fBookkeeping.at(theRep)->getNumFailed();
202 return fTrackReps->GetEntriesFast();
244 void getPosMomCov(TVector3& pos,TVector3& mom,TMatrixT<Double_t>& cov){
287 void fillGeoTrack(TVirtualGeoTrack* tr,
unsigned int repid)
const;
294 fBookkeeping.at(irep)->addFailedHit(
id);
300 fHits.push_back(theHit);
309 unsigned int planeId=0){
310 fHits.push_back(theHit);
311 fCand.
addHit(detId,hitId,rho,planeId);
327 if(fTrackReps==NULL)fTrackReps=
new TObjArray(fDefNumTrackReps);
328 fTrackReps->Add(theTrackRep);
330 fRepAtHit.push_back(-1);
335 if(index==-1)
return fBookkeeping.at(fCardinal_rep);
337 throw GFException(
"genf::GFTrack::getBK(): index out of range", __LINE__, __FILE__).
setFatal();
338 return fBookkeeping.at(index);
348 void setCardinalRep(
unsigned int r){
if((
int)r<fTrackReps->GetEntriesFast())fCardinal_rep=r;}
383 std::vector<double>& result);
390 throw GFException(
"genf::GFTrack::setRepAtHit(): index out of range", __LINE__, __FILE__).
setFatal();
391 fRepAtHit.at(irep) = ihit;
398 throw GFException(
"genf::GFTrack::getRepAtHit(): index out of range", __LINE__, __FILE__).
setFatal();
399 return fRepAtHit.at(irep);
414 void Print(std::ostream& out = std::cout)
const;
418 fBookkeeping.at(i)->clearAll();
424 fBookkeeping.at(i)->clearFailedHits();
435 {
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
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.
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.