The dataset specification for RDataFrame.
This class allows users to create the dataset specification for RDataFrame to which they add samples (using the RSample class object) with tree names and file names, and, optionally, the metadata information (using the RMetaData class objects). Adding global friend trees and/or setting the range of events to be processed are also available.
Note, there exists yet another method to build RDataFrame from the dataset information using the JSON file format: FromSpec().
Definition at line 47 of file RDatasetSpec.hxx.
Classes | |
struct | REntryRange |
Public Member Functions | |
RDatasetSpec ()=default | |
RDatasetSpec & | AddSample (RSample sample) |
Add sample (RSample class object) to the RDatasetSpec object. | |
Long64_t | GetEntryRangeBegin () const |
Returns the first entry as defined by the global range provided in the specification. | |
Long64_t | GetEntryRangeEnd () const |
Returns the last entry as defined by the global range provided in the specification. | |
const std::vector< std::string > | GetFileNameGlobs () const |
Returns the collection of the dataset's paths to files, or globs if specified in input. | |
const ROOT::TreeUtils::RFriendInfo & | GetFriendInfo () const |
Returns the reference to the friend tree information. | |
const std::vector< RMetaData > | GetMetaData () const |
Returns the collection of the dataset's metadata (RMetaData class objects). | |
const std::vector< std::string > | GetSampleNames () const |
Returns the collection of the dataset's sample names. | |
const std::vector< std::string > | GetTreeNames () const |
Returns the collection of the dataset's tree names. | |
RDatasetSpec & | WithGlobalFriends (const std::string &treeName, const std::string &fileNameGlob, const std::string &alias="") |
Add friend tree to RDatasetSpec object. | |
RDatasetSpec & | WithGlobalFriends (const std::string &treeName, const std::vector< std::string > &fileNameGlobs, const std::string &alias="") |
Add friend tree to RDatasetSpec object. | |
RDatasetSpec & | WithGlobalFriends (const std::vector< std::pair< std::string, std::string > > &treeAndFileNameGlobs, const std::string &alias="") |
Add friend tree to RDatasetSpec object. | |
RDatasetSpec & | WithGlobalFriends (const std::vector< std::string > &treeNames, const std::vector< std::string > &fileNameGlobs, const std::string &alias="") |
Add friend tree to RDatasetSpec object. | |
RDatasetSpec & | WithGlobalRange (const RDatasetSpec::REntryRange &entryRange={}) |
Create an RDatasetSpec object for a given range of entries. | |
Private Member Functions | |
std::vector< RSample > | MoveOutSamples () |
Returns a collection of instances of the RSample class. | |
Private Attributes | |
REntryRange | fEntryRange |
Start (inclusive) and end (exclusive) entry for the dataset processing. | |
ROOT::TreeUtils::RFriendInfo | fFriendInfo |
List of friends. | |
std::vector< RSample > | fSamples |
List of samples. | |
Friends | |
class | ::ROOT::Detail::RDF::RLoopManager |
#include <ROOT/RDF/RDatasetSpec.hxx>
|
default |
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::AddSample | ( | RSample | sample | ) |
Add sample (RSample class object) to the RDatasetSpec object.
[in] | sample | RSample class object. RSample class represents a sample i.e. a grouping of trees (and their corresponding fileglobs) and, optionally, the sample's metadata. |
Our goal is to create an RDataFrame from the RDatasetSpec object. In order to do that, we need to create an RSample object first. In order to make this example even fuller, before we create the RSample object, we also create the RMetaData object which will be associated with our RSample object. Note that adding this metadata information to the RSample object is optional.
Definition at line 131 of file RDatasetSpec.cxx.
Long64_t ROOT::RDF::Experimental::RDatasetSpec::GetEntryRangeBegin | ( | ) | const |
Returns the first entry as defined by the global range provided in the specification.
The first entry is inclusive.
Definition at line 85 of file RDatasetSpec.cxx.
Long64_t ROOT::RDF::Experimental::RDatasetSpec::GetEntryRangeEnd | ( | ) | const |
Returns the last entry as defined by the global range provided in the specification.
The last entry is exclusive.
Definition at line 93 of file RDatasetSpec.cxx.
const std::vector< std::string > ROOT::RDF::Experimental::RDatasetSpec::GetFileNameGlobs | ( | ) | const |
Returns the collection of the dataset's paths to files, or globs if specified in input.
Definition at line 55 of file RDatasetSpec.cxx.
const ROOT::TreeUtils::RFriendInfo & ROOT::RDF::Experimental::RDatasetSpec::GetFriendInfo | ( | ) | const |
Returns the reference to the friend tree information.
Definition at line 77 of file RDatasetSpec.cxx.
const std::vector< RMetaData > ROOT::RDF::Experimental::RDatasetSpec::GetMetaData | ( | ) | const |
Returns the collection of the dataset's metadata (RMetaData class objects).
Definition at line 66 of file RDatasetSpec.cxx.
const std::vector< std::string > ROOT::RDF::Experimental::RDatasetSpec::GetSampleNames | ( | ) | const |
Returns the collection of the dataset's sample names.
Definition at line 33 of file RDatasetSpec.cxx.
const std::vector< std::string > ROOT::RDF::Experimental::RDatasetSpec::GetTreeNames | ( | ) | const |
Returns the collection of the dataset's tree names.
Definition at line 44 of file RDatasetSpec.cxx.
|
private |
Returns a collection of instances of the RSample class.
RSample class represents a sample i.e. a grouping of trees (and their corresponding fileglobs) and, optionally, the sample's metadata.
Definition at line 102 of file RDatasetSpec.cxx.
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::WithGlobalFriends | ( | const std::string & | treeName, |
const std::string & | fileNameGlob, | ||
const std::string & | alias = "" |
||
) |
Add friend tree to RDatasetSpec object.
[in] | treeName | Name of the tree. |
[in] | fileNameGlob | Path to the file in which the tree is stored. Refer to TChain::Add for globbing rules. |
[in] | alias | Alias for this friend. |
Definition at line 154 of file RDatasetSpec.cxx.
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::WithGlobalFriends | ( | const std::string & | treeName, |
const std::vector< std::string > & | fileNameGlobs, | ||
const std::string & | alias = "" |
||
) |
Add friend tree to RDatasetSpec object.
[in] | treeName | Name of the tree. |
[in] | fileNameGlobs | Collection of paths to the files in which the tree is stored. Refer to TChain::Add for globbing rules. |
[in] | alias | Alias for this friend. |
Definition at line 166 of file RDatasetSpec.cxx.
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::WithGlobalFriends | ( | const std::vector< std::pair< std::string, std::string > > & | treeAndFileNameGlobs, |
const std::string & | alias = "" |
||
) |
Add friend tree to RDatasetSpec object.
[in] | treeAndFileNameGlobs | Collection of pairs of paths to trees and paths to files. |
[in] | alias | Alias for this friend. |
Definition at line 178 of file RDatasetSpec.cxx.
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::WithGlobalFriends | ( | const std::vector< std::string > & | treeNames, |
const std::vector< std::string > & | fileNameGlobs, | ||
const std::string & | alias = "" |
||
) |
Add friend tree to RDatasetSpec object.
[in] | treeNames | Collection of paths to trees. |
[in] | fileNameGlobs | Collection of paths to files. |
[in] | alias | Alias for this friend. |
Definition at line 190 of file RDatasetSpec.cxx.
RDatasetSpec & ROOT::RDF::Experimental::RDatasetSpec::WithGlobalRange | ( | const RDatasetSpec::REntryRange & | entryRange = {} | ) |
Create an RDatasetSpec object for a given range of entries.
[in] | entryRange |
Definition at line 216 of file RDatasetSpec.cxx.
|
friend |
Definition at line 49 of file RDatasetSpec.hxx.
|
private |
Start (inclusive) and end (exclusive) entry for the dataset processing.
Definition at line 63 of file RDatasetSpec.hxx.
|
private |
List of friends.
Definition at line 62 of file RDatasetSpec.hxx.
|
private |
List of samples.
Definition at line 61 of file RDatasetSpec.hxx.