Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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/RDF/RSample.hxx>
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 MoveOutSamples
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<RSample> fSamples; ///< List of samples
51 REntryRange fEntryRange; ///< Start (inclusive) and end (exclusive) entry for the dataset processing
52
53 std::vector<RSample> MoveOutSamples();
54
55public:
56 RDatasetSpec() = default;
57
58 const std::vector<std::string> GetSampleNames() 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
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
A dataset specification for RDataFrame.
const std::vector< std::string > GetFileNameGlobs() const
std::vector< RSample > MoveOutSamples()
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
const std::vector< RMetaData > GetMetaData() const
RDatasetSpec & AddSample(RSample sample)
ROOT::TreeUtils::RFriendInfo fFriendInfo
List of friends.
RDatasetSpec & WithGlobalRange(const RDatasetSpec::REntryRange &entryRange={})
std::vector< RSample > fSamples
List of samples.
const std::vector< std::string > GetSampleNames() const
Class representing a sample (grouping of trees (and their fileglobs) and (optional) metadata)
Definition RSample.hxx:29
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.