Logo ROOT  
Reference Guide
RDatasetSpec.hxx
Go to the documentation of this file.
1// Author: Vincenzo Eduardo Padulano CERN/UPV, Ivan Kabadzhov CERN 06/2022
2
3/*************************************************************************
4 * Copyright (C) 1995-2022, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_RDF_RDATASETSPEC
12#define ROOT_RDF_RDATASETSPEC
13
14#include <limits>
15#include <string>
16#include <utility> // std::pair
17#include <vector>
18
19#include <ROOT/InternalTreeUtils.hxx> // ROOT::Internal::TreeUtils::RFriendInfo
20#include <RtypesCore.h> // Long64_t
21
22namespace ROOT {
23
24namespace Detail {
25namespace RDF {
26class RLoopManager;
27} // namespace RDF
28} // namespace Detail
29
30namespace RDF {
31
32namespace Experimental {
33
35
37
38public:
39 struct REntryRange {
41 Long64_t fEnd{std::numeric_limits<Long64_t>::max()};
43 REntryRange(Long64_t endEntry);
44 REntryRange(Long64_t startEntry, Long64_t endEntry);
45 };
46
47private:
48 /**
49 * A list of names of trees.
50 * This list should go in lockstep with fFileNameGlobs, only in case this dataset is a TChain where each file
51 * contains its own tree with a different name from the global name of the dataset.
52 * Otherwise, fTreeNames contains 1 treename, that is common for all file globs.
53 */
54 std::vector<std::string> fTreeNames;
55 /**
56 * A list of file names.
57 * They can contain the globbing characters supported by TChain. See TChain::Add for more information.
58 */
59 std::vector<std::string> fFileNameGlobs;
60 REntryRange fEntryRange; ///< Start (inclusive) and end (exclusive) entry for the dataset processing
62
63public:
64 RDatasetSpec(const std::string &treeName, const std::string &fileNameGlob, const REntryRange &entryRange = {});
65
66 RDatasetSpec(const std::string &treeName, const std::vector<std::string> &fileNameGlobs,
67 const REntryRange &entryRange = {});
68
69 RDatasetSpec(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
70 const REntryRange &entryRange = {});
71
72 void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
73
74 void
75 AddFriend(const std::string &treeName, const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
76
77 void AddFriend(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
78 const std::string &alias = "");
79};
80
81} // namespace Experimental
82} // namespace RDF
83} // namespace ROOT
84
85#endif // ROOT_RDF_RDATASETSPEC
long long Long64_t
Definition: RtypesCore.h:80
The head node of a RDF computation graph.
A dataset specification for RDataFrame.
REntryRange fEntryRange
Start (inclusive) and end (exclusive) entry for the dataset processing.
RDatasetSpec(const std::string &treeName, const std::string &fileNameGlob, const REntryRange &entryRange={})
Construct an RDatasetSpec for one or more samples with the same tree name.
ROOT::Internal::TreeUtils::RFriendInfo fFriendInfo
List of friends.
std::vector< std::string > fFileNameGlobs
A list of file names.
void AddFriend(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias="")
Add a friend tree or chain with the same tree name to the dataset specification.
std::vector< std::string > fTreeNames
A list of names of trees.
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.