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
20#include <ROOT/RFriendInfo.hxx>
21#include <RtypesCore.h> // Long64_t
22
23namespace ROOT {
24namespace Detail {
25namespace RDF {
26class RLoopManager;
27}
28} // namespace Detail
29namespace RDF {
30namespace Experimental {
31
32/**
33\ingroup dataframe
34\brief A dataset specification for RDataFrame.
35*/
37 friend class ::ROOT::Detail::RDF::RLoopManager; // for MoveOutDatasetGroups
38
39public:
40 struct REntryRange {
42 Long64_t fEnd{std::numeric_limits<Long64_t>::max()};
44 REntryRange(Long64_t endEntry);
45 REntryRange(Long64_t startEntry, Long64_t endEntry);
46 };
47
48private:
49 std::vector<RDatasetGroup> fDatasetGroups; ///< List of groups
51 REntryRange fEntryRange; ///< Start (inclusive) and end (exclusive) entry for the dataset processing
52
53 std::vector<RDatasetGroup> MoveOutDatasetGroups();
54
55public:
56 RDatasetSpec() = default;
57
58 const std::vector<std::string> GetGroupNames() const;
59 const std::vector<std::string> GetTreeNames() const;
60 const std::vector<std::string> GetFileNameGlobs() const;
61 const std::vector<RMetaData> GetMetaData() const;
65
66 RDatasetSpec &AddGroup(RDatasetGroup datasetGroup);
67
69 WithGlobalFriends(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias = "");
70
71 RDatasetSpec &WithGlobalFriends(const std::string &treeName, const std::vector<std::string> &fileNameGlobs,
72 const std::string &alias = "");
73
74 RDatasetSpec &WithGlobalFriends(const std::vector<std::pair<std::string, std::string>> &treeAndFileNameGlobs,
75 const std::string &alias = "");
76
77 RDatasetSpec &WithGlobalFriends(const std::vector<std::string> &treeNames,
78 const std::vector<std::string> &fileNameGlobs, const std::string &alias = "");
79
81};
82
83} // namespace Experimental
84} // namespace RDF
85} // namespace ROOT
86
87#endif // ROOT_RDF_RDATASETSPEC
long long Long64_t
Definition: RtypesCore.h:80
Class representing a dataset group (mapping of trees (and their fileglobs) to metadata)
A dataset specification for RDataFrame.
const std::vector< std::string > GetFileNameGlobs() const
REntryRange fEntryRange
Start (inclusive) and end (exclusive) entry for the dataset processing.
RDatasetSpec & WithGlobalFriends(const std::string &treeName, const std::string &fileNameGlob, const std::string &alias="")
const std::vector< std::string > GetTreeNames() const
const ROOT::TreeUtils::RFriendInfo & GetFriendInfo() const
std::vector< RDatasetGroup > MoveOutDatasetGroups()
const std::vector< RMetaData > GetMetaData() const
ROOT::TreeUtils::RFriendInfo fFriendInfo
List of friends.
RDatasetSpec & WithGlobalRange(const RDatasetSpec::REntryRange &entryRange={})
const std::vector< std::string > GetGroupNames() const
RDatasetSpec & AddGroup(RDatasetGroup datasetGroup)
std::vector< RDatasetGroup > fDatasetGroups
List of groups.
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