Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
InternalTreeUtils.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9/**
10 \file ROOT/InternalTreeUtils.hxx
11 \ingroup tree
12 \author Enric Tejedor Saavedra
13 \author Enrico Guiraud
14 \author Vincenzo Eduardo Padulano
15 \date 2021-03
16*/
17
18#ifndef ROOT_INTERNAL_TREEUTILS_H
19#define ROOT_INTERNAL_TREEUTILS_H
20
21#include <utility> // std::pair
22#include <vector>
23#include <string>
24
25class TTree;
26
27namespace ROOT {
28namespace Internal {
29/**
30\namespace ROOT::Internal::TreeUtils
31\ingroup tree
32\brief Namespace hosting functions and classes to retrieve tree information for internal use.
33*/
34namespace TreeUtils {
35
36using NameAlias = std::pair<std::string, std::string>; ///< A pair of name and alias of a TTree's friend tree.
37/**
38\struct ROOT::Internal::TreeUtils::RFriendInfo
39\brief Information about friend trees of a certain TTree or TChain object.
40\ingroup tree
41*/
43
44 std::vector<NameAlias> fFriendNames; ///< Pairs of names and aliases of friend trees/chains.
45 /**
46 Names of the files where each friend is stored. fFriendFileNames[i] is the
47 list of files for friend with name fFriendNames[i].
48 */
49 std::vector<std::vector<std::string>> fFriendFileNames;
50 /**
51 Names of the subtrees of a friend TChain. fFriendChainSubNames[i] is the
52 list of names of the trees that make a friend TChain whose information is
53 stored at fFriendNames[i] and fFriendFileNames[i]. If instead the friend
54 tree at position `i` is a TTree, fFriendChainSubNames[i] will be just a
55 vector with a single empty string.
56 */
57 std::vector<std::vector<std::string>> fFriendChainSubNames;
58
59 void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
60
61 void
62 AddFriend(const std::string &treeName, const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
63
64 void AddFriend(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
65 const std::string &alias = "");
66};
67
68std::vector<std::string> GetFileNamesFromTree(const TTree &tree);
70std::vector<std::string> GetTreeFullPaths(const TTree &tree);
71
72} // namespace TreeUtils
73} // namespace Internal
74} // namespace ROOT
75
76#endif // ROOT_INTERNAL_TREEUTILS_H
A TTree represents a columnar dataset.
Definition TTree.h:79
Different standalone functions to work with trees and tuples, not reqiuired to be a member of any cla...
std::vector< std::string > GetTreeFullPaths(const TTree &tree)
std::pair< std::string, std::string > NameAlias
A pair of name and alias of a TTree's friend tree.
RFriendInfo GetFriendInfo(const TTree &tree)
std::vector< std::string > GetFileNamesFromTree(const TTree &tree)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition tree.py:1
Information about friend trees of a certain TTree or TChain object.
std::vector< NameAlias > fFriendNames
Pairs of names and aliases of friend trees/chains.
std::vector< std::vector< std::string > > fFriendFileNames
Names of the files where each friend is stored.
void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias="")
Add information of a single friend.
std::vector< std::vector< std::string > > fFriendChainSubNames
Names of the subtrees of a friend TChain.