Belle II Software  release-05-01-25
ChargedPidMVAModule.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2019 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Marco Milesi (marco.milesi@unimelb.edu.au) *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 // FRAMEWORK
14 #include <framework/core/Module.h>
15 #include <framework/dataobjects/EventMetaData.h>
16 #include <framework/database/DBObjPtr.h>
17 
18 // MVA
19 #include <mva/interface/Expert.h>
20 #include <mva/interface/Dataset.h>
21 
22 // ANALYSIS
23 #include <analysis/VariableManager/Manager.h>
24 #include <analysis/dbobjects/ChargedPidMVAWeights.h>
25 
26 namespace Belle2 {
44  class ChargedPidMVAModule : public Module {
45 
46  typedef std::vector<std::unique_ptr<MVA::Expert> > ExpertsList;
47  typedef std::vector<std::unique_ptr<MVA::SingleDataset> > DatasetsList;
48  typedef std::vector< std::vector<const Variable::Manager::Var*> > VariablesLists;
50  public:
51 
56 
60  virtual ~ChargedPidMVAModule();
61 
68  virtual void initialize() override;
69 
75  virtual void beginRun() override;
76 
82  virtual void event() override;
83 
84  private:
85 
91  void initializeMVA();
92 
93  private:
94 
98  int m_sig_pdg;
99 
103  int m_bkg_pdg;
104 
108  std::vector<std::string> m_particle_lists;
109 
113  std::string m_payload_name;
114 
118  bool m_ecl_only;
119 
123  std::string m_score_varname;
124 
129 
135  std::unique_ptr<DBObjPtr<ChargedPidMVAWeights>> m_weightfiles_representation;
136 
142 
148 
154 
160 
161  };
163 }
Belle2::ChargedPidMVAModule::DatasetsList
std::vector< std::unique_ptr< MVA::SingleDataset > > DatasetsList
Typedef.
Definition: ChargedPidMVAModule.h:55
Belle2::ChargedPidMVAModule::m_datasets
DatasetsList m_datasets
List of MVA::SingleDataset objects.
Definition: ChargedPidMVAModule.h:155
Belle2::ChargedPidMVAModule::m_weightfiles_representation
std::unique_ptr< DBObjPtr< ChargedPidMVAWeights > > m_weightfiles_representation
Interface to get the database payload with the MVA weight files.
Definition: ChargedPidMVAModule.h:143
Belle2::ChargedPidMVAModule::m_payload_name
std::string m_payload_name
The name of the database payload object with the MVA weights.
Definition: ChargedPidMVAModule.h:121
Belle2::ChargedPidMVAModule::~ChargedPidMVAModule
virtual ~ChargedPidMVAModule()
Destructor, use this to clean up anything you created in the constructor.
Belle2::ChargedPidMVAModule::ChargedPidMVAModule
ChargedPidMVAModule()
Constructor, for setting module description and parameters.
Belle2::ChargedPidMVAModule::initializeMVA
void initializeMVA()
Belle2::ChargedPidMVAModule::m_experts
ExpertsList m_experts
List of MVA::Expert objects.
Definition: ChargedPidMVAModule.h:149
Belle2::ChargedPidMVAModule::m_event_metadata
StoreObjPtr< EventMetaData > m_event_metadata
The event information.
Definition: ChargedPidMVAModule.h:136
Belle2::ChargedPidMVAModule::m_variables
VariablesLists m_variables
List of lists of feature variables.
Definition: ChargedPidMVAModule.h:161
Belle2::ChargedPidMVAModule::m_sig_pdg
int m_sig_pdg
The input signal mass hypothesis' pdgId.
Definition: ChargedPidMVAModule.h:106
Belle2::ChargedPidMVAModule::m_particle_lists
std::vector< std::string > m_particle_lists
The input list of names of ParticleList objects to which MVA weights will be applied.
Definition: ChargedPidMVAModule.h:116
Belle2::ChargedPidMVAModule::m_score_varname
std::string m_score_varname
The lookup name of the MVA score variable, given the input S, B mass hypotheses for the algorithm.
Definition: ChargedPidMVAModule.h:131
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::ChargedPidMVAModule::m_ecl_only
bool m_ecl_only
Flag to specify if we use an ECL-only based training.
Definition: ChargedPidMVAModule.h:126
Belle2::ChargedPidMVAModule::beginRun
virtual void beginRun() override
Called once before a new run begins.
Belle2::ChargedPidMVAModule::event
virtual void event() override
Called once for each event.
Belle2::ChargedPidMVAModule::VariablesLists
std::vector< std::vector< const Variable::Manager::Var * > > VariablesLists
Typedef.
Definition: ChargedPidMVAModule.h:56
Belle2::ChargedPidMVAModule::ExpertsList
std::vector< std::unique_ptr< MVA::Expert > > ExpertsList
Typedef.
Definition: ChargedPidMVAModule.h:54
Belle2::ChargedPidMVAModule::m_bkg_pdg
int m_bkg_pdg
The input background mass hypothesis' pdgId.
Definition: ChargedPidMVAModule.h:111
Belle2::ChargedPidMVAModule::m_spectators
VariablesLists m_spectators
List of lists of spectator variables.
Definition: ChargedPidMVAModule.h:167
Belle2::ChargedPidMVAModule::initialize
virtual void initialize() override
Use this to initialize resources or memory your module needs.