Logo ROOT  
Reference Guide
ROOT::RDF::Experimental::RDatasetSpec Class Reference

A dataset specification for RDataFrame.

Definition at line 26 of file RDatasetSpec.hxx.

Classes

struct  REntryRange
 

Public Member Functions

 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. More...
 
 RDatasetSpec (const std::string &treeName, const std::vector< std::string > &fileNameGlobs, const REntryRange &entryRange={})
 Construct an RDatasetSpec for one or more samples with the same tree name. More...
 
 RDatasetSpec (const std::vector< std::pair< std::string, std::string > > &treeAndFileNameGlobs, const REntryRange &entryRange={})
 Construct an RDatasetSpec for a chain of several trees (possibly having different names). More...
 
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. More...
 
void AddFriend (const std::string &treeName, const std::vector< std::string > &fileNameGlobs, const std::string &alias="")
 Add a friend tree or chain with the same tree name to the dataset specification. More...
 
void AddFriend (const std::vector< std::pair< std::string, std::string > > &treeAndFileNameGlobs, const std::string &alias="")
 Add a friend tree or chain (possibly with different tree names) to the dataset specification. More...
 
Long64_t GetEntryRangeBegin () const
 
Long64_t GetEntryRangeEnd () const
 
const std::vector< std::string > & GetFileNameGlobs () const
 
const ROOT::TreeUtils::RFriendInfoGetFriendInfo () const
 
const std::vector< std::string > & GetTreeNames () const
 

Private Attributes

REntryRange fEntryRange
 Start (inclusive) and end (exclusive) entry for the dataset processing. More...
 
std::vector< std::string > fFileNameGlobs
 A list of file names. More...
 
ROOT::TreeUtils::RFriendInfo fFriendInfo
 List of friends. More...
 
std::vector< std::string > fTreeNames
 A list of names of trees. More...
 

#include <ROOT/RDF/RDatasetSpec.hxx>

Constructor & Destructor Documentation

◆ RDatasetSpec() [1/3]

ROOT::RDF::Experimental::RDatasetSpec::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.

Parameters
[in]treeNameName of the tree
[in]fileNameGlobSingle file name or glob expression for the files where the tree(s) are stored
[in]entryRangeThe global entry range to be processed, {begin (inclusive), end (exclusive)}

The filename glob supports the same type of expressions as TChain::Add().

Definition at line 44 of file RDatasetSpec.cxx.

◆ RDatasetSpec() [2/3]

ROOT::RDF::Experimental::RDatasetSpec::RDatasetSpec ( const std::string &  treeName,
const std::vector< std::string > &  fileNameGlobs,
const REntryRange entryRange = {} 
)

Construct an RDatasetSpec for one or more samples with the same tree name.

Parameters
[in]treeNameName of the tree
[in]fileNameGlobsA vector of file names or glob expressions for the files where the trees are stored
[in]entryRangeThe global entry range to be processed, {begin (inclusive), end (exclusive)}

The filename glob supports the same type of expressions as TChain::Add().

Definition at line 56 of file RDatasetSpec.cxx.

◆ RDatasetSpec() [3/3]

ROOT::RDF::Experimental::RDatasetSpec::RDatasetSpec ( const std::vector< std::pair< std::string, std::string > > &  treeAndFileNameGlobs,
const REntryRange entryRange = {} 
)

Construct an RDatasetSpec for a chain of several trees (possibly having different names).

Parameters
[in]treeAndFileNameGlobsA vector of pairs of tree names and their corresponding file names/globs
[in]entryRangeThe global entry range to be processed, {begin (inclusive), end (exclusive)}

The filename glob supports the same type of expressions as TChain::Add().

Example usage:

spec = ROOT.RDF.Experimental.RDatasetSpec([("tree1", "a.root"), ("tree2", "b.root")], (5, 10))
df = ROOT.RDataFrame(spec)
A dataset specification for RDataFrame.
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
Definition: RDataFrame.hxx:40

Definition at line 74 of file RDatasetSpec.cxx.

Member Function Documentation

◆ AddFriend() [1/3]

void ROOT::RDF::Experimental::RDatasetSpec::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.

Parameters
[in]treeNameName of the tree
[in]fileNameGlobSingle file name or glob expression for the files where the tree(s) are stored
[in]aliasString to refer to the particular friend

The filename glob supports the same type of expressions as TChain::Add().

Definition at line 93 of file RDatasetSpec.cxx.

◆ AddFriend() [2/3]

void ROOT::RDF::Experimental::RDatasetSpec::AddFriend ( const std::string &  treeName,
const std::vector< std::string > &  fileNameGlobs,
const std::string &  alias = "" 
)

Add a friend tree or chain with the same tree name to the dataset specification.

Parameters
[in]treeNameName of the tree
[in]fileNameGlobsA vector of file names or glob expressions for the files where the trees are stored
[in]aliasString to refer to the particular friend

The filename glob supports the same type of expressions as TChain::Add().

Definition at line 105 of file RDatasetSpec.cxx.

◆ AddFriend() [3/3]

void ROOT::RDF::Experimental::RDatasetSpec::AddFriend ( const std::vector< std::pair< std::string, std::string > > &  treeAndFileNameGlobs,
const std::string &  alias = "" 
)

Add a friend tree or chain (possibly with different tree names) to the dataset specification.

Parameters
[in]treeAndFileNameGlobsA vector of pairs of tree names and their corresponding file names/globs
[in]aliasString to refer to the particular friend

The filename glob supports the same type of expressions as TChain::Add().

Example usage:

spec = ROOT.RDF.Experimental.RDatasetSpec("tree", "file.root")
spec.AddFriend([("tree1", "a.root"), ("tree2", "b.root")], "alias")
df = ROOT.RDataFrame(spec)

Definition at line 124 of file RDatasetSpec.cxx.

◆ GetEntryRangeBegin()

Long64_t ROOT::RDF::Experimental::RDatasetSpec::GetEntryRangeBegin ( ) const

Definition at line 140 of file RDatasetSpec.cxx.

◆ GetEntryRangeEnd()

Long64_t ROOT::RDF::Experimental::RDatasetSpec::GetEntryRangeEnd ( ) const

Definition at line 145 of file RDatasetSpec.cxx.

◆ GetFileNameGlobs()

const std::vector< std::string > & ROOT::RDF::Experimental::RDatasetSpec::GetFileNameGlobs ( ) const

Definition at line 135 of file RDatasetSpec.cxx.

◆ GetFriendInfo()

const ROOT::TreeUtils::RFriendInfo & ROOT::RDF::Experimental::RDatasetSpec::GetFriendInfo ( ) const

Definition at line 150 of file RDatasetSpec.cxx.

◆ GetTreeNames()

const std::vector< std::string > & ROOT::RDF::Experimental::RDatasetSpec::GetTreeNames ( ) const

Definition at line 130 of file RDatasetSpec.cxx.

Member Data Documentation

◆ fEntryRange

REntryRange ROOT::RDF::Experimental::RDatasetSpec::fEntryRange
private

Start (inclusive) and end (exclusive) entry for the dataset processing.

Definition at line 50 of file RDatasetSpec.hxx.

◆ fFileNameGlobs

std::vector<std::string> ROOT::RDF::Experimental::RDatasetSpec::fFileNameGlobs
private

A list of file names.

They can contain the globbing characters supported by TChain. See TChain::Add for more information.

Definition at line 49 of file RDatasetSpec.hxx.

◆ fFriendInfo

ROOT::TreeUtils::RFriendInfo ROOT::RDF::Experimental::RDatasetSpec::fFriendInfo
private

List of friends.

Definition at line 51 of file RDatasetSpec.hxx.

◆ fTreeNames

std::vector<std::string> ROOT::RDF::Experimental::RDatasetSpec::fTreeNames
private

A list of names of trees.

This list should go in lockstep with fFileNameGlobs, only in case this dataset is a TChain where each file contains its own tree with a different name from the global name of the dataset. Otherwise, fTreeNames contains 1 treename, that is common for all file globs.

Definition at line 44 of file RDatasetSpec.hxx.

Libraries for ROOT::RDF::Experimental::RDatasetSpec:
[legend]

The documentation for this class was generated from the following files: