Belle II Software  release-06-00-14
ChargedPidMVAModule.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 // FRAMEWORK
12 #include <framework/core/Module.h>
13 #include <framework/dataobjects/EventMetaData.h>
14 #include <framework/database/DBObjPtr.h>
15 
16 // MVA
17 #include <mva/interface/Expert.h>
18 #include <mva/interface/Dataset.h>
19 
20 // ANALYSIS
21 #include <analysis/VariableManager/Manager.h>
22 #include <analysis/dbobjects/ChargedPidMVAWeights.h>
23 
24 namespace Belle2 {
42  class ChargedPidMVAModule : public Module {
43 
44  typedef std::vector<std::unique_ptr<MVA::Expert> > ExpertsList;
45  typedef std::vector<std::unique_ptr<MVA::SingleDataset> > DatasetsList;
46  typedef std::vector< std::vector<const Variable::Manager::Var*> > VariablesLists;
48  public:
49 
54 
59 
66  virtual void initialize() override;
67 
73  virtual void beginRun() override;
74 
80  virtual void event() override;
81 
82  private:
83 
89  void initializeMVA();
90 
91  private:
92 
96  int m_sig_pdg;
97 
102 
106  std::vector<std::string> m_particle_lists;
107 
111  std::string m_payload_name;
112 
117 
122 
126  std::string m_score_varname;
127 
132 
138  std::unique_ptr<DBObjPtr<ChargedPidMVAWeights>> m_weightfiles_representation;
139 
145 
151 
157 
163 
164  };
166 }
This module evaluates the response of an MVA trained for binary charged particle identification betwe...
StoreObjPtr< EventMetaData > m_event_metadata
The event information.
int m_bkg_pdg
The input background mass hypothesis' pdgId.
bool m_ecl_only
Flag to specify if we use an ECL-only based training.
std::string m_score_varname
The lookup name of the MVA score variable, given the input S, B mass hypotheses for the algorithm.
std::unique_ptr< DBObjPtr< ChargedPidMVAWeights > > m_weightfiles_representation
Interface to get the database payload with the MVA weight files.
std::vector< std::unique_ptr< MVA::SingleDataset > > DatasetsList
Typedef.
DatasetsList m_datasets
List of MVA::SingleDataset objects.
bool m_charge_independent
Flag to specify if we use a charge-independent training.
virtual void event() override
Called once for each event.
virtual void initialize() override
Use this to initialize resources or memory your module needs.
int m_sig_pdg
The input signal mass hypothesis' pdgId.
virtual void beginRun() override
Called once before a new run begins.
VariablesLists m_variables
List of lists of feature variables.
std::vector< std::vector< const Variable::Manager::Var * > > VariablesLists
Typedef.
ChargedPidMVAModule()
Constructor, for setting module description and parameters.
VariablesLists m_spectators
List of lists of spectator variables.
virtual ~ChargedPidMVAModule()
Destructor, use this to clean up anything you created in the constructor.
std::vector< std::unique_ptr< MVA::Expert > > ExpertsList
Typedef.
std::vector< std::string > m_particle_lists
The input list of names of ParticleList objects to which MVA weights will be applied.
ExpertsList m_experts
List of MVA::Expert objects.
std::string m_payload_name
The name of the database payload object with the MVA weights.
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Abstract base class for different kinds of events.