CbmRoot
CbmDigiBranch< Digi > Class Template Reference

Class template for CBM digi branches. More...

#include <CbmDigiBranch.h>

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

Public Member Functions

 CbmDigiBranch (const char *name="unknown")
 Constructor. More...
 
virtual ~CbmDigiBranch ()
 Destructor. More...
 
virtual Bool_t ConnectToTree ()
 Connect the branch to the ROOT tree. More...
 
virtual std::size_t GetNofDigis () const
 Number of digis. More...
 
virtual boost::any GetDigi (UInt_t index)
 Get digi object. More...
 
virtual const CbmMatchGetDigiMatch (UInt_t index)
 Get match object. More...
 
virtual Bool_t HasMatches ()
 Presence of match branch. More...
 
virtual std::string ToString () const
 String output. More...
 
TString GetName () const
 Name of branch. More...
 

Protected Attributes

TString fName
 Branch name. More...
 

Private Attributes

const std::vector< Digi > * fDigiVector
 
const std::vector< CbmMatch > * fMatchVector
 Vector of Digi objects. More...
 
TClonesArray * fDigiArray
 Vector of match objects. More...
 
TClonesArray * fMatchArray
 TClonesArray of Digi objects. More...
 

Detailed Description

template<class Digi>
class CbmDigiBranch< Digi >

Class template for CBM digi branches.

Author
V. Friese v.fri.nosp@m.ese@.nosp@m.gsi.d.nosp@m.e
Since
4 June 2019

Interface to branches holding CbmDigis. The branch may hold a std::vector or a TClonesArray. The requirement to the specialisation is that the class Digi derives from CbmDigi (its pointer can be cast to CbmDigi*).

Definition at line 25 of file CbmDigiBranch.h.

Constructor & Destructor Documentation

◆ CbmDigiBranch()

template<class Digi >
CbmDigiBranch< Digi >::CbmDigiBranch ( const char *  name = "unknown")
inline

Constructor.

Parameters
nameBranch name

Definition at line 32 of file CbmDigiBranch.h.

◆ ~CbmDigiBranch()

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

Destructor.

Definition at line 43 of file CbmDigiBranch.h.

Member Function Documentation

◆ ConnectToTree()

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

Connect the branch to the ROOT tree.

Returns
true if branch is found in the ROOT tree

A std::vector is first looked for; if not found, a TClonesArray is looked for.

Implements CbmDigiBranchBase.

Definition at line 54 of file CbmDigiBranch.h.

References CbmDigiBranch< Digi >::fDigiArray, CbmDigiBranch< Digi >::fDigiVector, CbmDigiBranch< Digi >::fMatchArray, CbmDigiBranch< Digi >::fMatchVector, and CbmDigiBranchBase::fName.

◆ GetDigi()

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

Get digi object.

Parameters
indexIndex of digi in branch container
Returns
Pointer to constant digi object.

Returns a null pointer if the branch is not present.

Implements CbmDigiBranchBase.

Definition at line 106 of file CbmDigiBranch.h.

References CbmDigiBranch< Digi >::fDigiArray, CbmDigiBranch< Digi >::fDigiVector, and CbmDigiBranch< Digi >::GetNofDigis().

◆ GetDigiMatch()

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

Get match object.

Parameters
indexIndex of match in branch container
Returns
Pointer to constant match object.

Returns a null pointer if the branch is not present.

Implements CbmDigiBranchBase.

Definition at line 126 of file CbmDigiBranch.h.

References CbmDigiBranch< Digi >::fMatchArray, CbmDigiBranch< Digi >::fMatchVector, and CbmDigiBranch< Digi >::GetNofDigis().

◆ GetName()

TString CbmDigiBranchBase::GetName ( ) const
inlineinherited

Name of branch.

Definition at line 67 of file CbmDigiBranchBase.h.

References CbmDigiBranchBase::fName.

◆ GetNofDigis()

template<class Digi >
virtual std::size_t CbmDigiBranch< Digi >::GetNofDigis ( ) const
inlinevirtual

Number of digis.

Returns
Current number of digis in the branch container

Implements CbmDigiBranchBase.

Definition at line 86 of file CbmDigiBranch.h.

References CbmDigiBranch< Digi >::fDigiArray, and CbmDigiBranch< Digi >::fDigiVector.

Referenced by CbmDigiBranch< Digi >::GetDigi(), and CbmDigiBranch< Digi >::GetDigiMatch().

◆ HasMatches()

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

Presence of match branch.

Returns
kTRUE if match branch is present

Implements CbmDigiBranchBase.

Definition at line 143 of file CbmDigiBranch.h.

References CbmDigiBranch< Digi >::fMatchArray, and CbmDigiBranch< Digi >::fMatchVector.

◆ ToString()

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

Member Data Documentation

◆ fDigiArray

template<class Digi >
TClonesArray* CbmDigiBranch< Digi >::fDigiArray
private

◆ fDigiVector

template<class Digi >
const std::vector<Digi>* CbmDigiBranch< Digi >::fDigiVector
private

◆ fMatchArray

template<class Digi >
TClonesArray* CbmDigiBranch< Digi >::fMatchArray
private

◆ fMatchVector

template<class Digi >
const std::vector<CbmMatch>* CbmDigiBranch< Digi >::fMatchVector
private

◆ fName

TString CbmDigiBranchBase::fName
protectedinherited

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