CbmRoot
Loading...
Searching...
No Matches
CbmDigiBranchBase.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
10#ifndef CBMDIGIBRANCHBASE_H
11#define CBMDIGIBRANCHBASE_H 1
12
13#include <TString.h> // for TString
14
15#include <boost/any.hpp> // for any
16
17#include <cstddef> // for size_t
18#include <cstdint>
19#include <string> // for string
20
21class CbmMatch;
22
30
31public:
36 CbmDigiBranchBase(const char* name = "unknown") : fName(name) {}
37
38
40 virtual ~CbmDigiBranchBase() {}
41
42
47 virtual bool ConnectToTree() = 0;
48
49
54 virtual boost::any GetDigi(uint32_t index) = 0;
55
56
61 virtual const CbmMatch* GetDigiMatch(uint32_t index) = 0;
62
63
67 virtual bool HasMatches() = 0;
68
69
71 TString GetName() const { return fName; }
72
73
75 virtual std::size_t GetNofDigis() const = 0;
76
77
79 virtual std::string ToString() const { return ""; }
80
82 virtual boost::any GetBranchContainer() const { return nullptr; }
83
84protected:
85 TString fName;
86};
87
88
89#endif /* CBMDIGIBRANCHBASE_H */
Abstract base class for CBM digi branches.
virtual std::size_t GetNofDigis() const =0
Get the number of digis in the branch.
TString GetName() const
Name of branch.
TString fName
Branch name.
virtual ~CbmDigiBranchBase()
Destructor.
virtual const CbmMatch * GetDigiMatch(uint32_t index)=0
Get a digi from the branch.
CbmDigiBranchBase(const char *name="unknown")
Constructor.
virtual bool HasMatches()=0
Presence of match branch.
virtual boost::any GetDigi(uint32_t index)=0
Get a digi from the branch.
virtual std::string ToString() const
String output.
virtual bool ConnectToTree()=0
Connect the branch to the ROOT tree.
virtual boost::any GetBranchContainer() const
Get branch pointer.