Belle II Software development
|
Class to write collected variables into a root file, Used by VXDQETrainingDataCollectorModule. More...
#include <SimpleVariableRecorder.h>
Public Member Functions | |
SimpleVariableRecorder (const std::function< void(TTree &)> &setBranches, const std::string &rootFileName, const std::string &treeName="recorded_tree") | |
Construct the Recorder opening the given ROOT file and create the underlying TTree and add let the given function setup branches. | |
SimpleVariableRecorder (std::vector< Named< float * > > &namedVariables, const std::string &fileName, const std::string &treeName) | |
Construct the Recorder opening the given ROOT file and create the underlying TTree and add let the given function setup branches. | |
~SimpleVariableRecorder () | |
Destructor that closes used TTrees and TFiles. | |
SimpleVariableRecorder (SimpleVariableRecorder &)=delete | |
copy constructor needs to be implemented if needed as class has dynamic memory/resource allocation (as pointed out by cppcheck) | |
SimpleVariableRecorder & | operator= (SimpleVariableRecorder &)=delete |
assignment operator ("=") needs to be implemented if needed as class has dynamic memory/resource allocation (as pointed out by cppcheck) | |
void | record () |
Record variables by filling the TTree. | |
void | write () |
Write out TFile to root file. | |
Protected Attributes | |
TFile * | m_tFile |
ROOT file to which should be written. | |
StoreObjPtr< RootMergeable< TTree > > | m_tTree |
TTree that contains recorded variables. | |
Class to write collected variables into a root file, Used by VXDQETrainingDataCollectorModule.
Definition at line 32 of file SimpleVariableRecorder.h.
|
inline |
Construct the Recorder opening the given ROOT file and create the underlying TTree and add let the given function setup branches.
setBranches | Function invoked with the underlying TTree as argument which is supposed create Branches and provide the value addresses. |
rootFileName | Name of ROOT file to which should be written. |
treeName | Name of the TTree in the ROOT file. |
Definition at line 45 of file SimpleVariableRecorder.h.
|
inline |
Construct the Recorder opening the given ROOT file and create the underlying TTree and add let the given function setup branches.
namedVariables | Vector of collected named variables to be turned into Branches in a TTree |
fileName | Name of ROOT file to which should be written. |
treeName | Name of the TTree in the ROOT file. |
Definition at line 79 of file SimpleVariableRecorder.h.
|
inline |
Destructor that closes used TTrees and TFiles.
Definition at line 90 of file SimpleVariableRecorder.h.
|
inline |
Record variables by filling the TTree.
Definition at line 111 of file SimpleVariableRecorder.h.
|
inline |
Write out TFile to root file.
Definition at line 114 of file SimpleVariableRecorder.h.
|
protected |
ROOT file to which should be written.
Definition at line 142 of file SimpleVariableRecorder.h.
|
protected |
TTree that contains recorded variables.
Definition at line 144 of file SimpleVariableRecorder.h.