Belle II Software  release-05-02-19
MVAPrototypeModule.h
1 /* BASF2 (Belle Analysis Framework 2) *
2  * Copyright(C) 2016 - Belle II Collaboration *
3  * *
4  * Author: The Belle II Collaboration *
5  * Contributors: Thomas Keck *
6  * *
7  * This software is provided "as is" without any warranty. *
8  **************************************************************************/
9 
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 
14 #include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
15 #include <mva/interface/Weightfile.h>
16 #include <mva/interface/Expert.h>
17 
18 #include <framework/database/DBObjPtr.h>
19 
20 #include <vector>
21 #include <string>
22 #include <memory>
23 
24 namespace Belle2 {
37  class MVAPrototypeModule : public Module {
38  public:
39 
44 
48  virtual void initialize() override;
49 
53  virtual void beginRun() override;
54 
58  virtual void event() override;
59 
60  private:
65  void init_mva(MVA::Weightfile& weightfile);
66 
67  private:
68 
69  std::string m_identifier;
72  std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
74  std::unique_ptr<MVA::Expert> m_expert;
75  std::unique_ptr<MVA::SingleDataset> m_dataset;
76  };
77 
79 } // Belle2 namespace
80 
Belle2::MVAPrototypeModule::m_expert
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
Definition: MVAPrototypeModule.h:74
Belle2::MVA::Weightfile
The Weightfile class serializes all information about a training into an xml tree.
Definition: Weightfile.h:40
Belle2::MVAPrototypeModule
This module can be used as a prototype for your own module which uses MVA weightfiles.
Definition: MVAPrototypeModule.h:37
Belle2::MVAPrototypeModule::initialize
virtual void initialize() override
Initialize the module.
Definition: MVAPrototypeModule.cc:55
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::MVAPrototypeModule::init_mva
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called everytime the weightfile in the database changes i...
Definition: MVAPrototypeModule.cc:89
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MVAPrototypeModule::m_signal_fraction_override
double m_signal_fraction_override
Signal Fraction which should be used.
Definition: MVAPrototypeModule.h:70
Belle2::MVAPrototypeModule::m_weightfile_representation
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
Definition: MVAPrototypeModule.h:73
Belle2::MVAPrototypeModule::m_identifier
std::string m_identifier
database identifier or filename of the weightfile
Definition: MVAPrototypeModule.h:69
Belle2::MVAPrototypeModule::beginRun
virtual void beginRun() override
Called at the beginning of a new run.
Definition: MVAPrototypeModule.cc:68
Belle2::MVAPrototypeModule::event
virtual void event() override
Called for each event.
Definition: MVAPrototypeModule.cc:115
Belle2::MVAPrototypeModule::MVAPrototypeModule
MVAPrototypeModule()
Constructor.
Definition: MVAPrototypeModule.cc:34
Belle2::MVAPrototypeModule::m_dataset
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
Definition: MVAPrototypeModule.h:75