 |
Belle II Software
release-05-02-19
|
16 #include <framework/core/Module.h>
17 #include <analysis/VariableManager/Manager.h>
18 #include <framework/datastore/StoreObjPtr.h>
19 #include <framework/dataobjects/EventMetaData.h>
20 #include <framework/pcore/RootMergeable.h>
38 class VariablesToNtupleModule :
public Module {
69 std::shared_ptr<TFile>
m_file{
nullptr};
81 std::vector<Variable::Manager::FunctionPtr>
m_functions;
84 std::tuple<std::string, std::map<int, unsigned int>>
m_sampling;
virtual void initialize() override
Initialises the module.
A variable returning a floating-point value for a given Particle.
std::string m_particleList
Name of particle list with reconstructed particles.
std::shared_ptr< TFile > m_file
ROOT file for output.
StoreObjPtr< EventMetaData > m_eventMetaData
the event information
int m_candidate
candidate counter
unsigned int m_ncandidates
total n candidates
std::vector< std::string > m_variables
List of variables to save.
int m_experiment
experiment number
const Variable::Manager::Var * m_sampling_variable
Variable Pointer to target variable.
std::map< int, unsigned long int > m_sampling_counts
Current number of samples with this value.
std::vector< Variable::Manager::FunctionPtr > m_functions
List of function pointers corresponding to given variables.
virtual void terminate() override
Write TTree to file, and close file if necessary.
virtual void event() override
Method called for each event.
float getInverseSamplingRateWeight(const Particle *particle)
Calculate inverse sampling rate weight.
std::tuple< std::string, std::map< int, unsigned int > > m_sampling
Tuple of variable name and a map of integer values and inverse sampling rate.
std::string m_treeName
Name of the TTree.
Abstract base class for different kinds of events.
std::string m_fileName
Name of ROOT file for output.
Type-safe access to single objects in the data store.
VariablesToNtupleModule()
Constructor.
Class to store reconstructed particles.
std::string m_sampling_name
Variable name of sampling variable.
StoreObjPtr< RootMergeable< TTree > > m_tree
The ROOT TNtuple for output.
std::vector< double > m_branchAddresses
Variable branch addresses.
std::map< int, unsigned int > m_sampling_rates
Inverse sampling rates.