CbmRoot
Loading...
Searching...
No Matches
CbmEventStore Class Reference

Storable event class for CBM. More...

#include <CbmEventStore.h>

Inheritance diagram for CbmEventStore:
[legend]
Collaboration diagram for CbmEventStore:
[legend]

Public Member Functions

 CbmEventStore (uint32_t eventId=0, bool hasMatches=false)
 Default constructor.
 
 CbmEventStore (const CbmEventStore &)
 Copy constructor.
 
 CbmEventStore (CbmEventStore &&)=default
 Move constructor.
 
virtual ~CbmEventStore ()
 Destructor.
 
template<class Digi >
void AddDigi (const Digi *digi)
 Add a digi object to the event.
 
template<class Digi >
void AddDigi (const Digi *digi, const CbmMatch *match)
 Add a digi and its match object to the event.
 
template<class Digi >
const Digi * GetDigi (uint32_t index) const
 Get a digi object.
 
uint32_t GetEventId () const
 Get event ID.
 
uint32_t GetNofDigis (ECbmModuleId system) const
 Number of digis for a given system.
 
bool HasMatches () const
 Presence of match objects.
 
bool IsEmpty () const
 Indicate whether event contains no digis.
 
void MatchToMC (CbmMatch &result) const
 Match to MC event.
 
CbmEventStoreoperator= (const CbmEventStore &)=delete
 Assignment operator.
 
std::string ToString () const
 

Private Member Functions

 ClassDef (CbmEventStore, 2)
 

Private Attributes

uint32_t fEventId = -1
 Event identifier.
 
bool fHasMatches = false
 Presence of matches to MC.
 
std::map< ECbmModuleId, TObject * > fDigis
 Map of CbmDigiVector.
 

Detailed Description

Storable event class for CBM.

Author
V.Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
11.03.2020
Version
1.0

The storable event contains digi objects associated to an event as direct data members. It is as such persistent. The internal representation of digis and their matches is through CbmDigiVector, using std::vector as underlying container.

Definition at line 43 of file CbmEventStore.h.

Constructor & Destructor Documentation

◆ CbmEventStore() [1/3]

CbmEventStore::CbmEventStore ( uint32_t eventId = 0,
bool hasMatches = false )

Default constructor.

Parameters
eventIdUnique event identifier
hasMatches True if matches to MC are stored

CbmEventStore.cxx

Author
V.Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
11.03.2020
Version
1.0

Definition at line 20 of file CbmEventStore.cxx.

◆ CbmEventStore() [2/3]

CbmEventStore::CbmEventStore ( const CbmEventStore & other)

Copy constructor.

Definition at line 28 of file CbmEventStore.cxx.

References fEventId, and fHasMatches.

◆ CbmEventStore() [3/3]

CbmEventStore::CbmEventStore ( CbmEventStore && )
default

Move constructor.

◆ ~CbmEventStore()

CbmEventStore::~CbmEventStore ( )
virtual

Destructor.

Definition at line 40 of file CbmEventStore.cxx.

References fDigis.

Member Function Documentation

◆ AddDigi() [1/2]

template<class Digi >
void CbmEventStore::AddDigi ( const Digi * digi)
inline

Add a digi object to the event.

Parameters
digiPointer to digi object

The data referenced by the argument will be copied into the internal arrays.

This method cannot be used if the event is set to contain matches.

Definition at line 74 of file CbmEventStore.h.

References fDigis, fHasMatches, and kNofSystems.

◆ AddDigi() [2/2]

template<class Digi >
void CbmEventStore::AddDigi ( const Digi * digi,
const CbmMatch * match )
inline

Add a digi and its match object to the event.

Parameters
digiPointer to digi object
matchPointer to match object

The data referenced by the arguments will be copied into the internal arrays.

This method cannot be used if the event is not set to contain matches.

Definition at line 100 of file CbmEventStore.h.

References fDigis, fHasMatches, and kNofSystems.

◆ ClassDef()

CbmEventStore::ClassDef ( CbmEventStore ,
2  )
private

◆ GetDigi()

template<class Digi >
const Digi * CbmEventStore::GetDigi ( uint32_t index) const
inline

Get a digi object.

Parameters
IndexIndex of digi object for the given system in the event
Returns
Pointer to digi object.

The method will return a null pointer if the detector system is not present or the index is out of range.

Definition at line 125 of file CbmEventStore.h.

References fDigis, and kNofSystems.

◆ GetEventId()

uint32_t CbmEventStore::GetEventId ( ) const
inline

Get event ID.

Returns
Event identifier

Definition at line 138 of file CbmEventStore.h.

References fEventId.

◆ GetNofDigis()

uint32_t CbmEventStore::GetNofDigis ( ECbmModuleId system) const

Number of digis for a given system.

Parameters
systemSystem identifier [ECbmModuleId]
Returns
Number of digis for system in event

Definition at line 71 of file CbmEventStore.cxx.

References fDigis, CbmDigiContainer::GetNofDigis(), and kNofSystems.

◆ HasMatches()

bool CbmEventStore::HasMatches ( ) const
inline

Presence of match objects.

Parameters
Iftrue, match objects are stored

Definition at line 151 of file CbmEventStore.h.

References fHasMatches.

◆ IsEmpty()

bool CbmEventStore::IsEmpty ( ) const

Indicate whether event contains no digis.

Returns
True is event is empty

Definition at line 51 of file CbmEventStore.cxx.

References fDigis, and CbmDigiContainer::GetNofDigis().

Referenced by ToString().

◆ MatchToMC()

void CbmEventStore::MatchToMC ( CbmMatch & result) const

Match to MC event.

Parameters
[out]Referenceto event match object

The method evaluates all digi matches and combines them into an event match object.

Definition at line 82 of file CbmEventStore.cxx.

References CbmMatch::AddLink(), CbmMatch::ClearLinks(), fDigis, fHasMatches, CbmLink::GetEntry(), CbmLink::GetFile(), CbmMatch::GetLink(), CbmMatch::GetNofLinks(), and CbmLink::GetWeight().

◆ operator=()

CbmEventStore & CbmEventStore::operator= ( const CbmEventStore & )
delete

Assignment operator.

◆ ToString()

std::string CbmEventStore::ToString ( ) const

String output

Definition at line 119 of file CbmEventStore.cxx.

References fDigis, fEventId, fHasMatches, CbmModuleList::GetModuleNameCaps(), and IsEmpty().

Member Data Documentation

◆ fDigis

std::map<ECbmModuleId, TObject*> CbmEventStore::fDigis
private

◆ fEventId

uint32_t CbmEventStore::fEventId = -1
private

Event identifier.

Definition at line 178 of file CbmEventStore.h.

Referenced by CbmEventStore(), GetEventId(), and ToString().

◆ fHasMatches

bool CbmEventStore::fHasMatches = false
private

Presence of matches to MC.

Definition at line 179 of file CbmEventStore.h.

Referenced by AddDigi(), AddDigi(), CbmEventStore(), HasMatches(), MatchToMC(), and ToString().


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