Stores minimal metadata for one event.
More...
#include <gEventHeader.h>
|
| | GEventHeader (const std::shared_ptr< GOptions > &gopts, int n, int tid) |
| | Constructs an event header with explicit event and thread identifiers.
|
| std::string | getTimeStamp () const |
| | Returns the formatted timestamp string.
|
| int | getG4LocalEvn () const |
| | Returns the local event number.
|
| int | getThreadID () const |
| | Returns the thread identifier associated with the event.
|
| | GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
|
| static std::unique_ptr< GEventHeader > | create (const std::shared_ptr< GOptions > &gopts, int tid=-1) |
| | Creates a header with a unique event number for tests and examples.
|
The object provides a compact event label and provenance bundle containing:
- the local event number
- the thread identifier used for diagnostics
- a construction-time timestamp string
Ownership:
Definition at line 69 of file gEventHeader.h.
◆ GEventHeader()
| GEventHeader::GEventHeader |
( |
const std::shared_ptr< GOptions > & | gopts, |
|
|
int | n, |
|
|
int | tid ) |
|
inline |
The constructor also assigns a local-time timestamp string and emits an informational summary through the logger.
- Parameters
-
| gopts | Shared options used to configure logging and related behavior. |
| n | Local event number. |
| tid | Thread identifier associated with the event. |
Definition at line 83 of file gEventHeader.h.
◆ create()
| std::unique_ptr< GEventHeader > GEventHeader::create |
( |
const std::shared_ptr< GOptions > & | gopts, |
|
|
int | tid = -1 ) |
|
inlinestatic |
If tid is negative, a synthetic thread identifier is derived from the event number. The generated event number comes from a static atomic counter so concurrent example code can obtain unique values.
- Parameters
-
| gopts | Shared options. |
| tid | Optional thread identifier override. |
- Returns
- Newly created event header.
Definition at line 105 of file gEventHeader.h.
◆ getG4LocalEvn()
| int GEventHeader::getG4LocalEvn |
( |
| ) |
const |
|
inlinenodiscard |
In typical Geant4-style usage, this value is run-local.
- Returns
- Local event number.
Definition at line 129 of file gEventHeader.h.
◆ getThreadID()
| int GEventHeader::getThreadID |
( |
| ) |
const |
|
inlinenodiscard |
◆ getTimeStamp()
| std::string GEventHeader::getTimeStamp |
( |
| ) |
const |
|
inlinenodiscard |
- Returns
- Timestamp assigned at construction.
Definition at line 119 of file gEventHeader.h.
The documentation for this class was generated from the following files: