Belle II Software development
V0FinderModule.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/v0Finding/fitter/V0Fitter.h>
11#include <tracking/v0Finding/fitter/NewV0Fitter.h>
12
13#include <mdst/dataobjects/Track.h>
14
15#include <framework/datastore/StoreArray.h>
16#include <framework/core/Module.h>
17
18#include <string>
19#include <memory>
20
21namespace Belle2 {
37 class V0FinderModule : public Module {
38
39 public:
40
43
45 ~V0FinderModule() override = default;
46
48 void initialize() override;
49
51 void event() override;
52
54 void terminate() override;
55
56 private:
57
58 std::string m_arrayNameTrack;
60
61 std::unique_ptr<V0Fitter> m_v0Fitter;
62 std::unique_ptr<NewV0Fitter> m_newV0Fitter;
65 std::string m_arrayNameTFResult;
66 std::string m_arrayNameV0;
67
71 double m_precutRho;
75
77 std::tuple<double, double> m_invMassRangeKshort = { 0.425, 0.575 };
79 std::tuple<double, double> m_invMassRangeLambda = { 1.09, 1.14 };
81 std::tuple<double, double> m_invMassRangePhoton = { 0, 0.1 };
82
84
86 std::tuple<double, double> m_preFilterMassRangeKshort = { 0.45, Const::K0Mass + 0.015 };
88 std::tuple<double, double> m_preFilterMassRangeLambda = { Const::Lambda.getMass() - 0.03, Const::Lambda.getMass() + 0.03 };
89
97 bool isTrackPairSelected(const Track* track1, const Track* track2);
98
107 bool preFilterTracks(const Track* trackPlus, const Track* trackMinus, const Const::ParticleType& v0Hypothesis);
108
115 void fitAndStore(const Track* trackPlus, const Track* trackMinus, const Const::ParticleType& v0Hypothesis);
116
117 // buffer some variables to speed up time, actual values will be calculated at initialization
118 double m_mKshortMin2 = 0;
119 double m_mKshortMax2 = 0;
120 double m_mLambdaMin2 = 0;
121 double m_mLambdaMax2 = 0;
122
123 // counter for V0Finder statistics
124 int m_allStored = 0;
127 };
129}
The ParticleType class for identifying different particle types.
Definition: Const.h:408
double getMass() const
Particle mass.
Definition: UnitConst.cc:356
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:679
static const double K0Mass
neutral kaon mass
Definition: Const.h:693
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
V0 finder module.
std::tuple< double, double > m_preFilterMassRangeKshort
range for reconstructed Kshort mass used for pre-selection
int m_allStored
counter for all saved V0s
~V0FinderModule() override=default
Acknowledgement of destructor.
std::string m_arrayNameCopiedRecoTrack
StoreArray name of the RecoTracks.
std::string m_arrayNameV0
StoreArray name of the V0 (Output).
void initialize() override
Registration of StoreArrays, Relations, check proper GenFit setup.
std::tuple< double, double > m_preFilterMassRangeLambda
range for reconstructed Lambda mass used for pre-selection
bool isTrackPairSelected(const Track *track1, const Track *track2)
Track pair preselection based on a point-of-closest-approach of two tracks.
void fitAndStore(const Track *trackPlus, const Track *trackMinus, const Const::ParticleType &v0Hypothesis)
V0 fitting and storing.
void event() override
Creates Belle2::V0s from Belle2::Tracks as described in the class documentation.
int m_nForceStored
counter for saved V0s failing to remove the inner hits
std::string m_arrayNameTFResult
StoreArray name of the TrackFitResults (In- and Output).
double m_mKshortMax2
pre-calculated maximum Kshort mass squared
bool m_useValidation
on true save also fitted vertices in V0ValidationVertex StoreArray
std::string m_arrayNameV0ValidationVertex
StoreArray name of the V0ValidationVertex.
void terminate() override
Prints status summary.
double m_mLambdaMin2
pre-calculated minimum Lambda mass squared
double m_beamPipeRadius
Radius where inside/outside beampipe is defined.
V0FinderModule()
Setting of module description, parameters.
double m_mLambdaMax2
pre-calculated maximum Lambda mass squared
std::tuple< double, double > m_invMassRangePhoton
range for reconstructed Photon mass used after removing material effects and inner hits
double m_precutRho
preselection cut on transverse radius of the track pair POCA
std::unique_ptr< V0Fitter > m_v0Fitter
Object containing the actual algorithm.
StoreArray< Track > m_tracks
Actually array of mdst Tracks.
bool m_useNewV0Fitter
toggle between old (false) and new (true) V0 fitter
int m_nHitRemoved
counter for saved V0s successfully removing the inner hits
double m_vertexChi2CutOutside
Chi2 cut for V0s outside of the beampipe. Applies to all.
std::string m_arrayNameRecoTrack
StoreArray name of the RecoTracks (Input).
bool preFilterTracks(const Track *trackPlus, const Track *trackMinus, const Const::ParticleType &v0Hypothesis)
Helper function that gets the approximate mass range for the two given tracks and rejects candidates ...
int m_v0FitterMode
fitter mode
std::unique_ptr< NewV0Fitter > m_newV0Fitter
Object containing the actual algorithm.
double m_precutCosAlpha
preselection cut on opening angle of the track pair
std::tuple< double, double > m_invMassRangeKshort
range for reconstructed Kshort mass used after removing material effects and inner hits
std::tuple< double, double > m_invMassRangeLambda
range for reconstructed Lambda mass used after removing material effects and inner hits
std::string m_arrayNameTrack
StoreArray name of the Tracks (Input).
double m_mKshortMin2
pre-calculated minimum Kshort mass squared
Abstract base class for different kinds of events.