Belle II Software development
ECLExpertModule.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 ECLCluster;
24 class KlId;
26
27 namespace MVA {
28 class Weightfile;
29 class Expert;
30 class SingleDataset;
31 }
32
33
37 class ECLExpertModule : public Module {
38
39 public:
40
43
46
48 virtual void initialize() override;
49
51 virtual void beginRun() override;
52
54 virtual void event() override;
55
57 virtual void terminate() override
58 {
59 m_expert.reset();
60 m_dataset.reset();
61 }
62
63 private:
64
69 void init_mva(MVA::Weightfile& weightfile);
70
71
73 Double32_t m_ECLminTrkDistance; //[0.0, 250., 10]
74
76 Double32_t m_ECLZ40; //[0.0, 1.7, 10]
77
79 Double32_t m_ECLZ51; //[0.0, 1.2, 10]
80
82 Double32_t m_ECLE1oE9; //[0.0, 1., 10]
83
85 Double32_t m_ECLE9oE21; //[0.0, 1., 10]
86
88 Double32_t m_ECLsecondMoment; //[0.0, 40.0, 10]
89
91 Double32_t m_ECLLAT; //[0.0, 1., 10]
92
94 Double32_t m_ECLnumberOfCrystals; //[0.0, 200.0, 10]
95
97 Double32_t m_ECLtime; //[-1000.0, 1000.0, 12]
98
100 Double32_t m_ECLdeltaTime99; //[0.0, 1000.0, 12]
101
103 Double32_t m_ECLtheta; //[0.0, pi, 16]
104
106 Double32_t m_ECLphi; //[-pi, pi, 16]
107
109 Double32_t m_ECLr; //[75.0, 300.0, 16]
110
112 Double32_t m_ECLDeltaL; //[75.0, 300.0, 16]
113
115 Double32_t m_ECLPulseShapeDiscriminationMVA; //[0.0, 1.0, 18]
116
118 Double32_t m_ECLNumberOfHadronDigits; //[0, 255, 18]
119
121 Double32_t m_ECLZMVA;
122
124 Double32_t m_ECLEnergy; //[-5, 3., 18]
125
127 Double32_t m_ECLlogEnergy; //[-5, 3., 18]
128
130 Double32_t m_ECLlogEnergyHighestCrystal; //[-5, 3., 18]
131
136
138 std::vector<float> m_feature_variables;
139
141 std::string m_identifier =
142 "ECL_fBDT_1xBkgPhiGamma.xml";
143 // "ECL_fBDT_1xBkgpGunMulti.xml";
144 // "ECL_fBDT_test_mixedBkg50kv1.xml";
145 // "ECL_fBDT_mixedBkg10k"; // assuming 1 times beambkg and generic BBbar events
146
148 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
151 std::unique_ptr<MVA::Expert> m_expert;
153 std::unique_ptr<MVA::SingleDataset> m_dataset;
154
155
156 }; // end class
157
158} // end namespace Belle2
Database representation of a Weightfile object.
ECL cluster data.
Definition ECLCluster.h:27
Double32_t m_ECLtheta
Theta [rad].
StoreArray< KlId > m_klids
storearray
Double32_t m_ECLtime
Time.
Double32_t m_ECLphi
Phi [rad].
virtual void terminate() override
terminate and free
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
virtual void initialize() override
init
Double32_t m_ECLE1oE9
E1oE9.
Double32_t m_ECLminTrkDistance
Distance between cluster center and track extrapolation to ECL.
virtual void event() override
process event
Double32_t m_ECLEnergy
Energy [GeV].
Double32_t m_ECLlogEnergyHighestCrystal
Log.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
Double32_t m_ECLE9oE21
E9oE21.
virtual ~ECLExpertModule()
Destructor.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
Double32_t m_ECLdeltaTime99
Delta Time 99.
std::vector< float > m_feature_variables
vars to be classified
virtual void beginRun() override
begin run
Double32_t m_ECLZMVA
output of a BDT fitted on various Z-moments for the closest ECL cluster
Double32_t m_ECLnumberOfCrystals
Number of Crystals in a shower (sum of weights).
Double32_t m_ECLZ40
Zernike 40.
StoreArray< ECLCluster > m_eclClusters
storearray
Double32_t m_ECLr
Radius [cm].
Double32_t m_ECLPulseShapeDiscriminationMVA
MVA classifier that uses pulse shape discrimination to identify electromagnetic vs hadronic showers.
Double32_t m_ECLNumberOfHadronDigits
Number of hadron digits in cluster (pulse shape discrimination variable).
Double32_t m_ECLlogEnergy
Log.
Double32_t m_ECLsecondMoment
Second Moment.
Double32_t m_ECLDeltaL
DeltaL.
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called every time the weightfile in the database changes ...
Double32_t m_ECLZ51
Zernike 51.
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.