Belle II Software  release-06-00-14
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 
12 #include <mdst/dataobjects/Track.h>
13 
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/core/Module.h>
16 
17 #include <string>
18 #include <memory>
19 
20 namespace Belle2 {
42  class V0FinderModule : public Module {
43  public:
46 
48  ~V0FinderModule() override = default;
49 
51  void initialize() override;
52 
54  void event() override;
55 
57  void terminate() override;
58 
59  private:
60 
61  std::string m_arrayNameTrack;
63 
64  std::unique_ptr<V0Fitter> m_v0Fitter;
65  std::string m_arrayNameRecoTrack;
67  std::string m_arrayNameTFResult;
68  std::string m_arrayNameV0;
69 
73 
76  std::tuple<double, double> m_invMassRangeKshort = { 0.425, 0.575 };
79  std::tuple<double, double> m_invMassRangeLambda = { 1.09, 1.14 };
82  std::tuple<double, double> m_invMassRangePhoton = { 0, 0.1 };
83 
84  bool m_validation;
86 
89  std::tuple<double, double> m_preFilterMassRangeKshort = { 0.45, Const::K0Mass + 0.015 };
92  std::tuple<double, double> m_preFilterMassRangeLambda = { Const::Lambda.getMass() - 0.03, Const::Lambda.getMass() + 0.03 };
93 
100  bool preFilterTracks(const Track* trackPlus, const Track* trackMinus, const Const::ParticleType& v0Hypothesis);
101  // buffer some variables to speed up time, actual values will be calculated at initialization
102  double m_mKshortMin2 = 0;
103  double m_mKshortMax2 = 0;
104  double m_mLambdaMin2 = 0;
105  double m_mLambdaMax2 = 0;
106 
107  // counter for V0Finder statistics
108  int m_nForceStored = 0;
109  int m_nHitRemoved = 0;
110  };
112 }
The ParticleType class for identifying different particle types.
Definition: Const.h:289
double getMass() const
Particle mass.
Definition: UnitConst.cc:323
static const ParticleType Lambda
Lambda particle.
Definition: Const.h:559
static const double K0Mass
neutral kaon mass
Definition: Const.h:573
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
A V0 finder module.
std::tuple< double, double > m_preFilterMassRangeKshort
range for reconstructed Kshort mass used for pre-selection default range set to nominal KS mass + 0....
~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.
bool m_validation
Flag if use validation.
std::tuple< double, double > m_preFilterMassRangeLambda
range for reconstructed Lambda mass used for pre-selection Default range set to nominal Lambda mass +...
void event() override
Creates Belle2::V0s from Belle2::Tracks as described in the class documentation.
std::string m_arrayNameTFResult
StoreArray name of the TrackFitResults (In- and Output).
double m_mKshortMax2
pre-calculated maximum Kshort mass squared
std::string m_arrayNameV0ValidationVertex
StoreArray name of the V0ValidationVertex.
void terminate() override
Prints status summary.
double m_mLambdaMin2
pre-calculated mininum 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 default range...
std::unique_ptr< V0Fitter > m_v0Fitter
Object containing the actual algorithm.
StoreArray< Track > m_tracks
Actually array of mdst Tracks.
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 (0: store V0 at the first vertex fit, regardless of inner hits, 1: remove hits inside the...
std::tuple< double, double > m_invMassRangeKshort
range for reconstructed Kshort mass used after removing material effects and inner hits default range...
std::tuple< double, double > m_invMassRangeLambda
range for reconstructed Lambda mass used after removing material effects and inner hits default range...
std::string m_arrayNameTrack
StoreArray name of the Tracks (Input).
double m_mKshortMin2
pre-calculated mininum Kshort mass squared
Abstract base class for different kinds of events.