11#include <analysis/VariableManager/Manager.h>
12#include <analysis/dataobjects/RestOfEvent.h>
14#include <framework/core/Module.h>
15#include <framework/datastore/StoreObjPtr.h>
16#include <framework/dataobjects/EventMetaData.h>
17#include <framework/dataobjects/EventExtraInfo.h>
18#include <framework/pcore/RootMergeable.h>
49 virtual void event()
override;
75 std::shared_ptr<TFile>
m_file{
nullptr};
95 std::vector<std::pair<Variable::Manager::FunctionPtr, Variable::Manager::VariableDataType>>
m_functions;
98 std::tuple<std::string, std::map<int, unsigned int>>
m_sampling;
Class to store reconstructed particles.
Type-safe access to single objects in the data store.
Module to calculate variables specified by the user for a given ParticleList and save them into a ROO...
StoreObjPtr< RestOfEvent > m_roe
ROE object.
bool m_useFloat
Use float type for floating-point numbers.
std::vector< std::string > m_variables
List of variables to save.
std::vector< float > m_branchAddressesFloat
Branch addresses of variables of type float.
virtual void initialize() override
Initialises the module.
std::map< int, unsigned int > m_sampling_rates
Inverse sampling rates.
VariablesToNtupleModule()
Constructor.
virtual void event() override
Method called for each event.
unsigned int m_ncandidates
total n candidates
virtual void terminate() override
Write TTree to file, and close file if necessary.
StoreObjPtr< EventMetaData > m_eventMetaData
the event information
std::map< int, unsigned long int > m_sampling_counts
Current number of samples with this value.
std::string m_fileName
Name of ROOT file for output.
std::vector< std::pair< Variable::Manager::FunctionPtr, Variable::Manager::VariableDataType > > m_functions
List of pairs of function pointers and respective data type corresponding to given variables.
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::vector< int > m_branchAddressesInt
Branch addresses of variables of type int (or bool)
int m_basketsize
Size of TBaskets in the output ROOT file in bytes.
int m_production
production ID (to distinguish MC samples)
unsigned int m_nSignalSideCandidates
total n signal-side candidates
StoreObjPtr< StringWrapper > m_stringWrapper
string wrapper storing the MCDecayString
int m_experiment
experiment number
bool m_storeEventType
If true, the branch eventType is added.
std::string m_particleList
Name of particle list with reconstructed particles.
bool m_ignoreCommandLineOverride
if true, ignore override of filename
std::string m_eventType
EventType to be filled.
StoreObjPtr< RootMergeable< TTree > > m_tree
The ROOT TNtuple for output.
std::shared_ptr< TFile > m_file
ROOT file for output.
std::vector< double > m_branchAddressesDouble
Branch addresses of variables of type double.
std::string m_sampling_name
Variable name of sampling variable.
float getInverseSamplingRateWeight(const Particle *particle)
Calculate inverse sampling rate weight.
StoreObjPtr< EventExtraInfo > m_eventExtraInfo
pointer to EventExtraInfo
std::string m_treeName
Name of the TTree.
std::string m_signalSideParticleList
Name of signal-side particle list
const Variable::Manager::Var * m_sampling_variable
Variable Pointer to target variable.
int m_signalSideCandidate
signal-side candidate counter
std::string m_fileNameSuffix
Suffix to be appended to the output file name.
int m_candidate
candidate counter
std::string m_MCDecayString
MC decay string to be filled.
Abstract base class for different kinds of events.
A variable returning a floating-point value for a given Particle.