CbmRoot
Loading...
Searching...
No Matches
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.
 
virtual ~CbmDigiBranch ()
 Destructor.
 
virtual bool ConnectToTree ()
 Connect the branch to the ROOT tree.
 
virtual std::size_t GetNofDigis () const
 Number of digis.
 
virtual boost::any GetDigi (uint32_t index)
 Get digi object.
 
virtual const CbmMatchGetDigiMatch (uint32_t index)
 Get match object.
 
virtual bool HasMatches ()
 Presence of match branch.
 
virtual std::string ToString () const
 String output.
 
virtual boost::any GetBranchContainer () const
 Get branch pointer.
 
TString GetName () const
 Name of branch.
 

Protected Attributes

TString fName
 Branch name.
 

Private Attributes

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

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 30 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 37 of file CbmDigiBranch.h.

◆ ~CbmDigiBranch()

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

Destructor.

Definition at line 50 of file CbmDigiBranch.h.

Member Function Documentation

◆ ConnectToTree()

template<class Digi >
virtual bool 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 61 of file CbmDigiBranch.h.

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

◆ GetBranchContainer()

template<class Digi >
virtual boost::any CbmDigiBranch< Digi >::GetBranchContainer ( ) const
inlinevirtual

Get branch pointer.

Returns
Pointer to the connected data container (const) A std::vector is first looked for; if not found, a TClonesArray is looked for. Returns a null pointer if the branch is not present.

Reimplemented from CbmDigiBranchBase.

Definition at line 183 of file CbmDigiBranch.h.

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

◆ GetDigi()

template<class Digi >
virtual boost::any CbmDigiBranch< Digi >::GetDigi ( uint32_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 109 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 ( uint32_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 129 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 71 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 89 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 CbmDigiBranch< Digi >::HasMatches ( )
inlinevirtual

Presence of match branch.

Returns
true if match branch is present

Implements CbmDigiBranchBase.

Definition at line 146 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

◆ 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: