Logo ROOT   6.14/05
Reference Guide
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ROOT::Internal::TTreeView Class Reference

Definition at line 60 of file TTreeProcessorMT.hxx.

Public Member Functions

 TTreeView (std::string_view fn, std::string_view tn)
 Constructor based on a file name. More...
 
 TTreeView (const std::vector< std::string_view > &fns, std::string_view tn)
 Constructor based on a collection of file names. More...
 
 TTreeView (TTree &tree)
 Constructor based on a TTree. More...
 
 TTreeView (TTree &tree, TEntryList &entries)
 Constructor based on a TTree and a TEntryList. More...
 
 TTreeView (const TTreeView &view)
 Copy constructor. More...
 
const std::vector< std::string > & GetFileNames () const
 Get the filenames for this view. More...
 
const std::vector< std::vector< std::string > > & GetFriendFileNames () const
 
const std::vector< NameAlias > & GetFriendNames () const
 
std::string GetTreeName () const
 Get the name of the tree of this view. More...
 
TreeReaderEntryListPair GetTreeReader (Long64_t start, Long64_t end, const std::vector< Long64_t > &nEntries, const std::vector< std::vector< Long64_t >> &friendEntries)
 Get a TTreeReader for the current tree of this view. More...
 
void PopTaskFirstEntry ()
 Restore the tree of the previous loaded entry, if any. More...
 
void PushTaskFirstEntry (Long64_t entry)
 Push a new loaded entry to the stack. More...
 

Private Types

using NameAlias = std::pair< std::string, std::string >
 
using TreeReaderEntryListPair = std::pair< std::unique_ptr< TTreeReader >, std::unique_ptr< TEntryList > >
 

Private Member Functions

void GetTreeNameIfNeeded ()
 If not treeName was provided to the ctor, use the name of the first TTree in the first file, else throw. More...
 
void MakeChain (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. More...
 
std::unique_ptr< TTreeReaderMakeReader (Long64_t start, Long64_t end)
 
TreeReaderEntryListPair MakeReaderWithEntryList (Long64_t start, Long64_t end)
 
void StoreFriends (const TTree &tree, bool isTree)
 Get and store the names, aliases and file names of the friends of the tree. More...
 

Private Attributes

std::unique_ptr< TChainfChain
 Chain on which to operate. More...
 
TEntryList fEntryList
 User-defined selection of entry numbers to be processed, empty if none was provided. More...
 
std::vector< std::string > fFileNames
 Names of the files. More...
 
std::vector< std::vector< std::string > > fFriendFileNames
 Names of the files where friends are stored. More...
 
std::vector< NameAliasfFriendNames
 <name,alias> pairs of the friends of the tree/chain More...
 
std::vector< std::unique_ptr< TChain > > fFriends
 Friends of the tree/chain. More...
 
std::vector< Long64_tfLoadedEntries
 ! Per-task loaded entries (for task interleaving) More...
 
std::string fTreeName
 Name of the tree. More...
 

#include <ROOT/TTreeProcessorMT.hxx>

Member Typedef Documentation

◆ NameAlias

using ROOT::Internal::TTreeView::NameAlias = std::pair<std::string, std::string>
private

Definition at line 63 of file TTreeProcessorMT.hxx.

◆ TreeReaderEntryListPair

using ROOT::Internal::TTreeView::TreeReaderEntryListPair = std::pair<std::unique_ptr<TTreeReader>, std::unique_ptr<TEntryList> >
private

Definition at line 62 of file TTreeProcessorMT.hxx.

Constructor & Destructor Documentation

◆ TTreeView() [1/5]

ROOT::Internal::TTreeView::TTreeView ( std::string_view  fn,
std::string_view  tn 
)
inline

Constructor based on a file name.

Parameters
[in]fnName of the file containing the tree to process.
[in]tnName of the tree to process. If not provided, the implementation will automatically search for a tree in the file.

Definition at line 193 of file TTreeProcessorMT.hxx.

◆ TTreeView() [2/5]

ROOT::Internal::TTreeView::TTreeView ( const std::vector< std::string_view > &  fns,
std::string_view  tn 
)
inline

Constructor based on a collection of file names.

Parameters
[in]fnsCollection of file names containing the tree to process.
[in]tnName of the tree to process. If not provided, the implementation will automatically search for a tree in the collection of files.

Definition at line 205 of file TTreeProcessorMT.hxx.

◆ TTreeView() [3/5]

TTreeView::TTreeView ( TTree tree)

Constructor based on a TTree.

Parameters
[in]treeTree or chain of files containing the tree to process.

Definition at line 115 of file TTreeProcessorMT.cxx.

◆ TTreeView() [4/5]

ROOT::Internal::TTreeView::TTreeView ( TTree tree,
TEntryList entries 
)
inline

Constructor based on a TTree and a TEntryList.

Parameters
[in]treeTree or chain of files containing the tree to process.
[in]entriesList of entry numbers to process.

Definition at line 227 of file TTreeProcessorMT.hxx.

◆ TTreeView() [5/5]

ROOT::Internal::TTreeView::TTreeView ( const TTreeView view)
inline

Copy constructor.

Parameters
[in]viewObject to copy.

Definition at line 238 of file TTreeProcessorMT.hxx.

Member Function Documentation

◆ GetFileNames()

const std::vector<std::string>& ROOT::Internal::TTreeView::GetFileNames ( ) const
inline

Get the filenames for this view.

Definition at line 277 of file TTreeProcessorMT.hxx.

◆ GetFriendFileNames()

const std::vector<std::vector<std::string> >& ROOT::Internal::TTreeView::GetFriendFileNames ( ) const
inline

Definition at line 308 of file TTreeProcessorMT.hxx.

◆ GetFriendNames()

const std::vector<NameAlias>& ROOT::Internal::TTreeView::GetFriendNames ( ) const
inline

Definition at line 303 of file TTreeProcessorMT.hxx.

◆ GetTreeName()

std::string ROOT::Internal::TTreeView::GetTreeName ( ) const
inline

Get the name of the tree of this view.

Definition at line 284 of file TTreeProcessorMT.hxx.

◆ GetTreeNameIfNeeded()

void ROOT::Internal::TTreeView::GetTreeNameIfNeeded ( )
inlineprivate

If not treeName was provided to the ctor, use the name of the first TTree in the first file, else throw.

Definition at line 77 of file TTreeProcessorMT.hxx.

◆ GetTreeReader()

TreeReaderEntryListPair ROOT::Internal::TTreeView::GetTreeReader ( Long64_t  start,
Long64_t  end,
const std::vector< Long64_t > &  nEntries,
const std::vector< std::vector< Long64_t >> &  friendEntries 
)
inline

Get a TTreeReader for the current tree of this view.

Definition at line 257 of file TTreeProcessorMT.hxx.

◆ MakeChain()

void ROOT::Internal::TTreeView::MakeChain ( const std::vector< Long64_t > &  nEntries,
const std::vector< std::vector< Long64_t >> &  friendEntries 
)
inlineprivate

Construct fChain, also adding friends if needed and injecting knowledge of offsets if available.

Definition at line 100 of file TTreeProcessorMT.hxx.

◆ MakeReader()

std::unique_ptr<TTreeReader> ROOT::Internal::TTreeView::MakeReader ( Long64_t  start,
Long64_t  end 
)
inlineprivate

Definition at line 178 of file TTreeProcessorMT.hxx.

◆ MakeReaderWithEntryList()

TreeReaderEntryListPair ROOT::Internal::TTreeView::MakeReaderWithEntryList ( Long64_t  start,
Long64_t  end 
)
inlineprivate

Definition at line 163 of file TTreeProcessorMT.hxx.

◆ PopTaskFirstEntry()

void ROOT::Internal::TTreeView::PopTaskFirstEntry ( )
inline

Restore the tree of the previous loaded entry, if any.

Definition at line 295 of file TTreeProcessorMT.hxx.

◆ PushTaskFirstEntry()

void ROOT::Internal::TTreeView::PushTaskFirstEntry ( Long64_t  entry)
inline

Push a new loaded entry to the stack.

Definition at line 291 of file TTreeProcessorMT.hxx.

◆ StoreFriends()

void ROOT::Internal::TTreeView::StoreFriends ( const TTree tree,
bool  isTree 
)
inlineprivate

Get and store the names, aliases and file names of the friends of the tree.

Definition at line 130 of file TTreeProcessorMT.hxx.

Member Data Documentation

◆ fChain

std::unique_ptr<TChain> ROOT::Internal::TTreeView::fChain
private

Chain on which to operate.

Definition at line 67 of file TTreeProcessorMT.hxx.

◆ fEntryList

TEntryList ROOT::Internal::TTreeView::fEntryList
private

User-defined selection of entry numbers to be processed, empty if none was provided.

Definition at line 70 of file TTreeProcessorMT.hxx.

◆ fFileNames

std::vector<std::string> ROOT::Internal::TTreeView::fFileNames
private

Names of the files.

Definition at line 68 of file TTreeProcessorMT.hxx.

◆ fFriendFileNames

std::vector<std::vector<std::string> > ROOT::Internal::TTreeView::fFriendFileNames
private

Names of the files where friends are stored.

Definition at line 73 of file TTreeProcessorMT.hxx.

◆ fFriendNames

std::vector<NameAlias> ROOT::Internal::TTreeView::fFriendNames
private

<name,alias> pairs of the friends of the tree/chain

Definition at line 72 of file TTreeProcessorMT.hxx.

◆ fFriends

std::vector<std::unique_ptr<TChain> > ROOT::Internal::TTreeView::fFriends
private

Friends of the tree/chain.

Definition at line 66 of file TTreeProcessorMT.hxx.

◆ fLoadedEntries

std::vector<Long64_t> ROOT::Internal::TTreeView::fLoadedEntries
private

! Per-task loaded entries (for task interleaving)

Definition at line 71 of file TTreeProcessorMT.hxx.

◆ fTreeName

std::string ROOT::Internal::TTreeView::fTreeName
private

Name of the tree.

Definition at line 69 of file TTreeProcessorMT.hxx.

Libraries for ROOT::Internal::TTreeView:
[legend]

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