Belle II Software  release-08-01-10
TrackFitterAndDeleter.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <tracking/ckf/general/findlets/TrackFitterAndDeleter.h>
9 #include <tracking/trackFindingCDC/utilities/Algorithms.h>
10 #include <tracking/trackFitting/fitter/base/TrackFitter.h>
11 #include <tracking/dataobjects/RecoTrack.h>
12 
13 using namespace Belle2;
14 
15 void TrackFitterAndDeleter::apply(std::vector<RecoTrack*>& recoTracks)
16 {
17  TrackFitter trackFitter;
18  for (RecoTrack* recoTrack : recoTracks) {
19  trackFitter.fit(*recoTrack);
20  }
21 
22  // Remove all non-fitted tracks
23  const auto trackWasNotFitted = [](RecoTrack * recoTrack) {
24  return not recoTrack->wasFitSuccessful();
25  };
26  TrackFindingCDC::erase_remove_if(recoTracks, trackWasNotFitted);
27 }
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
void apply(std::vector< RecoTrack * > &recoTracks) override
Fit the tracks and remove unfittable ones.
Algorithm class to handle the fitting of RecoTrack objects.
Definition: TrackFitter.h:116
bool fit(RecoTrack &recoTrack, genfit::AbsTrackRep *trackRepresentation) const
Fit a reco track with a given non-default track representation.
Definition: TrackFitter.cc:107
Abstract base class for different kinds of events.