Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Internal::TTreeReaderGenerator Class Reference

Definition at line 87 of file TTreeReaderGenerator.h.

Public Member Functions

 TTreeReaderGenerator (TTree *tree, const char *classname, Option_t *option)
 Constructor. Analyzes the tree and writes selector.
void AddHeader (const char *classname)
 Add a header inclusion request.
void AddHeader (TClass *cl)
 Add a header inclusion request.
TVirtualStreamerInfoGetBaseClass (TStreamerElement *element)
 Check if element is a base class and if yes, return the base class.
TString GetContainedClassName (TBranchElement *branch, TStreamerElement *element, bool ispointer)
 Get name of class inside a container.
TVirtualStreamerInfoGetStreamerInfo (TBranch *branch, TIter current, TClass *cl)
 Return the correct TStreamerInfo of class 'cl' in the list of branches (current) [Assuming these branches correspond to a flattened version of the class.

Public Attributes

TList fListOfHeaders
 List of included headers.
TString fOptionStr
 User options as a string.
TTreefTree
 Pointer to the tree.

Private Member Functions

void AddReader (TTreeReaderDescriptor::ReaderType type, TString dataType, TString name, TString branchName, TBranchDescriptor *parent=nullptr, bool isLeaf=true)
 Add a reader to the generated code.
UInt_t AnalyzeBranches (TBranchDescriptor *desc, TBranchElement *branch, TVirtualStreamerInfo *info)
 Analyse sub-branches of 'branch' recursively and extract readers.
UInt_t AnalyzeBranches (TBranchDescriptor *desc, TIter &branches, TVirtualStreamerInfo *info)
 Analyse sub-branches 'branches' recursively and extract readers.
UInt_t AnalyzeOldBranch (TBranch *branch)
 Analyze branch and add the variables found.
UInt_t AnalyzeOldLeaf (TLeaf *leaf, Int_t nleaves)
 Analyze the leaf and add the variables found.
void AnalyzeTree (TTree *tree)
 Analyze tree and extract readers.
bool BranchNeedsReader (TString branchName, TBranchDescriptor *parent, bool isLeaf)
 Check whether a branch should have a corresponding reader added, depending on the options provided by the user.
void ParseOptions ()
 Parse the user options.
void WriteSelector ()
 Generate code for selector class.

Private Attributes

TString fClassname
 Class name of the selector.
bool fIncludeAllLeaves
 Should all leaves be included.
bool fIncludeAllTopmost
 Should all topmost branches be included.
std::vector< TStringfIncludeLeaves
 Branches whose leaves should be included.
std::vector< TStringfIncludeStruct
 Branches whom should be included.
TList fListOfReaders
 List of readers.

#include <TTreeReaderGenerator.h>

Inheritance diagram for ROOT::Internal::TTreeReaderGenerator:
ROOT::Internal::TTreeGeneratorBase

Constructor & Destructor Documentation

◆ TTreeReaderGenerator()

ROOT::Internal::TTreeReaderGenerator::TTreeReaderGenerator ( TTree * tree,
const char * classname,
Option_t * option )

Constructor. Analyzes the tree and writes selector.

Definition at line 51 of file TTreeReaderGenerator.cxx.

Member Function Documentation

◆ AddHeader() [1/2]

void ROOT::Internal::TTreeGeneratorBase::AddHeader ( const char * classname)
inherited

Add a header inclusion request.

If the header is already included it will not be included again.

Definition at line 153 of file TTreeGeneratorBase.cxx.

◆ AddHeader() [2/2]

void ROOT::Internal::TTreeGeneratorBase::AddHeader ( TClass * cl)
inherited

Add a header inclusion request.

If the header is already included it will not be included again.

Definition at line 43 of file TTreeGeneratorBase.cxx.

◆ AddReader()

void ROOT::Internal::TTreeReaderGenerator::AddReader ( TTreeReaderDescriptor::ReaderType type,
TString dataType,
TString name,
TString branchName,
TBranchDescriptor * parent = nullptr,
bool isLeaf = true )
private

Add a reader to the generated code.

Definition at line 63 of file TTreeReaderGenerator.cxx.

◆ AnalyzeBranches() [1/2]

UInt_t ROOT::Internal::TTreeReaderGenerator::AnalyzeBranches ( TBranchDescriptor * desc,
TBranchElement * branch,
TVirtualStreamerInfo * info )
private

Analyse sub-branches of 'branch' recursively and extract readers.

Definition at line 101 of file TTreeReaderGenerator.cxx.

◆ AnalyzeBranches() [2/2]

UInt_t ROOT::Internal::TTreeReaderGenerator::AnalyzeBranches ( TBranchDescriptor * desc,
TIter & branches,
TVirtualStreamerInfo * info )
private

Analyse sub-branches 'branches' recursively and extract readers.

Definition at line 113 of file TTreeReaderGenerator.cxx.

◆ AnalyzeOldBranch()

UInt_t ROOT::Internal::TTreeReaderGenerator::AnalyzeOldBranch ( TBranch * branch)
private

Analyze branch and add the variables found.

The number of analyzed sub-branches is returned.

Definition at line 474 of file TTreeReaderGenerator.cxx.

◆ AnalyzeOldLeaf()

UInt_t ROOT::Internal::TTreeReaderGenerator::AnalyzeOldLeaf ( TLeaf * leaf,
Int_t nleaves )
private

Analyze the leaf and add the variables found.

Definition at line 496 of file TTreeReaderGenerator.cxx.

◆ AnalyzeTree()

void ROOT::Internal::TTreeReaderGenerator::AnalyzeTree ( TTree * tree)
private

Analyze tree and extract readers.

Definition at line 661 of file TTreeReaderGenerator.cxx.

◆ BranchNeedsReader()

bool ROOT::Internal::TTreeReaderGenerator::BranchNeedsReader ( TString branchName,
TBranchDescriptor * parent,
bool isLeaf )
private

Check whether a branch should have a corresponding reader added, depending on the options provided by the user.

Definition at line 604 of file TTreeReaderGenerator.cxx.

◆ GetBaseClass()

TVirtualStreamerInfo * ROOT::Internal::TTreeGeneratorBase::GetBaseClass ( TStreamerElement * element)
inherited

Check if element is a base class and if yes, return the base class.

Definition at line 206 of file TTreeGeneratorBase.cxx.

◆ GetContainedClassName()

TString ROOT::Internal::TTreeGeneratorBase::GetContainedClassName ( TBranchElement * branch,
TStreamerElement * element,
bool ispointer )
inherited

Get name of class inside a container.

Definition at line 161 of file TTreeGeneratorBase.cxx.

◆ GetStreamerInfo()

TVirtualStreamerInfo * ROOT::Internal::TTreeGeneratorBase::GetStreamerInfo ( TBranch * branch,
TIter current,
TClass * cl )
inherited

Return the correct TStreamerInfo of class 'cl' in the list of branches (current) [Assuming these branches correspond to a flattened version of the class.

]

Definition at line 221 of file TTreeGeneratorBase.cxx.

◆ ParseOptions()

void ROOT::Internal::TTreeReaderGenerator::ParseOptions ( )
private

Parse the user options.

Definition at line 633 of file TTreeReaderGenerator.cxx.

◆ WriteSelector()

void ROOT::Internal::TTreeReaderGenerator::WriteSelector ( )
private

Generate code for selector class.

Definition at line 799 of file TTreeReaderGenerator.cxx.

Member Data Documentation

◆ fClassname

TString ROOT::Internal::TTreeReaderGenerator::fClassname
private

Class name of the selector.

Definition at line 89 of file TTreeReaderGenerator.h.

◆ fIncludeAllLeaves

bool ROOT::Internal::TTreeReaderGenerator::fIncludeAllLeaves
private

Should all leaves be included.

Definition at line 91 of file TTreeReaderGenerator.h.

◆ fIncludeAllTopmost

bool ROOT::Internal::TTreeReaderGenerator::fIncludeAllTopmost
private

Should all topmost branches be included.

Definition at line 92 of file TTreeReaderGenerator.h.

◆ fIncludeLeaves

std::vector<TString> ROOT::Internal::TTreeReaderGenerator::fIncludeLeaves
private

Branches whose leaves should be included.

Definition at line 93 of file TTreeReaderGenerator.h.

◆ fIncludeStruct

std::vector<TString> ROOT::Internal::TTreeReaderGenerator::fIncludeStruct
private

Branches whom should be included.

Definition at line 94 of file TTreeReaderGenerator.h.

◆ fListOfHeaders

TList ROOT::Internal::TTreeGeneratorBase::fListOfHeaders
inherited

List of included headers.

Definition at line 38 of file TTreeGeneratorBase.h.

◆ fListOfReaders

TList ROOT::Internal::TTreeReaderGenerator::fListOfReaders
private

List of readers.

Definition at line 90 of file TTreeReaderGenerator.h.

◆ fOptionStr

TString ROOT::Internal::TTreeGeneratorBase::fOptionStr
inherited

User options as a string.

Definition at line 40 of file TTreeGeneratorBase.h.

◆ fTree

TTree* ROOT::Internal::TTreeGeneratorBase::fTree
inherited

Pointer to the tree.

Definition at line 39 of file TTreeGeneratorBase.h.


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