Logo ROOT  
Reference Guide
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 
25 class TTree;
26 
27 namespace ROOT {
28 namespace 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 */
34 namespace TreeUtils {
35 
36 using 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 */
42 struct RFriendInfo {
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 
60 std::vector<std::string> GetFileNamesFromTree(const TTree &tree);
62 std::vector<std::string> GetTreeFullPaths(const TTree &tree);
63 
64 } // namespace TreeUtils
65 } // namespace Internal
66 } // namespace ROOT
67 
68 #endif // ROOT_INTERNAL_TREEUTILS_H
TreeUtils
Different standalone functions to work with trees and tuples, not reqiuired to be a member of any cla...
ROOT::Internal::TreeUtils::GetTreeFullPaths
std::vector< std::string > GetTreeFullPaths(const TTree &tree)
Retrieve the full path(s) to a TTree or the trees in a TChain.
Definition: InternalTreeUtils.cxx:189
ROOT::Internal::TreeUtils::GetFriendInfo
RFriendInfo GetFriendInfo(const TTree &tree)
Get and store the names, aliases and file names of the direct friends of the tree.
Definition: InternalTreeUtils.cxx:97
tree
Definition: tree.py:1
TTree
A TTree represents a columnar dataset.
Definition: TTree.h:79
ROOT::Internal::TreeUtils::RFriendInfo
Information about friend trees of a certain TTree or TChain object.
Definition: InternalTreeUtils.hxx:42
ROOT::Internal::TreeUtils::RFriendInfo::fFriendChainSubNames
std::vector< std::vector< std::string > > fFriendChainSubNames
Names of the subtrees of a friend TChain.
Definition: InternalTreeUtils.hxx:57
ROOT::Internal::TreeUtils::RFriendInfo::fFriendFileNames
std::vector< std::vector< std::string > > fFriendFileNames
Names of the files where each friend is stored.
Definition: InternalTreeUtils.hxx:49
ROOT::Internal::TreeUtils::GetFileNamesFromTree
std::vector< std::string > GetFileNamesFromTree(const TTree &tree)
Get and store the file names associated with the input tree.
Definition: InternalTreeUtils.cxx:30
ROOT::Internal::TreeUtils::NameAlias
std::pair< std::string, std::string > NameAlias
A pair of name and alias of a TTree's friend tree.
Definition: InternalTreeUtils.hxx:36
ROOT::Internal::TreeUtils::RFriendInfo::fFriendNames
std::vector< NameAlias > fFriendNames
Pairs of names and aliases of friend trees/chains.
Definition: InternalTreeUtils.hxx:44
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4