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
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
60std::vector<std::string> GetFileNamesFromTree(const TTree &tree);
62std::vector<std::string> GetTreeFullPaths(const TTree &tree);
63
64} // namespace TreeUtils
65} // namespace Internal
66} // namespace ROOT
67
68#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)
Retrieve the full path(s) to a TTree or the trees in a TChain.
RFriendInfo GetFriendInfo(const TTree &tree)
Get and store the names, aliases and file names of the direct friends of the tree.
std::vector< std::string > GetFileNamesFromTree(const TTree &tree)
Get and store the file names associated with the input tree.
std::pair< std::string, std::string > NameAlias
A pair of name and alias of a TTree's friend 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.
std::vector< std::vector< std::string > > fFriendChainSubNames
Names of the subtrees of a friend TChain.