Skip to content
Snippets Groups Projects
Unverified Commit cab85167 authored by Nils Braun's avatar Nils Braun Committed by GitHub
Browse files

Merge pull request #71 from GenFit/feature/add-rep-reset

Added a function to reset the fit result for a given rep
parents 3c8c8eb3 94a58c3a
Branches
No related tags found
No related merge requests found
......@@ -259,6 +259,15 @@ class Track : public TObject {
//! get time of flight in ns between to trackPoints (if nullptr, for cardinal rep)
double getTOF(AbsTrackRep* rep = nullptr, int startId = 0, int endId = -1) const;
/**
* Delete the fit status and all the FitStates of the TrackPoints
* for the given hypothesis.
* This is equal to resetting the track for the rep, so another fit
* can start from scratch.
* Useful if you have changed some seeds.
*/
void deleteFittedState(const genfit::AbsTrackRep* rep);
//! Construct a new TrackCand containing the hit IDs of the measurements
/**
* The idea is hat you can get a TrackCand for storing the hit IDs after a track has been fitted.
......
......@@ -505,6 +505,20 @@ void Track::deletePoint(int id) {
void Track::insertMeasurement(AbsMeasurement* measurement, int id) {
insertPoint(new TrackPoint(measurement, this), id);
}
void Track::deleteFittedState(const genfit::AbsTrackRep* rep) {
if(hasFitStatus(rep)) {
delete fitStatuses_.at(rep);
fitStatuses_.erase(rep);
}
// delete FitterInfos related to the deleted TrackRep
for (const auto& trackPoint : trackPoints_) {
if(trackPoint->hasFitterInfo(rep)) {
trackPoint->deleteFitterInfo(rep);
}
}
}
void Track::mergeTrack(const Track* other, int id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment