Belle II Software  release-05-01-25
KalmanRecoFitterModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/modules/fitter/KalmanRecoFitterModule.h>
12 using namespace Belle2;
13 
14 REG_MODULE(KalmanRecoFitter)
15 
16 
18 {
19  setDescription("Kalman Fitter using Genfit. If you have TrackCands, you have to convert them to RecoTracks"
20  "using the RecoTrackCreatorModule first. After that, you probably want to add the measurements from the"
21  "hits using the MeasurementCreatorModule.");
22 
23  addParam("minimumIterations", m_param_minimumIterations,
24  "Minimum number of iterations for the Kalman filter", static_cast<unsigned int>(3));
25  addParam("maximumIterations", m_param_maximumIterations,
26  "Maximum number of iterations for the Kalman filter", static_cast<unsigned int>(10));
27 
28  addParam("numberOfFailedHits", m_param_maxNumberOfFailedHits,
29  "Maximum number of failed hits before aborting the fit.", static_cast<unsigned int>(5));
30 }
31 
32 
34 std::shared_ptr<genfit::AbsFitter> KalmanRecoFitterModule::createFitter() const
35 {
36  std::shared_ptr<genfit::KalmanFitterRefTrack> fitter = std::make_shared<genfit::KalmanFitterRefTrack>();
37  fitter->setMinIterations(m_param_minimumIterations);
38  fitter->setMaxIterations(m_param_maximumIterations);
39  fitter->setMaxFailedHits(m_param_maxNumberOfFailedHits);
40 
41  return fitter;
42 }
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::KalmanRecoFitterModule
Kalman fitter.
Definition: KalmanRecoFitterModule.h:30
Belle2::KalmanRecoFitterModule::m_param_minimumIterations
unsigned int m_param_minimumIterations
Minimum number of iterations for the Kalman filter.
Definition: KalmanRecoFitterModule.h:40
Belle2::KalmanRecoFitterModule::m_param_maxNumberOfFailedHits
unsigned int m_param_maxNumberOfFailedHits
Maximum number of failed hits before aborting the fit.
Definition: KalmanRecoFitterModule.h:43
Belle2::KalmanRecoFitterModule::createFitter
std::shared_ptr< genfit::AbsFitter > createFitter() const override
Create a Kalman fitter.
Definition: KalmanRecoFitterModule.cc:34
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KalmanRecoFitterModule::m_param_maximumIterations
unsigned int m_param_maximumIterations
Maximum number of iterations for the Kalman filter.
Definition: KalmanRecoFitterModule.h:41
Belle2::BaseRecoFitterModule
A base class for all modules that implement a fitter for reco tracks.
Definition: BaseRecoFitterModule.h:27