gdata
Loading...
Searching...
No Matches
Run data integration example

Run-level integration of many events into a single detector-summary map. More...

Typedefs

using PerDetectorDoubles = std::map<std::string, std::map<std::string, double>>
 Type alias for per-detector scalar accumulation maps used in this example.
 
using PerDetectorInts = std::map<std::string, std::map<std::string, long long>>
 

Functions

int main (int argc, char *argv[])
 

Detailed Description

This example shows how to integrate many GEventDataCollection objects into a single GRunDataCollection summary using accumulation semantics (sums of scalar observables).

The workflow is: 1) Build N events (GEventDataCollection) — possibly in parallel. 2) Integrate each event into a GRunDataCollection via collect_event_data_collection(). 3) Inspect the resulting run summary map:

sdName -> GDataCollection (run-integrated)
- vector<unique_ptr<GTrueInfoData>> typically size 1 (integrated entry)
- vector<unique_ptr<GDigitizedData>> typically size 1 (integrated entry)
Per-sensitive-detector container that owns true and digitized hit data.

What this example demonstrates

Integration details worth noticing

Threading model

Event generation can be parallel. Run integration is performed sequentially in this example to:

Warning
Accumulated values are sums. If you need averages/rates, normalize in the consumer.

Usage

Build this example together with the GData library components and required GEMC utilities.

Author

© Maurizio Ungaro
e-mail: ungar.nosp@m.o@jl.nosp@m.ab.or.nosp@m.g

Typedef Documentation

◆ PerDetectorDoubles

using PerDetectorDoubles = std::map<std::string, std::map<std::string, double>>

We keep separate reference sums for:

  • truth doubles (numeric observables stored in GTrueInfoData)
  • digitized ints (non-SRO keys only)
  • digitized dbls (non-SRO keys only)

Using distinct maps makes it explicit which channels are expected to be integrated by which rules.

Definition at line 112 of file run_example.cc.

◆ PerDetectorInts

using PerDetectorInts = std::map<std::string, std::map<std::string, long long>>

Definition at line 113 of file run_example.cc.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 309 of file run_example.cc.