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::RSample *sample=nullptr, ULong64_t totalEntries=0) | |
| ~RSampleInfo ()=default | |
| const std::string & | AsString () const |
| Return a string representation of the sample name. | |
| bool | Contains (std::string_view substr) const |
| Check whether the sample name contains the given substring. | |
| bool | Empty () const |
| Check whether the sample name is empty. | |
| std::pair< ULong64_t, ULong64_t > | EntryRange () const |
| Return the entry range in the sample that is being taken into consideration. | |
| double | GetD (const std::string &key) const |
| Return the metadata value of type double given the key. | |
| int | GetI (const std::string &key) const |
| Return the metadata value of type int given the key. | |
| std::string | GetS (const std::string &key) const |
| Return the metadata value of type string given the key. | |
| unsigned int | GetSampleId () const |
| Get the sample id as an int. | |
| const std::string & | GetSampleName () const |
| Get the name of the sample as a string. | |
| ULong64_t | NEntries () const |
| Return the number of entries of this range of the sample. | |
| ULong64_t | NEntriesTotal () const |
| Return the total number of entries in the underlying dataset. | |
| bool | operator!= (const RSampleInfo &other) const |
| RSampleInfo & | operator= (const RSampleInfo &)=default |
| RSampleInfo & | operator= (RSampleInfo &&)=default |
| bool | operator== (const RSampleInfo &other) const |
Private Member Functions | |
| void | ThrowIfNoSample () const |
Private Attributes | |
| std::pair< ULong64_t, ULong64_t > | fEntryRange |
| std::string | fID |
| const ROOT::RDF::Experimental::RSample * | fSample = nullptr |
| ULong64_t | fTotalEntries = 0 |
#include <ROOT/RDF/RSampleInfo.hxx>
|
inline |
Definition at line 51 of file RSampleInfo.hxx.
|
default |
|
default |
|
default |
|
default |
|
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 115 of file RSampleInfo.hxx.
|
inline |
Check whether the sample name contains the given substring.
Definition at line 99 of file RSampleInfo.hxx.
|
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 108 of file RSampleInfo.hxx.
Return the entry range in the sample that is being taken into consideration.
Multiple multi-threading tasks might process different entry ranges of the same sample.
Definition at line 123 of file RSampleInfo.hxx.
Return the metadata value of type double given the key.
Definition at line 85 of file RSampleInfo.hxx.
Return the metadata value of type int given the key.
Definition at line 78 of file RSampleInfo.hxx.
|
inline |
Return the metadata value of type string given the key.
Definition at line 92 of file RSampleInfo.hxx.
|
inline |
Get the sample id as an int.
Definition at line 71 of file RSampleInfo.hxx.
|
inline |
Get the name of the sample as a string.
Definition at line 64 of file RSampleInfo.hxx.
|
inline |
Return the number of entries of this range of the sample.
Definition at line 126 of file RSampleInfo.hxx.
|
inline |
Return the total number of entries in the underlying dataset.
If the total number of entries is not known, the end of the current range is returned. This can be larger than NEntries() if the sample is split in multiple ranges.
Definition at line 131 of file RSampleInfo.hxx.
|
inline |
Definition at line 134 of file RSampleInfo.hxx.
|
default |
|
default |
|
inline |
Definition at line 133 of file RSampleInfo.hxx.
|
inlineprivate |
Definition at line 42 of file RSampleInfo.hxx.
Definition at line 37 of file RSampleInfo.hxx.
|
private |
Definition at line 36 of file RSampleInfo.hxx.
|
private |
Definition at line 39 of file RSampleInfo.hxx.
|
private |
Definition at line 40 of file RSampleInfo.hxx.