Belle II Software development
KalmanRecoFitterModule.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
9#include <tracking/modules/fitter/KalmanRecoFitterModule.h>
10using namespace Belle2;
11
12REG_MODULE(KalmanRecoFitter);
13
16{
17 setDescription("Kalman Fitter using Genfit. If you have TrackCands, you have to convert them to RecoTracks"
18 "using the RecoTrackCreatorModule first. After that, you probably want to add the measurements from the"
19 "hits using the MeasurementCreatorModule.");
20
21 addParam("minimumIterations", m_param_minimumIterations,
22 "Minimum number of iterations for the Kalman filter", static_cast<unsigned int>(3));
23 addParam("maximumIterations", m_param_maximumIterations,
24 "Maximum number of iterations for the Kalman filter", static_cast<unsigned int>(10));
25
26 addParam("numberOfFailedHits", m_param_maxNumberOfFailedHits,
27 "Maximum number of failed hits before aborting the fit.", static_cast<unsigned int>(5));
28}
29
30
32std::shared_ptr<genfit::AbsFitter> KalmanRecoFitterModule::createFitter() const
33{
34 std::shared_ptr<genfit::KalmanFitterRefTrack> fitter = std::make_shared<genfit::KalmanFitterRefTrack>();
35 fitter->setMinIterations(m_param_minimumIterations);
36 fitter->setMaxIterations(m_param_maximumIterations);
37 fitter->setMaxFailedHits(m_param_maxNumberOfFailedHits);
38
39 return fitter;
40}
A base class for all modules that implement a fitter for reco tracks.
KalmanRecoFitterModule()
Module for the Kalman Fitter.
unsigned int m_param_maxNumberOfFailedHits
Maximum number of failed hits before aborting the fit.
unsigned int m_param_minimumIterations
Minimum number of iterations for the Kalman filter.
unsigned int m_param_maximumIterations
Maximum number of iterations for the Kalman filter.
std::shared_ptr< genfit::AbsFitter > createFitter() const override
Create a Kalman fitter.
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.