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

Private Member Functions

 ClassDef (CbmEventStore, 2)
 

Private Attributes

UInt_t fEventId = -1
 Event identifier. More...
 
Bool_t fHasMatches = kFALSE
 Presence of matches to MC. More...
 
std::map< ECbmModuleId, TObject * > fDigis
 Map of CbmDigiVector. More...
 

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 39 of file CbmEventStore.h.

Constructor & Destructor Documentation

◆ CbmEventStore() [1/3]

CbmEventStore::CbmEventStore ( UInt_t  eventId = 0,
Bool_t  hasMatches = kFALSE 
)

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 18 of file CbmEventStore.cxx.

◆ CbmEventStore() [2/3]

CbmEventStore::CbmEventStore ( const CbmEventStore other)

Copy constructor.

Definition at line 26 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 37 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 70 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 95 of file CbmEventStore.h.

References fDigis, fHasMatches, and kNofSystems.

◆ ClassDef()

CbmEventStore::ClassDef ( CbmEventStore  ,
 
)
private

◆ GetDigi()

template<class Digi >
const Digi* CbmEventStore::GetDigi ( UInt_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 119 of file CbmEventStore.h.

References fDigis, and kNofSystems.

◆ GetEventId()

UInt_t CbmEventStore::GetEventId ( ) const
inline

Get event ID.

Returns
Event identifier

Definition at line 131 of file CbmEventStore.h.

References fEventId.

◆ GetNofDigis()

UInt_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 66 of file CbmEventStore.cxx.

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

◆ HasMatches()

Bool_t CbmEventStore::HasMatches ( ) const
inline

Presence of match objects.

Parameters
Iftrue, match objects are stored

Definition at line 144 of file CbmEventStore.h.

References fHasMatches.

◆ IsEmpty()

Bool_t CbmEventStore::IsEmpty ( ) const

Indicate whether event contains no digis.

Returns
True is event is empty

Definition at line 47 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 76 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 112 of file CbmEventStore.cxx.

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

Member Data Documentation

◆ fDigis

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

Map of CbmDigiVector.

Definition at line 174 of file CbmEventStore.h.

Referenced by AddDigi(), GetDigi(), GetNofDigis(), IsEmpty(), MatchToMC(), ToString(), and ~CbmEventStore().

◆ fEventId

UInt_t CbmEventStore::fEventId = -1
private

Event identifier.

Definition at line 171 of file CbmEventStore.h.

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

◆ fHasMatches

Bool_t CbmEventStore::fHasMatches = kFALSE
private

Presence of matches to MC.

Definition at line 172 of file CbmEventStore.h.

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


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