Belle II Software development
EventLimiterModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <framework/core/Module.h>
11#include <framework/datastore/StoreObjPtr.h>
12#include <framework/dataobjects/EventMetaData.h>
13
14namespace Belle2 {
25 class EventLimiterModule : public Module {
26
27 public:
30
32 virtual ~EventLimiterModule() {};
33
35 virtual void initialize() override;
36
38 virtual void event() override;
39
41 virtual void beginRun() override;
42
43 private:
46
49
52 bool m_returnValue = true;
53
56 int m_runEvents = 0;
57 };
59}
The EventLimiter module.
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...
virtual ~EventLimiterModule()
Destructor of the module.
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)
Base class for Modules.
Definition: Module.h:72
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Abstract base class for different kinds of events.