Belle II Software  release-05-02-19
KLMExpertModule.h
1 /***************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Jo-Frederik Krohn *
7  * *
8  * This software is provided "as is" without any warranty. *
9  *************************************************************************/
10 #ifndef KLMExpertModule_H
11 #define KLMExpertModule_H
12 
13 #include <framework/core/Module.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <framework/database/DBObjPtr.h>
16 
17 #include <mdst/dataobjects/KLMCluster.h>
18 #include <mdst/dataobjects/KlId.h>
19 
20 #include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
21 #include <mva/interface/Weightfile.h>
22 #include <mva/interface/Expert.h>
23 
24 #include <string>
25 
26 
27 namespace Belle2 {
39  class KLMExpertModule : public Module {
40 
41  public:
42 
45 
47  virtual ~KLMExpertModule();
48 
50  virtual void initialize() override;
51 
53  virtual void beginRun() override;
54 
56  virtual void event() override;
57 
59  virtual void terminate() override
60  {
61  m_expert.reset();
62  m_dataset.reset();
63  }
64 
65  private:
66 
71  void init_mva(MVA::Weightfile& weightfile);
72 
73 
75  // KLM variables
77  float m_KLMnCluster{ -1.};
79  float m_KLMnLayer{ -1.};
81  float m_KLMnInnermostLayer{ -1.};
83  float m_KLMglobalZ{0.};
85  float m_KLMtime{ -1.};
89  float m_KLMhitDepth{ -1.};
91  float m_KLMenergy{ -1.};
93  float m_KLMnextCluster{ -1.};
95  float m_KLMTrackSepDist{ -1.};
98  float m_KLMTrackSepAngle{ -1.};
99 
105  float m_KLMTrackClusterSepAngle{ -1.};
106 
107  // variables of closest ECL cluster with respect to KLM cluster
109  float m_KLMECLDist{ -1.};
111  float m_KLMECLE{ -1.};
113  float m_KLMECLdeltaL{ -1.}; // new
115  float m_KLMECLminTrackDist{ -1.}; //new
117  float m_KLMECLE9oE25{ -1.};
119  float m_KLMECLTiming{ -1.};
121  float m_KLMECLTerror{ -1.};
123  float m_KLMECLEerror{ -1.};
124 
126  float m_KLMECLZMVA{ -1.};
128  float m_KLMECLZ40{ -1.};
130  float m_KLMECLZ51{ -1.};
131 
136 
138  std::vector<float> m_feature_variables;
139 
141  std::string m_identifier =
142  "KLM_fBDT_10xbkg100k"; // assuming 1 times beambkg and generic BBbar events
143 
145  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
148  std::unique_ptr<MVA::Expert> m_expert;
150  std::unique_ptr<MVA::SingleDataset> m_dataset;
151 
152 
153  }; // end class
155 } // end namespace Belle2
156 
157 
158 #endif
Belle2::KLMExpertModule::m_KLMECLTiming
float m_KLMECLTiming
timing of associated ECL cluster
Definition: KLMExpertModule.h:127
Belle2::KLMExpertModule::beginRun
virtual void beginRun() override
beginn run
Definition: KLMExpertModule.cc:69
Belle2::KLMExpertModule::m_KLMInitialTrackSepAngle
float m_KLMInitialTrackSepAngle
angular distance from track to cluster at track starting point
Definition: KLMExpertModule.h:109
Belle2::KLMExpertModule::m_KLMnextCluster
float m_KLMnextCluster
distance to next KLM cluster
Definition: KLMExpertModule.h:101
Belle2::KLMExpertModule::terminate
virtual void terminate() override
terminate and free
Definition: KLMExpertModule.h:67
Belle2::KLMExpertModule::m_KLMECLE
float m_KLMECLE
energy measured in associated ECL cluster
Definition: KLMExpertModule.h:119
Belle2::KLMExpertModule::m_feature_variables
std::vector< float > m_feature_variables
vars to be classified
Definition: KLMExpertModule.h:146
Belle2::KLMExpertModule::m_KLMtime
float m_KLMtime
timing of KLM Cluster
Definition: KLMExpertModule.h:93
Belle2::MVA::Weightfile
The Weightfile class serializes all information about a training into an xml tree.
Definition: Weightfile.h:40
Belle2::KLMExpertModule::m_KLMECLminTrackDist
float m_KLMECLminTrackDist
track distance between associated ECL cluster and track extrapolated into ECL
Definition: KLMExpertModule.h:123
Belle2::KLMExpertModule::KLMExpertModule
KLMExpertModule()
Constructor.
Definition: KLMExpertModule.cc:32
Belle2::KLMExpertModule::event
virtual void event() override
process event
Definition: KLMExpertModule.cc:101
Belle2::KLMExpertModule::m_KLMTrackSepDist
float m_KLMTrackSepDist
distance from track separation object
Definition: KLMExpertModule.h:103
Belle2::KLMExpertModule::m_KLMavInterClusterDist
float m_KLMavInterClusterDist
average distance between all KLM clusters
Definition: KLMExpertModule.h:95
Belle2::KLMExpertModule::m_KLMECLTerror
float m_KLMECLTerror
uncertanty on time in associated ECL cluster
Definition: KLMExpertModule.h:129
Belle2::KLMExpertModule::m_KLMnLayer
float m_KLMnLayer
number of layers hit in KLM cluster
Definition: KLMExpertModule.h:87
Belle2::KLMExpertModule::initialize
virtual void initialize() override
init
Definition: KLMExpertModule.cc:49
Belle2::KLMExpertModule::m_KLMhitDepth
float m_KLMhitDepth
hit depth in KLM, distance to IP
Definition: KLMExpertModule.h:97
Belle2::KLMExpertModule::m_KLMTrackSepAngle
float m_KLMTrackSepAngle
angular distance from track separation object.
Definition: KLMExpertModule.h:106
Belle2::KLMExpertModule::m_KLMECLdeltaL
float m_KLMECLdeltaL
distance between track entry pofloat and cluster center, might be removed
Definition: KLMExpertModule.h:121
Belle2::KLMExpertModule::~KLMExpertModule
virtual ~KLMExpertModule()
Destructor.
Definition: KLMExpertModule.cc:43
Belle2::KLMExpertModule::m_KLMECLZ51
float m_KLMECLZ51
zernike moment 5,1 of closest ECL
Definition: KLMExpertModule.h:138
Belle2::KLMExpertModule::m_KLMECLEerror
float m_KLMECLEerror
uncertanty on E in associated ECL cluster
Definition: KLMExpertModule.h:131
Belle2::KLMExpertModule::m_KLMnInnermostLayer
float m_KLMnInnermostLayer
number of innermost layers hit
Definition: KLMExpertModule.h:89
Belle2::KLMExpertModule::m_KLMECLZMVA
float m_KLMECLZMVA
output of a BDT fitted on various Z-moments for the closest ECL cluster
Definition: KLMExpertModule.h:134
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::KLMExpertModule::m_KLMTrackClusterSepAngle
float m_KLMTrackClusterSepAngle
angle between trach momentum and cluster (measured from ip)
Definition: KLMExpertModule.h:113
Belle2::KLMExpertModule::m_KLMTrackRotationAngle
float m_KLMTrackRotationAngle
angle between track at poca and trackbeginning
Definition: KLMExpertModule.h:111
Belle2::KLMExpertModule::m_weightfile_representation
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
Definition: KLMExpertModule.h:154
Belle2::KLMExpertModule::m_KLMECLDist
float m_KLMECLDist
distance associated ECL <-> KLM cluster, extrapolated by genfit
Definition: KLMExpertModule.h:117
Belle2::KLMExpertModule::m_klids
StoreArray< KlId > m_klids
storearray
Definition: KLMExpertModule.h:143
Belle2::KLMExpertModule::m_KLMglobalZ
float m_KLMglobalZ
global Z position in KLM
Definition: KLMExpertModule.h:91
Belle2::KLMExpertModule::m_klmClusters
StoreArray< KLMCluster > m_klmClusters
storearray
Definition: KLMExpertModule.h:141
Belle2::KLMExpertModule::m_KLMECLZ40
float m_KLMECLZ40
zernike moment 4,0 of closest ECL
Definition: KLMExpertModule.h:136
Belle2::KLMExpertModule::m_KLMenergy
float m_KLMenergy
Energy deposit in KLM (0.2 GeV * nHitCells)
Definition: KLMExpertModule.h:99
Belle2::KLMExpertModule::m_KLMnCluster
float m_KLMnCluster
varibales to write out.
Definition: KLMExpertModule.h:85
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::KLMExpertModule::m_identifier
std::string m_identifier
mva identifier.
Definition: KLMExpertModule.h:149
Belle2::KLMExpertModule::m_KLMECLE9oE25
float m_KLMECLE9oE25
E in surrounding 9 crystals divided by surrounding 25 crydtalls.
Definition: KLMExpertModule.h:125
Belle2::KLMExpertModule::m_expert
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
Definition: KLMExpertModule.h:156
Belle2::KLMExpertModule::init_mva
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called everytime the weightfile in the database changes i...
Definition: KLMExpertModule.cc:84
Belle2::KLMExpertModule::m_dataset
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
Definition: KLMExpertModule.h:158