8#include <framework/modules/core/EventLimiterModule.h>
9#include <framework/core/Module.h>
25 setDescription(
"Allows you to set limits on the number of events per run passing this module. "
26 "It returns True until the limit is reached, after which it returns False. "
27 "basf2 conditional paths can then be used to prevent events continuing onwards from this module.");
31 "Maximum number of events that will have True returned on them per run. "
32 "This module returns True until the limit in a particular run is reached, it then returns False. "
33 "It will only start returning True again once a new run begins. "
34 "The default value (-1) means that this module always returns True regardless of how many events "
35 "are processed in a run.",
int(-1));
50 B2INFO(
"Reached maximum number of events ("
52 <<
") for (Experiment, Run) = ("
virtual void initialize() override
Initialization states required data objects (EventMetaData)
bool m_returnValue
Flag that will be returned by the module.
virtual void event() override
Checks if we've reached the maximum number of events yet and sets the return value to False if we hav...
StoreObjPtr< EventMetaData > m_eventMetaData
Datastore pointers.
int m_runEvents
How many events processed for the current run so far, stops counting up once max is hit Only used/inc...
virtual void beginRun() override
Resets our event counter to zero and return value to True.
EventLimiterModule()
Constructor: Sets the description, the properties and the parameters of the module.
int m_maxEventsPerRun
Maximum number of events to be collected at the start of each run (-1 = no maximum)
void setDescription(const std::string &description)
Sets the description of the module.
void setReturnValue(int value)
Sets the return value for this module as integer.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.