Interface to read a dataset. More...
#include <Dataset.h>
Public Member Functions | |
Dataset (DatasetInfo info, int skipFiles=0, int maxFiles=-1) | |
Constructor. | |
DatasetInfo const & | Info () const |
Returns associated DatasetInfo object. | |
bool | NextEntry () |
Sets the next entry in the dataset as the current one. | |
int64_t | NumEntries () |
Returns number of entries in the selected input files from the dataset. | |
TTreeReader & | Reader () |
Returns reader for selected files. | |
std::vector< std::string > const & | SelectedFiles () const |
Returns paths to selected input files. | |
void | SetEntry (int64_t index) |
Sets the current entry for the reader. | |
Private Attributes | |
DatasetInfo | info_ |
Associated DatasetInfo object. | |
std::vector< std::string > | selectedFiles_ |
Selected files from the dataset. | |
TChain | chain_ |
TChain containing selected files. | |
TTreeReader | reader_ |
Reader associated with chain_. |
Interface to read a dataset.
This class is an aggregation of a DatasetInfo and a TTreeReader. The latter one implements reading of input files included in the dataset. Reading of a subset of files in the dataset is supported, as needed for parallel processing.
When a consumer registers a new branch to read, this modifies the Dataset object (meaning that Reader, which has to be called for this, is not a constant method). This can be thought of as a (dynamic) change in the content of the dataset.
Dataset::Dataset | ( | DatasetInfo | info, | |
int | skipFiles = 0 , |
|||
int | maxFiles = -1 | |||
) |
Constructor.
[in] | info | DatasetInfo object that describes the dataset. |
[in] | skipFiles | Number of input files in the dataset to skip, starting from the beginning. |
[in] | maxFiles | Number of input files to include, starting after the skipped ones. Special value -1 indicates that all remaining files need to be included. |
bool Dataset::NextEntry | ( | ) | [inline] |
Sets the next entry in the dataset as the current one.