Logo ROOT  
Reference Guide
RFriendInfo.hxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2022, 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/RFriendInfo.hxx
11 \ingroup tree
12 \author Ivan Kabadzhov
13 \author Enrico Guiraud
14 \author Vincenzo Eduardo Padulano
15 \date 2022-10
16*/
17
18#ifndef ROOT_RFRIENDINFO_H
19#define ROOT_RFRIENDINFO_H
20
21#include <string>
22#include <utility> // std::pair
23#include <vector>
24
25class TTree;
26
27namespace ROOT {
28namespace TreeUtils {
29/**
30\struct ROOT::TreeUtils::RFriendInfo
31\brief Information about friend trees of a certain TTree or TChain object.
32\ingroup tree
33*/
35
36 std::vector<std::pair<std::string, std::string>>
37 fFriendNames; ///< Pairs of names and aliases of friend trees/chains.
38 /**
39 Names of the files where each friend is stored. fFriendFileNames[i] is the
40 list of files for friend with name fFriendNames[i].
41 */
42 std::vector<std::vector<std::string>> fFriendFileNames;
43 /**
44 Names of the subtrees of a friend TChain. fFriendChainSubNames[i] is the
45 list of names of the trees that make a friend TChain whose information is
46 stored at fFriendNames[i] and fFriendFileNames[i]. If instead the friend
47 tree at position `i` is a TTree, fFriendChainSubNames[i] will be an empty
48 vector.
49 */
50 std::vector<std::vector<std::string>> fFriendChainSubNames;
51
52 void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
53
54 void
55 AddFriend(const std::string &treeName, const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
56
57 void AddFriend(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
58 const std::string &alias = "");
59};
60
61} // namespace TreeUtils
62} // namespace ROOT
63
64#endif // ROOT_RFRIENDINFO_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...
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Information about friend trees of a certain TTree or TChain object.
Definition: RFriendInfo.hxx:34
std::vector< std::pair< std::string, std::string > > fFriendNames
Pairs of names and aliases of friend trees/chains.
Definition: RFriendInfo.hxx:37
void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias="")
Add information of a single friend.
Definition: RFriendInfo.cxx:21
std::vector< std::vector< std::string > > fFriendChainSubNames
Names of the subtrees of a friend TChain.
Definition: RFriendInfo.hxx:50
std::vector< std::vector< std::string > > fFriendFileNames
Names of the files where each friend is stored.
Definition: RFriendInfo.hxx:42