Belle II Software light-2406-ragdoll
ProgressModule.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
9#pragma once
10
11/* Framework headers. */
12#include <framework/core/Module.h>
13
14/* C++ headers. */
15#include <stdint.h>
16
17/* boost headers. */
18#include <boost/format.hpp>
19
20namespace Belle2 {
38 class ProgressModule : public Module {
39
40 public:
41
44
46 void initialize() override;
47
49 void beginRun() override;
50
52 void event() override;
53
54 protected:
55
57 uint32_t m_maxOrder{3};
58
60 uint32_t m_evtNr{0};
61
63 uint32_t m_runNr{0};
64
66 uint32_t m_totalEvtNr{0};
67
69 boost::format m_output{"Processed: %3u runs, %6u/%6u events."};
70
71 };
73}
Base class for Modules.
Definition: Module.h:72
Periodically writes the number of processed events/runs to the logging system to give a progress indi...
uint32_t m_totalEvtNr
Total number of events in the current process.
void initialize() override
Init the module.
void event() override
Show progress.
uint32_t m_evtNr
Number of processed events.
uint32_t m_maxOrder
Maximum order of magnitude for interval between showing progress.
boost::format m_output
Compiled output format.
void beginRun() override
Show beginRun message.
ProgressModule()
Constructor.
uint32_t m_runNr
Number of processed runs.
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24