Mēnsūra
|
A class to fill a cut-flow table. More...
#include <EventCounter.hpp>
Public Member Functions | |
EventCounter (std::string const &title="") | |
Constructor from a title to indentify an instance of the class. | |
EventCounter (EventCounter const &)=delete | |
Copy constructor is deleted. | |
EventCounter & | operator= (EventCounter const &)=delete |
Assignment operator is deleted. | |
void | ResetTitle (std::string const &title) |
Resets the title. | |
void | RegisterSelectionStep (std::string const &label, std::string const &description) |
Registers a new selection step. | |
void | AddEvent (std::string const &label) |
Increases the counter for a given selection step. | |
void | AddEvent (std::string const &label, EventID const &id) |
Increases the counter for a given selection step and saves event ID. | |
void | WriteResults () const |
Writes down accumulated information about selection steps. More... | |
A class to fill a cut-flow table.
An instance of the class allows to define several selection steps, each with an associated counter and an optional list of event IDs. After the counters are filled, the cut-flow table is written to the standard output and the lists of passed events are stored in a set of files (one file for each selection step).
The class is not thread-safe. It is expected to be used for synchronisation only and not intended to be exploited in a production version of a program. Given its transient usage, the foreseen way to insert the class in the code is to make a global object in a dedicated branch. After the synchronisation is over, the branch should be removed.
void EventCounter::WriteResults | ( | ) | const |
Writes down accumulated information about selection steps.
Cut-flow table is written to the standard output, and lists of event IDs are saved to ASCII files.