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

Owns and updates the run-level detector summary map. More...

#include <gRunDataCollection.h>

Public Member Functions

 GRunDataCollection (const std::shared_ptr< GOptions > &gopts, std::unique_ptr< GRunHeader > header)
 Constructs a run data collection with an owned run header.
 
void collect_event_data_collection (const std::shared_ptr< GEventDataCollection > edc)
 Integrates one event collection into the run summary.
 
void collect_event_data_collections (const std::string &sdName, std::unique_ptr< GDigitizedData > ddata)
 Integrates one digitized object into the named detector entry.
 
auto getHeader () const -> const std::unique_ptr< GRunHeader > &
 Returns read-only access to the owned run header.
 
auto getDataCollectionMap () const -> const std::map< std::string, std::unique_ptr< GDataCollection > > &
 Returns read-only access to the detector summary map.
 
auto getMutableDataCollectionMap () -> std::map< std::string, std::unique_ptr< GDataCollection > > &
 Returns mutable access to the detector summary map.
 
auto getRunNumber () const -> int
 Returns the run number stored in the owned header.
 
auto get_events_processed () const -> int
 Returns the total processed-event count stored in the header.
 
auto get_events_with_payload () const -> int
 Returns the number of processed events that contributed payload.
 
void merge (const GRunDataCollection &other)
 Merges another run accumulator into this one.
 
- 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 object integrates event content detector by detector.

Current event-integration behavior:

  • loops over detector entries in the event
  • iterates over the digitized hit vector for each detector
  • accumulates digitized non-SRO scalar observables through GDataCollection

This class also supports merging partial run accumulators through merge().

Definition at line 84 of file gRunDataCollection.h.

Constructor & Destructor Documentation

◆ GRunDataCollection()

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

Ownership of header is transferred to this object.

Parameters
goptsShared options used to configure logging and related behavior.
headerOwned run header.

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)

Current implementation:

  • increments the processed-event counter once
  • loops over detector entries present in edc
  • integrates the digitized hit objects stored under each detector

The detector-local accumulation rules are implemented in GDataCollection :

  • the first integrated entry creates the detector accumulator
  • subsequent entries contribute by summation of the supported observables
Parameters
edcEvent collection to integrate.

Definition at line 25 of file gRunDataCollection.cc.

◆ collect_event_data_collections()

void GRunDataCollection::collect_event_data_collections ( const std::string & sdName,
std::unique_ptr< GDigitizedData > ddata )

This helper accepts ownership of ddata and forwards the content into the detector-local accumulator path.

Parameters
sdNameSensitive detector name.
ddataDigitized object to integrate.

Definition at line 43 of file gRunDataCollection.cc.

◆ get_events_processed()

auto GRunDataCollection::get_events_processed ( ) const -> int
inline
Returns
Number of processed events.

Definition at line 173 of file gRunDataCollection.h.

◆ get_events_with_payload()

auto GRunDataCollection::get_events_with_payload ( ) const -> int
inline
Returns
Number of payload-producing events.

Definition at line 180 of file gRunDataCollection.h.

◆ getDataCollectionMap()

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

Keys are sensitive detector names and values are per-detector GDataCollection accumulators.

Returns
Const reference to the detector map.

Definition at line 144 of file gRunDataCollection.h.

◆ getHeader()

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

Definition at line 134 of file gRunDataCollection.h.

◆ getMutableDataCollectionMap()

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

This accessor is intended for workflows that need to update integrated detector payloads after collection, such as run-final normalization on the master thread.

Returns
Mutable reference to the detector map.

Definition at line 157 of file gRunDataCollection.h.

◆ getRunNumber()

auto GRunDataCollection::getRunNumber ( ) const -> int
inline
Returns
Run identifier.

Definition at line 166 of file gRunDataCollection.h.

◆ merge()

void GRunDataCollection::merge ( const GRunDataCollection & other)

This method is intended for end-of-run reduction when multiple partial accumulators have been produced independently.

Current merge behavior:

  • adds the event counters from other
  • merges the integrated digitized detector data from other into this object
Parameters
otherSource run accumulator whose content will be added into this object.

Definition at line 49 of file gRunDataCollection.cc.


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