Belle II Software  release-06-00-14
VariablesToHistogramModule.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 #include <analysis/VariableManager/Manager.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/pcore/RootMergeable.h>
15 
16 #include <TH1D.h>
17 #include <TFile.h>
18 
19 #include <string>
20 #include <vector>
21 
22 namespace Belle2 {
35  public:
38 
43  virtual void initialize() override;
45  virtual void event() override;
47  virtual void terminate() override;
48 
49  private:
51  std::string m_particleList;
53  std::vector<std::tuple<std::string, int, float, float>> m_variables;
55  std::vector<std::tuple<std::string, int, float, float, std::string, int, float, float>> m_variables_2d;
57  std::string m_fileName;
59  std::string m_directory;
60 
62  std::shared_ptr<TFile> m_file{nullptr};
64  std::vector<std::unique_ptr<StoreObjPtr<RootMergeable<TH1D>>>> m_hists;
66  std::vector<std::unique_ptr<StoreObjPtr<RootMergeable<TH2D>>>> m_2d_hists;
68  std::vector<Variable::Manager::FunctionPtr> m_functions;
70  std::vector<Variable::Manager::FunctionPtr> m_functions_2d_1;
72  std::vector<Variable::Manager::FunctionPtr> m_functions_2d_2;
73 
74  };
76 } // end namespace Belle2
Base class for Modules.
Definition: Module.h:72
Module to calculate variables specified by the user for a given ParticleList and save them into an Hi...
std::string m_directory
Name of the Directory.
virtual void initialize() override
Initialises the module.
std::vector< std::tuple< std::string, int, float, float > > m_variables
List of variables to save.
virtual void event() override
Method called for each event.
virtual void terminate() override
Write TTree to file, and close file if necessary.
std::vector< Variable::Manager::FunctionPtr > m_functions_2d_1
List of function pointers corresponding to given variables.
std::string m_fileName
Name of ROOT file for output.
std::vector< std::tuple< std::string, int, float, float, std::string, int, float, float > > m_variables_2d
List of pairs of variables to save.
std::vector< Variable::Manager::FunctionPtr > m_functions
List of function pointers corresponding to given variables.
std::string m_particleList
Name of particle list with reconstructed particles.
std::shared_ptr< TFile > m_file
ROOT file for output.
std::vector< Variable::Manager::FunctionPtr > m_functions_2d_2
List of function pointers corresponding to given variables.
std::vector< std::unique_ptr< StoreObjPtr< RootMergeable< TH2D > > > > m_2d_hists
The ROOT TH2Ds for output.
std::vector< std::unique_ptr< StoreObjPtr< RootMergeable< TH1D > > > > m_hists
The ROOT TH1Ds for output.
Abstract base class for different kinds of events.