gdata
Loading...
Searching...
No Matches
gRunHeader.h
Go to the documentation of this file.
1
#pragma once
2
3
// gemc
4
#include "
gbase.h
"
5
6
// C++
7
#include <string>
8
28
constexpr
const
char
*
GDATARUNHEADER_LOGGER
=
"run_header"
;
29
30
namespace
grun_header
{
39
inline
auto
defineOptions
() ->
GOptions
{
40
auto
goptions
=
GOptions
(
GDATARUNHEADER_LOGGER
);
41
return
goptions
;
42
}
43
}
// namespace grun_header
44
61
class
GRunHeader
:
public
GBase
<GRunHeader>
62
{
63
public
:
77
GRunHeader
(
const
std::shared_ptr<GOptions>& gopts,
int
rid,
int
tid = -1)
78
:
GBase
(gopts,
GDATARUNHEADER_LOGGER
), runID(rid) {
79
log
->
debug
(
CONSTRUCTOR
,
"GRunHeader"
);
80
if
(tid != -1) {
81
log
->
info
(1,
"\n"
,
82
TPOINTITEM
,
" Run ID: "
, rid,
"\n"
,
83
TPOINTITEM
,
" Number of events collected: "
, events_processed,
84
TPOINTITEM
,
" Thread ID: "
, tid);
85
}
86
else
{
87
log
->
info
(1,
"\n"
,
88
TPOINTITEM
,
" Run ID: "
, rid,
"\n"
,
89
TPOINTITEM
,
" Number of events collected: "
, events_processed);
90
}
91
}
92
97
[[nodiscard]]
auto
getRunID
() const ->
int
{
return
runID; }
98
108
[[nodiscard]]
auto
get_events_processed
() const ->
int
{
return
events_processed; }
109
116
void
increment_events_processed
() { events_processed++; }
117
118
private
:
119
int
events_processed{0};
120
int
runID;
121
};
GBase
GBase< GRunHeader >::log
std::shared_ptr< GLogger > log
GLogger::debug
void debug(debug_type type, Args &&... args) const
GLogger::info
void info(int level, Args &&... args) const
GOptions
GRunHeader
Minimal run metadata: run ID and integrated-event counter.
Definition
gRunHeader.h:62
GRunHeader::GRunHeader
GRunHeader(const std::shared_ptr< GOptions > &gopts, int rid, int tid=-1)
Construct a run header.
Definition
gRunHeader.h:77
GRunHeader::increment_events_processed
void increment_events_processed()
Increment the number of processed events.
Definition
gRunHeader.h:116
GRunHeader::get_events_processed
auto get_events_processed() const -> int
Get the number of events integrated into this run summary so far.
Definition
gRunHeader.h:108
GRunHeader::getRunID
auto getRunID() const -> int
Get the run identifier.
Definition
gRunHeader.h:97
GDATARUNHEADER_LOGGER
constexpr const char * GDATARUNHEADER_LOGGER
Definition
gRunHeader.h:28
gbase.h
CONSTRUCTOR
CONSTRUCTOR
TPOINTITEM
#define TPOINTITEM
goptions
grun_header
Definition
gRunHeader.h:30
grun_header::defineOptions
auto defineOptions() -> GOptions
Defines GOptions for the run-header logger domain.
Definition
gRunHeader.h:39
run
gRunHeader.h
Generated by
1.10.0