4#ifndef MUONTESTER_ARRAYBRANCH_H
5#define MUONTESTER_ARRAYBRANCH_H
27 bool fill(
const EventContext&)
override final;
29 bool init() override final;
45 T& operator[](
size_t s);
ArrayBranch(MuonTesterTree &tree, const std::string &name, size_t size, const T &def_val)
ArrayBranch(TTree *tree, const std::string &name, size_t size, const T &def_val)
Constructor with default value to be set in case an element is not updated.
std::vector< bool > m_updated
ArrayBranch(TTree *tree, const std::string &name, size_t size)
Constructor.
bool initialized() const
Is the branch initialized.
void setDefault(const T &val)
const T & get(size_t s) const
Returns the i-th value.
bool fill(const EventContext &) override final
Returns false if one of the array values is not updated.
size_t size() const
How large is the array.
void set(size_t s, const T &val)
Set's the i-th entry of the array to val.
virtual ~ArrayBranch()=default
const T & getDefault() const
default value in cases the branch is not updated
bool init() override final
Connects the branch with the tree.
std::string tree_data_type() const
Data type of the branch in the tree.
void reset()
Resets the check mask.
ArrayBranch(MuonTesterTree &tree, const std::string &name, size_t size)
T m_default
Default value in cases where the part are not updated.
Most basic interface class used by the MuonTester tree.
virtual std::string name() const =0
Returns the name of the branch.
virtual TTree * tree()=0
Returns the pointer to the underlying TTree object.
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Class to store array like branches into the n-tuples.