Belle II Software development
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 {
35 class ProgressModule : public Module {
36
37 public:
38
41
43 void initialize() override;
44
46 void beginRun() override;
47
49 void event() override;
50
51 protected:
52
54 uint32_t m_maxOrder{3};
55
57 uint32_t m_evtNr{0};
58
60 uint32_t m_runNr{0};
61
63 uint32_t m_totalEvtNr{0};
64
66 boost::format m_output{"Processed: %3u runs, %6u/%6u events."};
67
68 };
70}
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.