Event-level construction and inspection of per-detector hit data.
More...
|
| int | main (int argc, char *argv[]) |
| |
This example emulates a simplified event loop where each event produces hit data for one or more sensitive detectors and stores them into a GEventDataCollection.
The GEventDataCollection owns per-hit objects (event-level semantics). For each hit, two complementary views may be produced and stored:
- GTrueInfoData stores simulation-level ("truth") observables derived from tracking (energy deposition, step-averaged kinematics, positions, times, provenance labels, ...).
- GDigitizedData stores electronics-level ("digitized") observables produced by detector response and digitization logic (ADC/TDC-like quantities, calibrated values, readout coordinates, ...).
For each event, data are organized as:
- vector<unique_ptr<GTrueInfoData>> (one per hit)
- vector<unique_ptr<GDigitizedData>> (one per hit)
Per-sensitive-detector container that owns true and digitized hit data.
What this example demonstrates
- Creating event containers with the factory create().
- Adding additional hits and additional detectors to the same event with:
- Inspecting stored data:
- Demonstrating filtering of streaming-readout (SRO) keys for digitized data:
Threading model
The example uses a simple work-distribution pattern:
- A shared atomic counter assigns event numbers.
- Each worker thread builds independent GEventDataCollection objects.
- Results are appended to a shared vector under a mutex.
- Note
- create() and the test factories create() and create() use internal thread-safe counters, so concurrent execution is supported for this example-style workload.
Usage
Build this example together with the GData library components and required GEMC utilities (logging, options, threads abstraction). Then run it to print a readable dump of each generated event container.
- Author
© Maurizio Ungaro
-
e-mail: ungar.nosp@m.o@jl.nosp@m.ab.or.nosp@m.g
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |