Belle II Software  release-08-01-10
LowEnergyPi0IdentificationExpertModule.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 /* Analysis headers. */
12 #include <analysis/dataobjects/ParticleList.h>
13 
14 /* Basf2 headers. */
15 #include <framework/core/Module.h>
16 #include <framework/database/DBObjPtr.h>
17 #include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
18 #include <mva/interface/Expert.h>
19 #include <mva/interface/Weightfile.h>
20 
21 /* C++ headers. */
22 #include <string>
23 
24 namespace Belle2 {
37 
38  public:
39 
44 
49 
53  void initialize() override;
54 
58  void beginRun() override;
59 
63  void event() override;
64 
68  void endRun() override;
69 
73  void terminate() override;
74 
75  private:
76 
81  void init_mva(MVA::Weightfile& weightfile);
82 
84  std::string m_Pi0ListName;
85 
87  bool m_Belle1;
88 
91 
93  std::string m_identifier = "LowEnergyPi0Identification";
94 
96  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>> m_weightfile_representation;
97 
99  std::unique_ptr<MVA::Expert> m_expert;
100 
102  std::unique_ptr<MVA::SingleDataset> m_dataset;
103 
104  };
105 
107 }
Calculation of low-energy pi0 identification value.
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
void event() override
This method is called for each event.
void endRun() override
This method is called if the current run ends.
void terminate() override
This method is called at the end of the event processing.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA expert.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the database representation of the weightfile.
void beginRun() override
Called when entering a new run.
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
Database identifier or file used to load the weights.
The Weightfile class serializes all information about a training into an xml tree.
Definition: Weightfile.h:38
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.