Belle II Software development
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/trackFindingCDC/utilities/StringManipulation.h>
11#include <tracking/trackFitting/fitter/base/TrackFitter.h>
12#include <tracking/dataobjects/RecoTrack.h>
13
14#include <framework/core/ModuleParamList.h>
15
16using namespace Belle2;
17
18void TrackFitterAndDeleter::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
19{
20 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "trackFitType"),
21 m_trackFitType, "Type of track fit algorithm to use the corresponding DAFParameter, the list is defined in DAFConfiguration class.",
23}
24
25void TrackFitterAndDeleter::apply(std::vector<RecoTrack*>& recoTracks)
26{
28 for (RecoTrack* recoTrack : recoTracks) {
29 trackFitter.fit(*recoTrack);
30 }
31
32 // Remove all non-fitted tracks
33 const auto trackWasNotFitted = [](RecoTrack * recoTrack) {
34 return not recoTrack->wasFitSuccessful();
35 };
36 TrackFindingCDC::erase_remove_if(recoTracks, trackWasNotFitted);
37}
ETrackFitType
Enum for identifying the type of track fit algorythm ( or cosmic)
The Module parameter list class.
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.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) override
Expose the parameters of the sub findlets.
int m_trackFitType
Track Fit type to select the proper DAFParameter from DAFConfiguration; by default c_Default.
Algorithm class to handle the fitting of RecoTrack objects.
bool fit(RecoTrack &recoTrack, genfit::AbsTrackRep *trackRepresentation, bool resortHits=false) const
Fit a reco track with a given non-default track representation.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.