Belle II Software development
MVAPrototypeModule.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
13#include <mva/dataobjects/DatabaseRepresentationOfWeightfile.h>
14#include <mva/interface/Weightfile.h>
15#include <mva/interface/Expert.h>
16
17#include <framework/database/DBObjPtr.h>
18
19#include <vector>
20#include <string>
21#include <memory>
22
23namespace Belle2 {
33 class MVAPrototypeModule : public Module {
34 public:
35
40
44 virtual void initialize() override;
45
49 virtual void beginRun() override;
50
54 virtual void event() override;
55
56 private:
61 void init_mva(MVA::Weightfile& weightfile);
62
63 private:
64
65 std::string m_identifier;
68 std::unique_ptr<DBObjPtr<DatabaseRepresentationOfWeightfile>>
70 std::unique_ptr<MVA::Expert> m_expert;
71 std::unique_ptr<MVA::SingleDataset> m_dataset;
72 };
73
75} // Belle2 namespace
76
This module can be used as a prototype for your own module which uses MVA weightfiles.
std::unique_ptr< MVA::SingleDataset > m_dataset
Pointer to the current dataset.
virtual void initialize() override
Initialize the module.
virtual void event() override
Called for each event.
std::unique_ptr< MVA::Expert > m_expert
Pointer to the current MVA Expert.
double m_signal_fraction_override
Signal Fraction which should be used.
std::unique_ptr< DBObjPtr< DatabaseRepresentationOfWeightfile > > m_weightfile_representation
Database pointer to the Database representation of the weightfile.
virtual void beginRun() override
Called at the beginning of a new run.
void init_mva(MVA::Weightfile &weightfile)
Initialize mva expert, dataset and features Called every time the weightfile in the database changes ...
std::string m_identifier
database identifier or filename of the weightfile
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
Abstract base class for different kinds of events.