Belle II Software development
KalmanFilter.h
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#pragma once
9
10#include <tracking/trackingUtilities/filters/base/Filter.dcl.h>
11#include <tracking/trackingUtilities/numerics/WithWeight.h>
12#include <genfit/MeasuredStateOnPlane.h>
13
14#include <vector>
15#include <framework/logging/Logger.h>
16
17namespace Belle2 {
30 template <class AState, class AKalmanStepper>
31 class KalmanFilter : public
32 TrackingUtilities::Filter<std::pair<const std::vector<TrackingUtilities::WithWeight<const AState*>>, AState*>> {
33 public:
35 TrackingUtilities::Weight operator()(const std::pair<const std::vector<TrackingUtilities::WithWeight<const AState*>>, AState*>&
36 pair)
37 override
38 {
39 AState* currentState = pair.second;
40
41 B2ASSERT("Can not update with nothing", currentState->mSoPSet());
42 genfit::MeasuredStateOnPlane measuredStateOnPlane = currentState->getMeasuredStateOnPlane();
43
44 const double chi2 = m_kalmanStepper.kalmanStep(measuredStateOnPlane, *currentState);
45
46 currentState->setChi2(chi2);
47 currentState->setMeasuredStateOnPlane(measuredStateOnPlane);
48
49 return chi2;
50 }
51
52 private:
54 AKalmanStepper m_kalmanStepper;
55 };
56
57}
Filter which can be used on a pair of path (vector of states) and states, which will call the kalmanS...
TrackingUtilities::Weight operator()(const std::pair< const std::vector< TrackingUtilities::WithWeight< const AState * > >, AState * > &pair) override
Call the kalmanStep and update the new state and its chi2.
AKalmanStepper m_kalmanStepper
The used stepper algorithm.
Base class for filters on a generic object type.
Definition Filter.dcl.h:31
A mixin class to attach a weight to an object.
Definition WithWeight.h:24
STL class.
Abstract base class for different kinds of events.