CbmRoot
CbmDigiVector< Digi > Class Template Reference

std::vector implementation of CbmDigiContainer More...

#include <CbmDigiVector.h>

Inheritance diagram for CbmDigiVector< Digi >:
[legend]
Collaboration diagram for CbmDigiVector< Digi >:
[legend]

Public Member Functions

 CbmDigiVector (Bool_t hasMatches=kFALSE)
 Constructor. More...
 
virtual ~CbmDigiVector ()
 Destructor. More...
 
virtual void AddDigi (boost::any digi, const CbmMatch *match=nullptr)
 Add a digi (and match) to the vector. More...
 
virtual Bool_t ConnectToTree ()
 Connect to a ROOT TTree. More...
 
virtual boost::any GetDigi (UInt_t index)
 Get digi object. More...
 
virtual const CbmMatchGetDigiMatch (UInt_t index)
 Get digi match object. More...
 
virtual Bool_t HasMatches () const
 Presence of match objects. More...
 
virtual ULong64_t GetNofDigis () const
 Number of digis in the vector. More...
 
virtual std::string ToString () const
 String output. More...
 
virtual const char * GetName () const
 Name of container. More...
 
 ClassDef (CbmDigiContainer, 1)
 

Private Member Functions

 ClassDef (CbmDigiVector, 1)
 

Private Attributes

std::vector< Digi > fDigis {}
 
std::vector< CbmMatchfMatches {}
 
Bool_t fHasMatches = kFALSE
 
Bool_t fIsLocked = kFALSE
 

Detailed Description

template<class Digi>
class CbmDigiVector< Digi >

std::vector implementation of CbmDigiContainer

Author
Volker Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
11 March 2020

Definition at line 23 of file CbmDigiVector.h.

Constructor & Destructor Documentation

◆ CbmDigiVector()

template<class Digi >
CbmDigiVector< Digi >::CbmDigiVector ( Bool_t  hasMatches = kFALSE)
inline

Constructor.

Parameters
hasMatchesIf true, a match vector will be managed.

Definition at line 29 of file CbmDigiVector.h.

◆ ~CbmDigiVector()

template<class Digi >
virtual CbmDigiVector< Digi >::~CbmDigiVector ( )
inlinevirtual

Destructor.

Definition at line 37 of file CbmDigiVector.h.

Member Function Documentation

◆ AddDigi()

template<class Digi >
virtual void CbmDigiVector< Digi >::AddDigi ( boost::any  digi,
const CbmMatch match = nullptr 
)
inlinevirtual

Add a digi (and match) to the vector.

Parameters
digiPointer to digi object
matchPointer to match object

After the first call to GetDigi or GetMatch, the vector is locked; adding more digis is then not possible.

Reimplemented from CbmDigiContainer.

Definition at line 47 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fDigis, CbmDigiVector< Digi >::fHasMatches, CbmDigiVector< Digi >::fIsLocked, CbmDigiVector< Digi >::fMatches, and CbmDigiContainer::GetName().

◆ ClassDef() [1/2]

CbmDigiContainer::ClassDef ( CbmDigiContainer  ,
 
)
inherited

◆ ClassDef() [2/2]

template<class Digi >
CbmDigiVector< Digi >::ClassDef ( CbmDigiVector< Digi >  ,
 
)
private

◆ ConnectToTree()

template<class Digi >
virtual Bool_t CbmDigiVector< Digi >::ConnectToTree ( )
inlinevirtual

Connect to a ROOT TTree.

Abstract from base class; no implementation here.

Reimplemented from CbmDigiContainer.

Definition at line 73 of file CbmDigiVector.h.

◆ GetDigi()

template<class Digi >
virtual boost::any CbmDigiVector< Digi >::GetDigi ( UInt_t  index)
inlinevirtual

Get digi object.

Parameters
indexIndex of digi in the vector
Returns
Pointer to constant digi object

Returns a null pointer if index is out of range.

Implements CbmDigiContainer.

Definition at line 85 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fDigis, and CbmDigiVector< Digi >::fIsLocked.

◆ GetDigiMatch()

template<class Digi >
virtual const CbmMatch* CbmDigiVector< Digi >::GetDigiMatch ( UInt_t  index)
inlinevirtual

Get digi match object.

Parameters
indexIndex of digi in the vector
Returns
Pointer to corresponding match object

Returns a null pointer if matches are not present or index is out of range.

Implements CbmDigiContainer.

Definition at line 100 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fHasMatches, CbmDigiVector< Digi >::fIsLocked, and CbmDigiVector< Digi >::fMatches.

◆ GetName()

virtual const char* CbmDigiContainer::GetName ( ) const
inlinevirtualinherited

◆ GetNofDigis()

template<class Digi >
virtual ULong64_t CbmDigiVector< Digi >::GetNofDigis ( ) const
inlinevirtual

Number of digis in the vector.

Returns
Number of digi objects

Implements CbmDigiContainer.

Definition at line 117 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fDigis, CbmDigiVector< Digi >::fHasMatches, and CbmDigiVector< Digi >::fMatches.

◆ HasMatches()

template<class Digi >
virtual Bool_t CbmDigiVector< Digi >::HasMatches ( ) const
inlinevirtual

Presence of match objects.

Returns
True if matches are present; else false.

Implements CbmDigiContainer.

Definition at line 111 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fHasMatches.

Referenced by CbmDigiVector< Digi >::ToString().

◆ ToString()

template<class Digi >
virtual std::string CbmDigiVector< Digi >::ToString ( ) const
inlinevirtual

String output.

Info to string

Reimplemented from CbmDigiContainer.

Definition at line 126 of file CbmDigiVector.h.

References CbmDigiVector< Digi >::fDigis, CbmDigiContainer::GetName(), and CbmDigiVector< Digi >::HasMatches().

Member Data Documentation

◆ fDigis

template<class Digi >
std::vector<Digi> CbmDigiVector< Digi >::fDigis {}
private

◆ fHasMatches

template<class Digi >
Bool_t CbmDigiVector< Digi >::fHasMatches = kFALSE
private

◆ fIsLocked

template<class Digi >
Bool_t CbmDigiVector< Digi >::fIsLocked = kFALSE
private

◆ fMatches

template<class Digi >
std::vector<CbmMatch> CbmDigiVector< Digi >::fMatches {}
private

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