Belle II Software development
KinkFinderModule.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//Object with performing the actual algorithm:
10#include <tracking/kinkFinding/fitter/KinkFitter.h>
11
12#include <tracking/dataobjects/RecoTrack.h>
13#include <mdst/dataobjects/Track.h>
14
15#include <framework/datastore/StoreArray.h>
16#include <framework/core/Module.h>
17
18#include <tracking/dbobjects/KinkFinderParameters.h>
19
20#include <string>
21#include <memory>
22
23namespace Belle2 {
37 class KinkFinderModule : public Module {
38
39 public:
40
43
45 ~KinkFinderModule() override = default;
46
48 void initialize() override;
49
51 void beginRun() override;
52
54 void event() override;
55
57 void terminate() override;
58
59 private:
60
67 void fitAndStore(const Track* trackMother, const Track* trackDaughter, const short filterFlag);
68
74
82 bool ifInCDC(const ROOT::Math::XYZVector& pos);
83
90 bool preFilterMotherTracks(Track const* const track);
91
98 bool preFilterDaughterTracks(Track const* const track);
99
106 bool preFilterTracksToSplit(Track const* const track);
107
126 short isTrackPairSelected(const Track* motherTrack, const Track* daughterTrack);
127
134
140 void setLine(const double tangent, const double offset)
141 {
142 m_tangent = tangent;
143 m_offset = offset;
144 }
145
152 double getLine(const double x) const
153 {
154 return m_tangent * x + m_offset;
155 }
156
157 private:
158 double m_tangent;
159 double m_offset;
160 };
161
162 std::string m_arrayNameTrack;
164
165 std::unique_ptr<KinkFitter> m_kinkFitter;
169 std::string m_arrayNameKink;
170
172
173 // CDC and SVD geometry variables
178 static constexpr double m_cdcInnerWithFirstLayerWall = 15;
180 static constexpr double m_cdcInnerWallWithoutFirstLayer = 17;
182 static constexpr double m_cdcInnerWallWithoutFirstTwoLayers = 18;
184 static constexpr double m_cdcOuterWall = 112;
185 static constexpr double m_svdBeforeOuterLayer = 12;
186
187 // counter for KinkFinder statistics
188 unsigned int m_allStored = 0;
189 unsigned int m_f1Stored = 0;
190 unsigned int m_f2Stored = 0;
191 unsigned int m_f3Stored = 0;
192 unsigned int m_f4Stored = 0;
193 unsigned int m_f5Stored = 0;
194 };
196}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Kink finder module.
unsigned int m_f4Stored
counter for filter 4 saved Kinks
static constexpr double m_cdcInnerWallWithoutFirstLayer
Bigger radius of inner CDC wall [cm].
void fitAndStore(const Track *trackMother, const Track *trackDaughter, const short filterFlag)
Kink fitting and storing.
bool preFilterTracksToSplit(Track const *const track)
Check if the track can be a candidate to be split based on some simple selections.
CDCForwardBackwardWallLine m_cdcBackwardTopWall
Top part of backward CDC wall.
short isTrackPairSelected(const Track *motherTrack, const Track *daughterTrack)
Track pair preselection based on distance between two tracks with different options.
std::string m_arrayNameCopiedRecoTrack
StoreArray name of the RecoTrack used for creating copies.
~KinkFinderModule() override=default
Acknowledgement of destructor.
std::string m_arrayNameKink
StoreArray name of the Kink (Output).
void initialize() override
Registration of StoreArrays, Relations.
static constexpr double m_cdcInnerWithFirstLayerWall
Smaller radius of inner CDC wall [cm].
bool ifInCDC(const ROOT::Math::XYZVector &pos)
Test if the point in space is inside CDC (approximate custom geometry) with respect to shifts from ou...
void event() override
Creates Belle2::Kink from Belle2::Track as described in the class documentation.
std::string m_arrayNameTFResult
StoreArray name of the TrackFitResult (In- and Output).
unsigned int m_f2Stored
counter for filter 2 saved Kinks
DBObjPtr< KinkFinderParameters > m_kinkFinderParameters
kinkFinder parameters Database ObjPtr
unsigned int m_f3Stored
counter for filter 3 saved Kinks
static constexpr double m_cdcInnerWallWithoutFirstTwoLayers
Second bigger radius of inner CDC wall [cm].
bool preFilterMotherTracks(Track const *const track)
Check if the track can be a mother candidate based on some simple selections.
static constexpr double m_svdBeforeOuterLayer
Radius between two outer SVD layers (10.4 and 13.5 cm) [cm].
void terminate() override
Prints status summary.
bool preFilterDaughterTracks(Track const *const track)
Check if the track can be a daughter candidate based on some simple selections.
unsigned int m_f1Stored
counter for filter 1 saved Kinks
void beginRun() override
Read parameters from the database and apply to KinkFitter.
StoreArray< Track > m_tracks
StoreArray of Belle2::Track.
unsigned int m_f5Stored
counter for filter 5 saved Kinks
std::string m_arrayNameRecoTrack
StoreArray name of the RecoTrack (Input).
CDCForwardBackwardWallLine m_cdcForwardBottomWall
Bottom part of forward CDC wall.
unsigned int m_allStored
counter for all saved Kinks
CDCForwardBackwardWallLine m_cdcBackwardBottomWall
Bottom part of backward CDC wall.
bool kinkFitterModeSplitTrack()
Fitter mode 4th bit responsible for turning On/Off track splitting.
static constexpr double m_cdcOuterWall
Radius of outer CDC wall [cm].
CDCForwardBackwardWallLine m_cdcForwardTopWall
Top part of forward CDC wall.
std::string m_arrayNameTrack
StoreArray name of the Belle2::Track (Input).
KinkFinderModule()
Setting of module description, parameters.
std::unique_ptr< KinkFitter > m_kinkFitter
Object containing the algorithm of Kink creation.
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Class that bundles various TrackFitResults.
Definition: Track.h:25
Abstract base class for different kinds of events.
Structure to store the information about forward and backward walls of CDC.
double getLine(const double x) const
Return the y value of the sloping line based on the x value.
double m_offset
offset of the sloping line [cm]
void setLine(const double tangent, const double offset)
Set parameters of slopping line.