 |
Belle II Software
release-05-02-19
|
24 #ifndef genfit_Track_h
25 #define genfit_Track_h
27 #include "AbsTrackRep.h"
28 #include "FitStatus.h"
29 #include "MeasurementFactory.h"
30 #include "TrackCand.h"
31 #include "TrackPoint.h"
40 class KalmanFitStatus;
51 return lhs->getSortingParameter() < rhs->getSortingParameter();
96 Track(
AbsTrackRep* trackRep,
const TVector3& posSeed,
const TVector3& momSeed);
97 Track(
AbsTrackRep* trackRep,
const TVectorD& stateSeed,
const TMatrixDSym& covSeed);
101 void swap(
Track& other);
104 virtual void Clear(Option_t* =
"");
109 const std::vector< genfit::TrackPoint* > & getPoints()
const {
return trackPoints_;}
110 unsigned int getNumPoints()
const {
return trackPoints_.size();}
112 TrackPoint* getPointWithMeasurement(
int id)
const;
113 const std::vector< genfit::TrackPoint* > & getPointsWithMeasurement()
const {
return trackPointsWithMeasurement_;}
114 unsigned int getNumPointsWithMeasurement()
const {
return trackPointsWithMeasurement_.size();}
130 AbsTrackRep* getTrackRep(
int id)
const {
return trackReps_.at(
id);}
132 const std::vector<genfit::AbsTrackRep*>&
getTrackReps()
const {
return trackReps_;}
133 unsigned int getNumReps()
const {
return trackReps_.size();}
146 unsigned int getCardinalRepId()
const {
return cardinalRep_;}
163 double getTimeSeed()
const {
return timeSeed_;}
164 void setTimeSeed(
double time) {timeSeed_ = time;}
166 const TVectorD& getStateSeed()
const {
return stateSeed_;}
167 void setStateSeed(
const TVectorD& s) {stateSeed_.ResizeTo(s); stateSeed_ = s;}
168 void setStateSeed(
const TVector3& pos,
const TVector3& mom);
170 const TMatrixDSym& getCovSeed()
const {
return covSeed_;}
171 void setCovSeed(
const TMatrixDSym& c) {covSeed_.ResizeTo(c); covSeed_ = c;}
192 void insertPoints(std::vector<genfit::TrackPoint*> points,
int id = -1);
194 void deletePoint(
int id);
216 void setCardinalRep(
int id);
236 stateSeed_(3) *= -1; stateSeed_(4) *= -1; stateSeed_(5) *= -1;
251 void deleteForwardInfo(
int startId = 0,
int endId = -1,
const AbsTrackRep* rep =
nullptr);
252 void deleteBackwardInfo(
int startId = 0,
int endId = -1,
const AbsTrackRep* rep =
nullptr);
253 void deleteReferenceInfo(
int startId = 0,
int endId = -1,
const AbsTrackRep* rep =
nullptr);
254 void deleteMeasurementInfo(
int startId = 0,
int endId = -1,
const AbsTrackRep* rep =
nullptr);
255 void deleteFitterInfo(
int startId = 0,
int endId = -1,
const AbsTrackRep* rep =
nullptr);
260 double getTOF(
AbsTrackRep* rep =
nullptr,
int startId = 0,
int endId = -1)
const;
298 void prune(
const Option_t* =
"CFLWRMIU");
300 void Print(
const Option_t* =
"")
const;
302 void checkConsistency()
const;
306 void trackHasChanged();
308 void fillPointsWithMeasurement();
310 std::vector<AbsTrackRep*> trackReps_;
311 unsigned int cardinalRep_;
313 std::vector<TrackPoint*> trackPoints_;
314 std::vector<TrackPoint*> trackPointsWithMeasurement_;
321 TMatrixDSym covSeed_;
333 #endif // genfit_Track_h
std::map< const AbsTrackRep *, FitStatus * > fitStatuses_
helper
Object containing AbsMeasurement and AbsFitterInfo objects.
Helper class for TrackPoint sorting, used in Track::sort().
void setMcTrackId(int i)
Set the MCT track id, for MC simulations.
void mergeTrack(const Track *other, int id=-1)
Merge two tracks.
void reverseMomSeed()
Flip direction of momentum seed.
void deleteFittedState(const genfit::AbsTrackRep *rep)
Delete the fit status and all the FitStates of the TrackPoints for the given hypothesis.
#StateOnPlane with additional covariance matrix.
Track candidate – seed values and indices.
FitStatus for use with AbsKalmanFitter implementations.
double getTOF(AbsTrackRep *rep=nullptr, int startId=0, int endId=-1) const
get time of flight in ns between to trackPoints (if nullptr, for cardinal rep)
KalmanFitStatus * getKalmanFitStatus(const AbsTrackRep *rep=nullptr) const
If FitStatus is a KalmanFitStatus, return it. Otherwise return nullptr.
const std::vector< genfit::AbsTrackRep * > & getTrackReps() const
Return the track representations as a list of pointers.
FitStatus * getFitStatus(const AbsTrackRep *rep=nullptr) const
Get FitStatus for a AbsTrackRep. Per default, return FitStatus for cardinalRep.
void insertMeasurement(AbsMeasurement *measurement, int id=-1)
Creates a new TrackPoint containing the measurement, and adds it to the track.
void insertPoint(TrackPoint *point, int id=-1)
Insert TrackPoint BEFORE TrackPoint with position id, if id >= 0.
void reverseTrack()
Make track ready to be fitted in reverse direction.
void deleteTrackRep(int id)
Delete a AbsTrackRep and all corresponding AbsFitterInfo objects in every TrackPoint.
Defines for I/O streams used for error and debug printing.
Collection of TrackPoint objects, AbsTrackRep objects and FitStatus objects.
Abstract base class for a track representation.
double getTrackLen(AbsTrackRep *rep=nullptr, int startId=0, int endId=-1) const
get TrackLength between to trackPoints (if nullptr, for cardinal rep)
bool udpateSeed(int id=0, AbsTrackRep *rep=nullptr, bool biased=true)
Try to set the fitted state as seed.
void deleteTrackPointsAndFitStatus()
Delete all measurement information and the track points of the track. Does not delete track represent...
bool hasKalmanFitStatus(const AbsTrackRep *rep=nullptr) const
Check if track has a KalmanFitStatus for given AbsTrackRep. Per default, check for cardinal rep.
void fixWeights(AbsTrackRep *rep=nullptr, int startId=0, int endId=-1)
Helper function: For all KalmanFitterInfos belonging to rep (if nullptr, for all reps),...
Contains the measurement and covariance in raw detector coordinates.
int mcTrackId_
if MC simulation, store the mc track id here
int getIdForRep(const AbsTrackRep *rep) const
This is used when streaming TrackPoints.
const MeasuredStateOnPlane & getFittedState(int id=0, const AbsTrackRep *rep=nullptr, bool biased=true) const
Shortcut to get FittedStates.
void prune(const Option_t *="CFLWRMIU")
Delete unneeded information from the Track.
int getMcTrackId() const
Get the MCT track id, for MC simulations - default value = -1.
void switchPDGSigns(AbsTrackRep *rep=nullptr)
Switch the pdg signs of specified rep (of all reps if rep == nullptr).
void determineCardinalRep()
See with which AbsTrackRep the track was fitted best (converged fit w/ smallest chi2) and set the car...
void insertPoints(std::vector< genfit::TrackPoint * > points, int id=-1)
Insert TrackPoints BEFORE TrackPoint with position id, if id >= 0.
void reverseTrackPoints()
Flip the ordering of the TrackPoints.
bool operator()(const TrackPoint *lhs, const TrackPoint *rhs) const
Comparison operator used in Track::sort().
Class where important numbers and properties of a fit can be stored.
bool hasFitStatus(const AbsTrackRep *rep=nullptr) const
Check if track has a FitStatus for given AbsTrackRep. Per default, check for cardinal rep.
AbsTrackRep * getCardinalRep() const
Get cardinal track representation.
bool sort()
Sort TrackPoint and according to their sorting parameters.
TrackCand * constructTrackCand() const
Construct a new TrackCand containing the hit IDs of the measurements.