Belle II Software development
KLMExpertModule.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
9#pragma once
10
11#include <framework/core/Module.h>
12#include <framework/datastore/StoreArray.h>
13#include <framework/database/DBObjPtr.h>
14
15#include <string>
16
17
18namespace Belle2 {
23 class KLMCluster;
24 class KlId;
26
27 namespace MVA {
28 class Weightfile;
29 class Expert;
30 class SingleDataset;
31 }
32
33
36 class KLMExpertModule : public Module {
37
38 public:
39
42
44 virtual ~KLMExpertModule();
45
47 virtual void initialize() override;
48
50 virtual void beginRun() override;
51
53 virtual void event() override;
54
56 virtual void terminate() override
57 {
58 m_expert.reset();
59 m_dataset.reset();
60 }
61
62 private:
63
68 void init_mva(MVA::Weightfile& weightfile);
69
70
72 // KLM variables
74 float m_KLMnCluster{ -1.};
76 float m_KLMnLayer{ -1.};
80 float m_KLMglobalZ{0.};
82 float m_KLMtime{ -1.};
86 float m_KLMhitDepth{ -1.};
88 float m_KLMenergy{ -1.};
90 float m_KLMnextCluster{ -1.};
92 float m_KLMTrackSepDist{ -1.};
95 float m_KLMTrackSepAngle{ -1.};
96
103
104 // variables of closest ECL cluster with respect to KLM cluster
106 float m_KLMECLDist{ -1.};
108 float m_KLMECLE{ -1.};
110 float m_KLMECLdeltaL{ -1.}; // new
112 float m_KLMECLminTrackDist{ -1.}; //new
114 float m_KLMECLE9oE25{ -1.};
116 float m_KLMECLTiming{ -1.};
118 float m_KLMECLTerror{ -1.};
120 float m_KLMECLEerror{ -1.};
121
123 float m_KLMECLZMVA{ -1.};
125 float m_KLMECLZ40{ -1.};
127 float m_KLMECLZ51{ -1.};
128
133
135 std::vector<float> m_feature_variables;
136
138 std::string m_identifier =
139 "KLM_fBDT_10xbkg100k"; // assuming 1 times beambkg and generic BBbar events
140
142 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
145 std::unique_ptr<MVA::Expert> m_expert;
147 std::unique_ptr<MVA::SingleDataset> m_dataset;
148
149
150 }; // end class
151
152} // end namespace Belle2
Database representation of a Weightfile object.
KLM cluster data.
Definition KLMCluster.h:29
float m_KLMECLE
energy measured in associated ECL cluster
float m_KLMECLdeltaL
distance between track entry pofloat and cluster center, might be removed
StoreArray< KlId > m_klids
storearray
float m_KLMInitialTrackSepAngle
angular distance from track to cluster at track starting point
float m_KLMECLZMVA
output of a BDT fitted on various Z-moments for the closest ECL cluster
float m_KLMTrackRotationAngle
angle between track at poca and trackbeginning
float m_KLMECLTiming
timing of associated ECL cluster
virtual void terminate() override
terminate and free
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
StoreArray< KLMCluster > m_klmClusters
storearray
virtual void initialize() override
init
float m_KLMECLTerror
uncertanty on time in associated ECL cluster
virtual void event() override
process event
float m_KLMtime
timing of KLM Cluster
float m_KLMECLDist
distance associated ECL <-> KLM cluster, extrapolated by genfit
float m_KLMnLayer
number of layers hit in KLM cluster
float m_KLMhitDepth
hit depth in KLM, distance to IP
float m_KLMECLminTrackDist
track distance between associated ECL cluster and track extrapolated into ECL
float m_KLMenergy
Energy deposit in KLM (0.2 GeV * nHitCells)
float m_KLMTrackSepAngle
angular distance from track separation object.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
float m_KLMECLZ40
zernike moment 4,0 of closest ECL
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
virtual ~KLMExpertModule()
Destructor.
float m_KLMnInnermostLayer
number of innermost layers hit
float m_KLMECLEerror
uncertanty on E in associated ECL cluster
float m_KLMECLE9oE25
E in surrounding 9 crystals divided by surrounding 25 crydtalls.
std::vector< float > m_feature_variables
vars to be classified
float m_KLMECLZ51
zernike moment 5,1 of closest ECL
float m_KLMavInterClusterDist
average distance between all KLM clusters
virtual void beginRun() override
beginn run
float m_KLMTrackSepDist
distance from track separation object
float m_KLMglobalZ
global Z position in KLM
float m_KLMnCluster
varibales to write out.
float m_KLMnextCluster
distance to next KLM cluster
float m_KLMTrackClusterSepAngle
angle between trach momentum and cluster (measured from ip)
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called everytime the weightfile in the database changes i...
std::string m_identifier
mva identifier.
Klong identification (KlId) datastore object to store results from KlId calculations.
Definition KlId.h:23
Abstract base class of all Expert Each MVA library has its own implementation of this class,...
Definition Expert.h:31
Wraps the data of a single event into a Dataset.
Definition Dataset.h:135
The Weightfile class serializes all information about a training into an xml tree.
Definition Weightfile.h:38
Module()
Constructor.
Definition Module.cc:30
Accessor to arrays stored in the data store.
Definition StoreArray.h:113
Abstract base class for different kinds of events.