|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef MUONTESTERTREE_MUONTESTERTREE_H
5 #define MUONTESTERTREE_MUONTESTERTREE_H
7 #include <GaudiKernel/ITHistSvc.h>
8 #include <GaudiKernel/ServiceHandle.h>
16 #include <type_traits>
28 class EventHashBranch;
37 const TTree*
tree()
const;
47 bool fill(
const EventContext& ctx);
50 std::string
name()
const;
54 const std::string&
path()
const;
57 void setPath(
const std::string& new_path);
60 template <
class OWNER,
86 template <
class T> std::shared_ptr<T>
getBranch(
const std::string&
str)
const;
113 const std::vector<FriendTreePtr>&
getFriends()
const;
145 std::vector<std::shared_ptr<IMuonTesterBranch>>
m_branches{};
std::vector< std::shared_ptr< IMuonTesterBranch > > m_branches
T & newBranch(std::shared_ptr< T > br)
returns the reference of the branch
bool initialized() const
Has the init method been called and the tree is connected with the output file.
ScalarBranch< T > & newScalar(const std::string &name, const T def_val)
bool m_init
Flag to avoid double initialization with the StoreGate.
bool m_written
Flag to indicate whether the TTree is written to the file or not.
std::shared_ptr< MuonTesterTree > FriendTreePtr
Appends the other tester Tree as friend to this instance.
std::shared_ptr< T > getBranch(const std::string &str) const
Retrieves the branches owned by the muon_tree.
StatusCode init(OWNER *instance)
Initialize method.
MuonTesterTree(const std::string &tree_name, const std::string &stream)
SetBranch< T > & newSet(const std::string &name)
bool isActive(const IMuonTesterBranch *branch) const
Returns a boolean whether the branch is already part of the tree or one of the deligated friends.
bool registerBranch(std::shared_ptr< IMuonTesterBranch > branch)
This method adds the branch to the tree and hands over the ownership to the MuonAnalysisTree instance...
TTree * operator->()
Operator to the TTree object.
bool addClient(MuonTesterTree *client)
Adds the other TTree as a Client and declares this instance as a Common Tree.
std::unique_ptr< TTree > m_tree
MatrixBranch< T > & newMatrix(const std::string &name, const T def_val)
const std::string & fileStream() const
file_stream of the analysis to which the tree belongs
std::vector< IMuonTesterBranch * > m_branches_to_init
bool isCommonTree() const
Returns Whether the Tree is a common tree or not.
void disableBranch(const std::string &br_name)
Skips the branch from being added to the tree.
SG::VarHandleKey * DataDependency
::StatusCode StatusCode
StatusCode definition for legacy code.
std::set< MuonTesterTree * > m_commonClients
List of all other MuonTesterTree instances using this instance as a common Tree If the Tree has one c...
VectorBranch< T > & newVector(const std::string &name, const T def_val)
Creates and returns branches with a default value.
Class to provide easy MsgStream access and capabilities.
VectorBranch< T > & newVector(const std::string &name)
Creates new branches and returns their reference.
Class to store array like branches into the n-tuples.
std::string name() const
Name of the tree.
std::vector< DataDependency > m_dependencies
void setPath(const std::string &new_path)
Save the TTree in a subfolder of the TFile.
ScalarBranch< T > & newScalar(const std::string &name)
A property holding a SG store/key/clid from which a VarHandle is made.
std::shared_ptr< EventHashBranch > m_hash_br
bool addCommonTree(FriendTreePtr common_tree)
std::vector< FriendTreePtr > m_friendLinks
List of all other common instances that are acting as friends.
std::set< IMuonTesterBranch * > m_initialized_br
Set of branches that were already initialized.
ServiceHandle< ITHistSvc > m_hist_svc
bool fill(const EventContext &ctx)
Fills the tree per call.
const std::string & path() const
sub directory in the TFile
StatusCode write()
Finally write the TTree objects.
MatrixBranch< T > & newMatrix(const std::string &name)
const std::vector< FriendTreePtr > & getFriends() const
unsigned int m_depCounter
Most basic interface class used by the MuonTester tree.
TTree * tree()
TTree object.
void removeBranch(IMuonTesterBranch *branch)
In case instances of a certain branch type are destroyed before hand.
std::set< std::string > m_excludedBranches
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.