![]() |
Belle II Software development
|
Abstract base class defining the interface for persisting variables. More...
#include <PersistenceManager.h>
Public Member Functions | |
virtual void | initialize (const std::string &fileName, const std::string &objectName, Variables &variables)=0 |
Initializes the persistence manager with the given parameters. | |
virtual void | addEntry (const EvaluatedVariables &evaluatedVariables)=0 |
Adds a new data entry (event) to the underlying storage. | |
virtual void | store ()=0 |
Writes the current in-memory data to the final storage medium. | |
virtual | ~PersistenceManager ()=default |
Virtual destructor. | |
Abstract base class defining the interface for persisting variables.
Any class implementing this interface is responsible for storing and retrieving data (e.g., variables to ntuples or histograms). Concrete implementations must provide the following capabilities:
Definition at line 29 of file PersistenceManager.h.
|
pure virtual |
Adds a new data entry (event) to the underlying storage.
evaluatedVariables | A map of variable names to their evaluated values. |
This method is called once per event or data set. The implementing class should use the provided values to fill or update the data structures (e.g., histograms, tree branches, or other objects).
Implemented in ConcreteVariablesToHistogramPersistenceManager, and ConcreteVariablesToNtuplePersistenceManager.
|
pure virtual |
Initializes the persistence manager with the given parameters.
fileName | Name or path to the output resource (e.g., a ROOT file). |
objectName | Name of the object (e.g., tree or directory) used to store data. |
variables | A list of variables (TypedVariable or BinnedVariable) used by the manager. |
This function should set up any internal data structures needed, such as creating file pointers, booking histograms, or initializing trees. It does not actually store data but prepares for it.
Implemented in ConcreteVariablesToHistogramPersistenceManager, and ConcreteVariablesToNtuplePersistenceManager.
|
pure virtual |
Writes the current in-memory data to the final storage medium.
This method should be called once the data accumulation is complete (e.g., at the end of a run). It ensures that all buffered data is safely written to the output (e.g., a ROOT file).
Implemented in ConcreteVariablesToHistogramPersistenceManager, and ConcreteVariablesToNtuplePersistenceManager.