65 std::vector<ROOT::Internal::TreeViewCluster> clusters;
67 const auto nFileNames = fileNames.size();
70 for (
auto i = 0u; i < nFileNames; ++i) {
71 std::unique_ptr<TFile> f(
TFile::Open(fileNames[i].c_str()));
73 f->GetObject(treeName.c_str(), t);
74 auto clusterIter = t->GetClusterIterator(0);
76 const Long64_t entries = t->GetEntries();
78 while ((start = clusterIter()) < entries) {
79 end = clusterIter.GetNextEntry();
117 auto &
reader = std::get<0>(readerAndEntryList);
126 pool.
Foreach(mapFunction, clusters);
void Foreach(F func, unsigned nTimes)
Execute func (with no arguments) nTimes in parallel.
const std::vector< std::string > & GetFileNames() const
Get the filenames for this view.
TTreeReader is a simple, robust and fast interface to read values from a TTree, TChain or TNtuple...
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
A cluster of entries as seen by TTreeView.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
std::string GetTreeName() const
Get the name of the tree of this view.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
This class provides a simple interface to execute the same task multiple times in parallel...
void RestoreLoadedEntry()
Restore the tree of the previous loaded entry, if any.
TreeReaderEntryListPair GetTreeReader(Long64_t start, Long64_t end)
void Process(std::function< void(TTreeReader &)> func)
Process the entries of a TTree in parallel.
std::vector< ROOT::Internal::TreeViewCluster > MakeClusters()
Divide input data in clusters, i.e. the workloads to distribute to tasks.
ROOT::TThreadedObject< ROOT::Internal::TTreeView > treeView
! Thread-local TreeViews
void PushLoadedEntry(Long64_t entry)
Push a new loaded entry to the stack.
TTreeProcessorMT(std::string_view filename, std::string_view treename="")
Constructor based on a file name.
A List of entry numbers in a TTree or TChain.