gdata
Loading...
Searching...
No Matches
GRunDataCollection Class Reference

Run-level container that integrates per-event detector data into per-detector summaries. More...

#include <gRunDataCollection.h>

Public Member Functions

 GRunDataCollection (const std::shared_ptr< GOptions > &gopts, std::unique_ptr< GRunHeader > header)
 Construct a run data collection.
 
void collect_event_data_collection (const std::shared_ptr< GEventDataCollection > edc)
 Integrate one event data collection into this run summary.
 
auto getHeader () const -> const std::unique_ptr< GRunHeader > &
 Access the owned run header.
 
auto getDataCollectionMap () const -> const std::map< std::string, std::unique_ptr< GDataCollection > > &
 Access the per-detector run summary map.
 
auto getRunNumber () const -> int
 Convenience accessor for the run number.
 
auto get_events_processed () const -> int
 Number of events integrated into this run summary.
 
- Public Member Functions inherited from GBase< GRunDataCollection >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Additional Inherited Members

- Protected Attributes inherited from GBase< GRunDataCollection >
std::shared_ptr< GLoggerlog
 

Detailed Description

The main API is collect_event_data_collection(), which:

  • loops over detectors present in the event
  • loops over all hits for each detector (truth and digitized)
  • delegates integration to GDataCollection accumulation methods

The per-detector map is keyed by sensitive detector name.

Note
Threading and merging This class acts as a single accumulator. If you create one accumulator per thread, you need a higher-level merge strategy (not implemented here).

Definition at line 81 of file gRunDataCollection.h.

Constructor & Destructor Documentation

◆ GRunDataCollection()

GRunDataCollection::GRunDataCollection ( const std::shared_ptr< GOptions > & gopts,
std::unique_ptr< GRunHeader > header )
inline

The header stores metadata such as run ID and (optionally) number of integrated events.

Ownership:

  • header is moved into this object and owned exclusively.
Parameters
goptsShared options object used to configure logging and behavior.
headerOwned run header describing this run.

Definition at line 96 of file gRunDataCollection.h.

Member Function Documentation

◆ collect_event_data_collection()

void GRunDataCollection::collect_event_data_collection ( const std::shared_ptr< GEventDataCollection > edc)

For each detector present in edc, integrates all per-hit entries:

  • truth hits (via the private method "collectDetectorTrueInfoData()")
  • digitized hits (via the private method "collectDetectorDigitizedData()")

The integration semantics for individual hits are implemented in GDataCollection :

  • first hit creates the integrated entry
  • subsequent hits contribute by summation of scalars
Parameters
edcEvent-level container to integrate.

Definition at line 37 of file gRunDataCollection.cc.

◆ get_events_processed()

auto GRunDataCollection::get_events_processed ( ) const -> int
inline

This value is stored in GRunHeader and incremented by increment_events_processed().

Returns
Count stored in the header.

Definition at line 150 of file gRunDataCollection.h.

◆ getDataCollectionMap()

auto GRunDataCollection::getDataCollectionMap ( ) const -> const std::map<std::string, std::unique_ptr<GDataCollection>>&
inline

Key: sensitive detector name. Value: per-detector GDataCollection accumulator.

Returns
Const reference to the detector map.

Definition at line 131 of file gRunDataCollection.h.

◆ getHeader()

auto GRunDataCollection::getHeader ( ) const -> const std::unique_ptr<GRunHeader>&
inline
Returns
Const reference to the header unique_ptr.

Definition at line 120 of file gRunDataCollection.h.

◆ getRunNumber()

auto GRunDataCollection::getRunNumber ( ) const -> int
inline
Returns
Run ID stored in the header.

Definition at line 139 of file gRunDataCollection.h.


The documentation for this class was generated from the following files: