Belle II Software development
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 <analysis/VariableManager/Manager.h>
12
13#include <framework/core/Module.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <framework/pcore/RootMergeable.h>
16
17#include <TH1D.h>
18#include <TFile.h>
19
20#include <string>
21#include <vector>
22
23namespace Belle2 {
33 public:
36
41 virtual void initialize() override;
43 virtual void event() override;
45 virtual void terminate() override;
46
47 private:
49 std::string m_particleList;
51 std::vector<std::tuple<std::string, int, float, float>> m_variables;
53 std::vector<std::tuple<std::string, int, float, float, std::string, int, float, float>> m_variables_2d;
55 std::string m_fileName;
57 std::string m_directory;
59 std::string m_fileNameSuffix;
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
75 };
77} // 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.
bool m_ignoreCommandLineOverride
if true, ignore override of filename
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.
std::string m_fileNameSuffix
Suffix to be appended to the output file name.
Abstract base class for different kinds of events.