CbmRoot
Loading...
Searching...
No Matches
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 hasMatches=false)
 Constructor.
 
virtual ~CbmDigiVector ()
 Destructor.
 
virtual void AddDigi (boost::any digi, const CbmMatch *match=nullptr)
 Add a digi (and match) to the vector.
 
virtual bool ConnectToTree ()
 Connect to a ROOT TTree.
 
virtual boost::any GetDigi (uint32_t index)
 Get digi object.
 
virtual const CbmMatchGetDigiMatch (uint32_t index)
 Get digi match object.
 
virtual bool HasMatches () const
 Presence of match objects.
 
virtual uint64_t GetNofDigis () const
 Number of digis in the vector.
 
virtual std::string ToString () const
 String output.
 
virtual const char * GetName () const
 Name of container.
 
 ClassDef (CbmDigiContainer, 1)
 

Private Member Functions

 ClassDef (CbmDigiVector, 1)
 

Private Attributes

std::vector< Digi > fDigis {}
 
std::vector< CbmMatchfMatches {}
 
bool fHasMatches = false
 
bool fIsLocked = false
 

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 28 of file CbmDigiVector.h.

Constructor & Destructor Documentation

◆ CbmDigiVector()

template<class Digi>
CbmDigiVector< Digi >::CbmDigiVector ( bool hasMatches = false)
inline

Constructor.

Parameters
hasMatchesIf true, a match vector will be managed.

Definition at line 34 of file CbmDigiVector.h.

References fHasMatches.

Referenced by ClassDef().

◆ ~CbmDigiVector()

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

Destructor.

Definition at line 43 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 53 of file CbmDigiVector.h.

References fDigis, fHasMatches, fIsLocked, fMatches, and CbmDigiContainer::GetName().

◆ ClassDef() [1/2]

CbmDigiContainer::ClassDef ( CbmDigiContainer ,
1  )
inherited

References CbmDigiContainer().

◆ ClassDef() [2/2]

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

References CbmDigiVector().

◆ ConnectToTree()

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

Connect to a ROOT TTree.

Abstract from base class; no implementation here.

Reimplemented from CbmDigiContainer.

Definition at line 80 of file CbmDigiVector.h.

◆ GetDigi()

template<class Digi>
virtual boost::any CbmDigiVector< Digi >::GetDigi ( uint32_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 93 of file CbmDigiVector.h.

References fDigis, and fIsLocked.

◆ GetDigiMatch()

template<class Digi>
virtual const CbmMatch * CbmDigiVector< Digi >::GetDigiMatch ( uint32_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 109 of file CbmDigiVector.h.

References fHasMatches, fIsLocked, and fMatches.

◆ GetName()

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

Name of container.

Definition at line 83 of file CbmDigiContainer.h.

Referenced by CbmDigiVector< Digi >::AddDigi(), ToString(), and CbmDigiVector< Digi >::ToString().

◆ GetNofDigis()

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

Number of digis in the vector.

Returns
Number of digi objects

Implements CbmDigiContainer.

Definition at line 127 of file CbmDigiVector.h.

References fDigis, fHasMatches, and fMatches.

◆ HasMatches()

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

Presence of match objects.

Returns
True if matches are present; else false.

Implements CbmDigiContainer.

Definition at line 121 of file CbmDigiVector.h.

References fHasMatches.

Referenced by ToString().

◆ ToString()

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

String output.

Info to string

Reimplemented from CbmDigiContainer.

Definition at line 137 of file CbmDigiVector.h.

References fDigis, CbmDigiContainer::GetName(), and HasMatches().

Member Data Documentation

◆ fDigis

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

Definition at line 147 of file CbmDigiVector.h.

Referenced by AddDigi(), GetDigi(), GetNofDigis(), and ToString().

◆ fHasMatches

template<class Digi>
bool CbmDigiVector< Digi >::fHasMatches = false
private

Definition at line 149 of file CbmDigiVector.h.

Referenced by AddDigi(), CbmDigiVector(), GetDigiMatch(), GetNofDigis(), and HasMatches().

◆ fIsLocked

template<class Digi>
bool CbmDigiVector< Digi >::fIsLocked = false
private

Definition at line 150 of file CbmDigiVector.h.

Referenced by AddDigi(), GetDigi(), and GetDigiMatch().

◆ fMatches

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

Definition at line 148 of file CbmDigiVector.h.

Referenced by AddDigi(), GetDigiMatch(), and GetNofDigis().


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