Logo ROOT  
Reference Guide
ROOT::RDF::RSampleInfo Class Reference

This type represents a sample identifier, to be used in conjunction with RDataFrame features such as DefinePerSample() and per-sample callbacks.

When the input data comes from a TTree, the string representation of RSampleInfo (which is returned by AsString() and that can be queried e.g. with Contains()) is of the form "<filename>/<treename>".

In multi-thread runs, different tasks might process different entry ranges of the same sample, so RSampleInfo also provides methods to inspect which part of a sample is being taken into consideration.

Definition at line 35 of file RSampleInfo.hxx.

Public Member Functions

 RSampleInfo ()=default
 
 RSampleInfo (const RSampleInfo &)=default
 
 RSampleInfo (RSampleInfo &&)=default
 
 RSampleInfo (std::string_view id, std::pair< ULong64_t, ULong64_t > entryRange, const ROOT::RDF::Experimental::RDatasetGroup *datasetGroup=nullptr)
 
 ~RSampleInfo ()=default
 
const std::string & AsString () const
 Return a string representation of the sample name. More...
 
bool Contains (std::string_view substr) const
 Check whether the sample name contains the given substring. More...
 
bool Empty () const
 Check whether the sample name is empty. More...
 
std::pair< ULong64_t, ULong64_tEntryRange () const
 Return the entry range in this sample that is being taken into consideration. More...
 
double GetD (const std::string &key) const
 
unsigned int GetGroupId () const
 
const std::string & GetGroupName () const
 
int GetI (const std::string &key) const
 
std::string GetS (const std::string &key) const
 
ULong64_t NEntries () const
 Return the number of entries of this sample that is being taken into consideration. More...
 
bool operator!= (const RSampleInfo &other) const
 
RSampleInfooperator= (const RSampleInfo &)=default
 
RSampleInfooperator= (RSampleInfo &&)=default
 
bool operator== (const RSampleInfo &other) const
 

Private Member Functions

void ThrowIfNoDatasetGroup () const
 

Private Attributes

const ROOT::RDF::Experimental::RDatasetGroupfDatasetGroup = nullptr
 
std::pair< ULong64_t, ULong64_tfEntryRange
 
std::string fID
 

#include <ROOT/RDF/RSampleInfo.hxx>

Constructor & Destructor Documentation

◆ RSampleInfo() [1/4]

ROOT::RDF::RSampleInfo::RSampleInfo ( std::string_view  id,
std::pair< ULong64_t, ULong64_t entryRange,
const ROOT::RDF::Experimental::RDatasetGroup datasetGroup = nullptr 
)
inline

Definition at line 50 of file RSampleInfo.hxx.

◆ RSampleInfo() [2/4]

ROOT::RDF::RSampleInfo::RSampleInfo ( )
default

◆ RSampleInfo() [3/4]

ROOT::RDF::RSampleInfo::RSampleInfo ( const RSampleInfo )
default

◆ RSampleInfo() [4/4]

ROOT::RDF::RSampleInfo::RSampleInfo ( RSampleInfo &&  )
default

◆ ~RSampleInfo()

ROOT::RDF::RSampleInfo::~RSampleInfo ( )
default

Member Function Documentation

◆ AsString()

const std::string & ROOT::RDF::RSampleInfo::AsString ( ) const
inline

Return a string representation of the sample name.

The representation is of the form "<filename>/<treename>" if the input data comes from a TTree or a TChain.

Definition at line 109 of file RSampleInfo.hxx.

◆ Contains()

bool ROOT::RDF::RSampleInfo::Contains ( std::string_view  substr) const
inline

Check whether the sample name contains the given substring.

Definition at line 93 of file RSampleInfo.hxx.

◆ Empty()

bool ROOT::RDF::RSampleInfo::Empty ( ) const
inline

Check whether the sample name is empty.

This is the case e.g. when using a RDataFrame with no input data, constructed as RDataFrame(nEntries).

Definition at line 102 of file RSampleInfo.hxx.

◆ EntryRange()

std::pair< ULong64_t, ULong64_t > ROOT::RDF::RSampleInfo::EntryRange ( ) const
inline

Return the entry range in this sample that is being taken into consideration.

Multiple multi-threading tasks might process different entry ranges of the same sample.

Definition at line 117 of file RSampleInfo.hxx.

◆ GetD()

double ROOT::RDF::RSampleInfo::GetD ( const std::string &  key) const
inline

Definition at line 80 of file RSampleInfo.hxx.

◆ GetGroupId()

unsigned int ROOT::RDF::RSampleInfo::GetGroupId ( ) const
inline

Definition at line 68 of file RSampleInfo.hxx.

◆ GetGroupName()

const std::string & ROOT::RDF::RSampleInfo::GetGroupName ( ) const
inline

Definition at line 62 of file RSampleInfo.hxx.

◆ GetI()

int ROOT::RDF::RSampleInfo::GetI ( const std::string &  key) const
inline

Definition at line 74 of file RSampleInfo.hxx.

◆ GetS()

std::string ROOT::RDF::RSampleInfo::GetS ( const std::string &  key) const
inline

Definition at line 86 of file RSampleInfo.hxx.

◆ NEntries()

ULong64_t ROOT::RDF::RSampleInfo::NEntries ( ) const
inline

Return the number of entries of this sample that is being taken into consideration.

Definition at line 120 of file RSampleInfo.hxx.

◆ operator!=()

bool ROOT::RDF::RSampleInfo::operator!= ( const RSampleInfo other) const
inline

Definition at line 123 of file RSampleInfo.hxx.

◆ operator=() [1/2]

RSampleInfo & ROOT::RDF::RSampleInfo::operator= ( const RSampleInfo )
default

◆ operator=() [2/2]

RSampleInfo & ROOT::RDF::RSampleInfo::operator= ( RSampleInfo &&  )
default

◆ operator==()

bool ROOT::RDF::RSampleInfo::operator== ( const RSampleInfo other) const
inline

Definition at line 122 of file RSampleInfo.hxx.

◆ ThrowIfNoDatasetGroup()

void ROOT::RDF::RSampleInfo::ThrowIfNoDatasetGroup ( ) const
inlineprivate

Definition at line 41 of file RSampleInfo.hxx.

Member Data Documentation

◆ fDatasetGroup

const ROOT::RDF::Experimental::RDatasetGroup* ROOT::RDF::RSampleInfo::fDatasetGroup = nullptr
private

Definition at line 39 of file RSampleInfo.hxx.

◆ fEntryRange

std::pair<ULong64_t, ULong64_t> ROOT::RDF::RSampleInfo::fEntryRange
private

Definition at line 37 of file RSampleInfo.hxx.

◆ fID

std::string ROOT::RDF::RSampleInfo::fID
private

Definition at line 36 of file RSampleInfo.hxx.

Libraries for ROOT::RDF::RSampleInfo:
[legend]

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