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

Per-sensitive-detector container that owns truth and digitized data objects. More...

#include <gDataCollection.h>

Public Member Functions

 GDataCollection ()=default
 Constructs an empty detector-local data collection.
 
 ~GDataCollection ()=default
 Destroys the collection and all owned hit objects.
 
void collectTrueInfosData (const std::unique_ptr< GTrueInfoData > &data)
 Integrates one truth object into the detector-level accumulator.
 
void collectDigitizedData (const std::unique_ptr< GDigitizedData > &data)
 Integrates one digitized object into the detector-level accumulator.
 
void addDigitizedData (std::unique_ptr< GDigitizedData > data)
 Appends one digitized object in event mode.
 
void addTrueInfoData (std::unique_ptr< GTrueInfoData > data)
 Appends one truth object in event mode.
 
auto getTrueInfoData () const -> const std::vector< std::unique_ptr< GTrueInfoData > > &
 Returns read-only access to the stored truth objects.
 
auto getDigitizedData () const -> const std::vector< std::unique_ptr< GDigitizedData > > &
 Returns read-only access to the stored digitized objects.
 
auto getMutableDigitizedData () -> std::vector< std::unique_ptr< GDigitizedData > > &
 Returns mutable access to the stored digitized objects.
 

Friends

std::ostream & operator<< (std::ostream &os, const GDataCollection &collection)
 

Detailed Description

In higher-level maps, a GDataCollection is usually keyed by the sensitive detector name.

Stored content:

  • trueInfosData : truth objects, typically one per hit in event mode
  • digitizedData : digitized objects, typically one per hit in event mode

Usage modes:

  • Event mode : vectors grow by appending objects
  • Integrated mode : the first vector element acts as the running accumulator

Definition at line 64 of file gDataCollection.h.

Constructor & Destructor Documentation

◆ GDataCollection()

GDataCollection::GDataCollection ( )
explicitdefault

The object starts with empty truth and digitized vectors. Detector naming is handled by the owning map at higher levels.

◆ ~GDataCollection()

GDataCollection::~GDataCollection ( )
default

Both truth and digitized entries are stored in std::unique_ptr containers, so destruction is automatic and exception-safe.

Member Function Documentation

◆ addDigitizedData()

void GDataCollection::addDigitizedData ( std::unique_ptr< GDigitizedData > data)
inline

Ownership of data is transferred to this collection. Each appended object normally corresponds to one hit for this detector in one event.

Parameters
dataDigitized object to store.

Definition at line 156 of file gDataCollection.h.

◆ addTrueInfoData()

void GDataCollection::addTrueInfoData ( std::unique_ptr< GTrueInfoData > data)
inline

Ownership of data is transferred to this collection. Each appended object normally corresponds to one hit for this detector in one event.

Parameters
dataTruth object to store.

Definition at line 170 of file gDataCollection.h.

◆ collectDigitizedData()

void GDataCollection::collectDigitizedData ( const std::unique_ptr< GDigitizedData > & data)
inline

This method is intended for integrated usage.

Behavior:

  • if the digitized vector is empty, a deep copy of data becomes the first accumulator entry
  • otherwise, non-SRO integer and floating-point observables from data are summed into the first entry

Current integration policy:

  • only scalar observables are accumulated
  • SRO keys are excluded by requesting filtered maps with which = 0
Parameters
dataSource digitized object whose values are copied or accumulated.

Definition at line 131 of file gDataCollection.h.

◆ collectTrueInfosData()

void GDataCollection::collectTrueInfosData ( const std::unique_ptr< GTrueInfoData > & data)
inline

This method is intended for integrated usage.

Behavior:

  • if the truth vector is empty, a deep copy of data becomes the first accumulator entry
  • otherwise, each numeric truth observable from data is summed into the first entry

Current integration policy:

  • only numeric truth observables are accumulated
  • string truth observables are not merged
Parameters
dataSource truth object whose values are copied or accumulated.

Definition at line 101 of file gDataCollection.h.

◆ getDigitizedData()

auto GDataCollection::getDigitizedData ( ) const -> const std::vector<std::unique_ptr<GDigitizedData>>&
inline

Interpretation depends on the usage mode:

  • in event mode, vector size usually matches the number of digitized hits for the detector
  • in integrated mode, vector usually contains one accumulator entry
Returns
Const reference to the owned vector of digitized objects.

Definition at line 199 of file gDataCollection.h.

◆ getMutableDigitizedData()

auto GDataCollection::getMutableDigitizedData ( ) -> std::vector<std::unique_ptr<GDigitizedData>>&
inline

This accessor is intended for workflows that need to update detector-local integrated digitized payloads after collection, such as final normalization at run end.

Returns
Mutable reference to the owned vector of digitized objects.

Definition at line 212 of file gDataCollection.h.

◆ getTrueInfoData()

auto GDataCollection::getTrueInfoData ( ) const -> const std::vector<std::unique_ptr<GTrueInfoData>>&
inline

Interpretation depends on the usage mode:

  • in event mode, vector size usually matches the number of truth hits for the detector
  • in integrated mode, vector usually contains one accumulator entry
Returns
Const reference to the owned vector of truth objects.

Definition at line 185 of file gDataCollection.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const GDataCollection & collection )
friend

Definition at line 242 of file gDataCollection.h.


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