 |
Belle II Software
release-05-02-19
|
10 #include <framework/modules/core/EventLimiterModule.h>
11 #include <framework/core/Module.h>
27 setDescription(
"Allows you to set limits on the number of events per run passing this module. "
28 "It returns True until the limit is reached, after which it returns False. "
29 "basf2 conditional paths can then be used to prevent events continuing onwards from this module.");
32 addParam(
"maxEventsPerRun", m_maxEventsPerRun,
33 "Maximum number of events that will have True returned on them per run. "
34 "This module returns True until the limit in a particular run is reached, it then returns False. "
35 "It will only start returning True again once a new run begins. "
36 "The default value (-1) means that this module always returns True regardless of how many events "
37 "are processed in a run.",
int(-1));
52 B2INFO(
"Reached maximum number of events ("
54 <<
") for (Experiment, Run) = ("
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 event() override
Checks if we've reached the maximum number of events yet and sets the return value to False if we hav...
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
bool m_returnValue
Flag that will be returned by the module.
Abstract base class for different kinds of events.
int m_maxEventsPerRun
Maximum number of events to be collected at the start of each run (-1 = no maximum)
void setReturnValue(int value)
Sets the return value for this module as integer.
StoreObjPtr< EventMetaData > m_eventMetaData
Datastore pointers.
virtual void beginRun() override
Resets our event counter to zero and return value to True.
virtual void initialize() override
Initialization states required data objects (EventMetaData)