Minimal event metadata header: event number, thread id, and timestamp.
More...
#include <gEventHeader.h>
|
| static std::unique_ptr< GEventHeader > | create (const std::shared_ptr< GOptions > &gopts, int tid=-1) |
| | Factory method used by examples/tests to create a header with a unique event number.
|
| |
This object is typically owned by GEventDataCollection as a std::unique_ptr.
It is primarily used for:
- labeling events in logs/output
- reproducing the event/thread provenance for debugging
Definition at line 59 of file gEventHeader.h.
◆ GEventHeader()
| GEventHeader::GEventHeader |
( |
const std::shared_ptr< GOptions > & | gopts, |
|
|
int | n, |
|
|
int | tid ) |
|
inline |
The constructor:
- assigns
timeStamp based on local time
- emits an informational log summarizing the header values
- Parameters
-
| gopts | Shared options object used to configure logging and behavior. |
| n | Local event number. |
| tid | Thread ID associated with this event. |
Definition at line 74 of file gEventHeader.h.
◆ create()
| static std::unique_ptr< GEventHeader > GEventHeader::create |
( |
const std::shared_ptr< GOptions > & | gopts, |
|
|
int | tid = -1 ) |
|
inlinestatic |
If tid is negative, a default thread ID is derived from the event number (currently mod 8) to mimic multi-threaded execution.
Threading notes:
- Uses an atomic counter so that concurrent calls from multiple threads produce unique event numbers.
- Parameters
-
| gopts | Shared options. |
| tid | Optional thread ID override. |
- Returns
- Newly created event header.
Definition at line 98 of file gEventHeader.h.
◆ getG4LocalEvn()
| int GEventHeader::getG4LocalEvn |
( |
| ) |
const |
|
inline |
This is "run-local" in typical Geant4 usage (i.e. it resets each run).
- Returns
- Event number.
Definition at line 121 of file gEventHeader.h.
◆ getThreadID()
| int GEventHeader::getThreadID |
( |
| ) |
const |
|
inline |
◆ getTimeStamp()
| std::string GEventHeader::getTimeStamp |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following files: