12#ifndef ROOT_TTreeProcessorMT
13#define ROOT_TTreeProcessorMT
50using NameAlias = std::pair<std::string, std::string>;
68 void MakeChain(
const std::string &treeName,
const std::vector<std::string> &fileNames,
const FriendInfo &friendInfo,
69 const std::vector<Long64_t> &nEntries,
const std::vector<std::vector<Long64_t>> &friendEntries);
78 const std::vector<std::string> &fileNames,
const FriendInfo &friendInfo,
79 TEntryList entryList,
const std::vector<Long64_t> &nEntries,
80 const std::vector<std::vector<Long64_t>> &friendEntries);
std::pair< std::unique_ptr< TTreeReader >, std::unique_ptr< TEntryList > > TreeReaderEntryListPair
TTreeView(const TTreeView &)
std::unique_ptr< TChain > fChain
Chain on which to operate.
std::vector< std::unique_ptr< TChain > > fFriends
Friends of the tree/chain.
TreeReaderEntryListPair GetTreeReader(Long64_t start, Long64_t end, const std::string &treeName, const std::vector< std::string > &fileNames, const FriendInfo &friendInfo, TEntryList entryList, const std::vector< Long64_t > &nEntries, const std::vector< std::vector< Long64_t > > &friendEntries)
Get a TTreeReader for the current tree of this view.
std::unique_ptr< TTreeReader > MakeReader(Long64_t start, Long64_t end)
void MakeChain(const std::string &treeName, const std::vector< std::string > &fileNames, const FriendInfo &friendInfo, const std::vector< Long64_t > &nEntries, const std::vector< std::vector< Long64_t > > &friendEntries)
Construct fChain, also adding friends if needed and injecting knowledge of offsets if available.
TreeReaderEntryListPair MakeReaderWithEntryList(TEntryList &globalList, Long64_t start, Long64_t end)
A class to process the entries of a TTree in parallel.
static unsigned int GetMaxTasksPerFilePerWorker()
Sets the maximum number of tasks created per file, per worker.
const std::string fTreeName
Name of the tree.
const std::vector< std::string > fFileNames
Names of the files.
static void SetMaxTasksPerFilePerWorker(unsigned int m)
Sets the maximum number of tasks created per file, per worker.
Internal::FriendInfo GetFriendInfo(TTree &tree)
Get and store the names, aliases and file names of the friends of the tree.
static unsigned int fgMaxTasksPerFilePerWorker
TTreeProcessorMT(std::string_view filename, std::string_view treename="")
Constructor based on a file name.
const TEntryList fEntryList
User-defined selection of entry numbers to be processed, empty if none was provided.
ROOT::TThreadedObject< ROOT::Internal::TTreeView > fTreeView
! Thread-local TreeViews
void Process(std::function< void(TTreeReader &)> func)
Process the entries of a TTree in parallel.
const Internal::FriendInfo fFriendInfo
std::string FindTreeName()
Retrieve the name of the first TTree in the first input file, else throw.
A List of entry numbers in a TTree or TChain.
A simple, robust and fast interface to read values from ROOT columnar datasets such as TTree,...
A TTree represents a columnar dataset.
basic_string_view< char > string_view
std::pair< std::string, std::string > NameAlias
Names, aliases, and file names of a TTree's or TChain's friends.
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Namespace for new ROOT classes and functions.
std::vector< std::vector< std::string > > fFriendFileNames
Names of the files where each friend is stored.
std::vector< Internal::NameAlias > fFriendNames
Pairs of names and aliases of friend trees/chains.