All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TreeHolder.h
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/details/TreeHolder.h
3  * @brief Class holding a ROOT tree, to be shared by other classes.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date May 15, 2020
6  */
7 
8 #ifndef ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_TREEHOLDER_H
9 #define ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_TREEHOLDER_H
10 
11 
12 // ROOT libraries
13 #include "TTree.h"
14 
15 
16 //------------------------------------------------------------------------------
17 namespace icarus::trigger::details { struct TreeHolder; }
18 
19 /**
20  * @brief Simple class holding a tree.
21  *
22  * To be shared.
23  */
25 
26  TreeHolder() = default;
27  TreeHolder(TTree& tree): fTree(&tree) {}
28 
29  TTree& tree() { return *fTree; }
30  TTree const& tree() const { return *fTree; }
31 
32  private:
33  TTree* fTree = nullptr;
34 
35 }; // struct TreeHolder
36 
37 
38 //------------------------------------------------------------------------------
39 
40 
41 #endif // ICARUSCODE_PMT_TRIGGER_ALGORITHM_DETAILS_TREEHOLDER_H
Simple class holding a tree.
Definition: TreeHolder.h:24
TTree const & tree() const
Definition: TreeHolder.h:30