11#ifndef CBMDIGIMANAGER_H
12#define CBMDIGIMANAGER_H 1
21#include <RtypesCore.h>
23#include <boost/any.hpp>
24#include <boost/exception/exception.hpp>
57 const Digi*
Get(Int_t index)
const
63 return boost::any_cast<const Digi*>(
fBranches[system]->GetDigi(index));
66 const boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::bad_any_cast>>&) {
67 LOG(fatal) <<
"Failed boost any_cast in Digimanager::Get for a digi of type " << Digi::GetClassName();
80 LOG(error) <<
"Failed to find branch for Digi of type " << Digi::GetClassName();
84 boost::any container = branch->second->GetBranchContainer();
85 LOG_IF(fatal, container.type() !=
typeid(
const std::vector<Digi>*))
86 <<
"Digis of type " << Digi::GetClassName() <<
" not stored with std::vector";
88 return *boost::any_cast<const std::vector<Digi>*>(container);
98 return (it !=
fBranches.end() ? it->second :
nullptr);
167 static std::map<ECbmModuleId, CbmDigiBranchBase*>
fBranches;
Abstract base class for CBM digi branches.
void SetBranchName(ECbmModuleId system, const char *name)
Set the digi branch name for a system.
static std::map< ECbmModuleId, CbmDigiBranchBase * > fBranches
gsl::span< const Digi > GetArray() const
static Int_t GetNofDigis(ECbmModuleId systemId)
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
std::map< ECbmModuleId, std::string > fBranchNames
CbmDigiBranchBase * GetBranch(ECbmModuleId system)
Access to a digi branch.
static Bool_t IsMatchPresent(ECbmModuleId systemId)
Presence of a digi match branch.
static Bool_t fUseMuchBeamTimeDigi
CbmDigiManager & operator=(const CbmDigiManager &)=delete
void UseMuchBeamTimeDigi(Bool_t)
Use CbmMuchBeamTimeDigi instead of CbmMuchDigi for MUCH.
virtual ~CbmDigiManager()
static CbmDigiManager * fgInstance
ClassDef(CbmDigiManager, 5)
InitStatus Init()
Initialisation.
const Digi * Get(Int_t index) const
Get a digi object.
CbmDigiManager(const CbmDigiManager &)=delete
static Bool_t fIsInitialised
void UseMuchBeamTimeDigi()
static CbmDigiManager * Instance()
Static instance.
const CbmMatch * GetMatch(ECbmModuleId systemId, UInt_t index) const
Get a match object.
void SetBranch()
Set a digi branch.