library: libTreePlayer #include "TTreeIndex.h" |
TTreeIndex
class description - source file - inheritance tree (.pdf)
public:
TTreeIndex()
TTreeIndex(const TTree* T, const char* majorname, const char* minorname)
TTreeIndex(const TTreeIndex&)
virtual ~TTreeIndex()
static TClass* Class()
virtual Int_t GetEntryNumberFriend(const TTree* T)
virtual Long64_t GetEntryNumberWithBestIndex(Int_t major, Int_t minor) const
virtual Long64_t GetEntryNumberWithIndex(Int_t major, Int_t minor) const
virtual Long64_t* GetIndex() const
virtual Long64_t* GetIndexValues() const
virtual TTreeFormula* GetMajorFormula()
virtual TTreeFormula* GetMajorFormulaParent(const TTree* T)
virtual const char* GetMajorName() const
virtual TTreeFormula* GetMinorFormula()
virtual TTreeFormula* GetMinorFormulaParent(const TTree* T)
virtual const char* GetMinorName() const
virtual Long64_t GetN() const
virtual TClass* IsA() const
TTreeIndex& operator=(const TTreeIndex&)
virtual void Print(Option_t* option) const
virtual void SetTree(const TTree* T)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
protected:
TString fMajorName Index major name
TString fMinorName Index minor name
Long64_t fN Number of entries
Long64_t* fIndexValues [fN] Sorted index values
Long64_t* fIndex [fN] Index of sorted values
TTreeFormula* fMajorFormula ! Pointer to major TreeFormula
TTreeFormula* fMinorFormula ! Pointer to minor TreeFormula
TTreeFormula* fMajorFormulaParent ! Pointer to major TreeFormula in Parent tree (if any)
TTreeFormula* fMinorFormulaParent ! Pointer to minor TreeFormula in Parent tree (if any)
Int_t GetEntryNumberFriend(const TTree *T)
returns the entry number in this friend Tree corresponding to entry in
the master Tree T.
In case this friend Tree and T do not share an index with the same
major and minor name, the entry serial number in the friend tree
and in the master Tree are assumed to be the same
Long64_t GetEntryNumberWithBestIndex(Int_t major, Int_t minor) const
Return entry number corresponding to major and minor number
Note that this function returns only the entry number, not the data
To read the data corresponding to an entry number, use TTree::GetEntryWithIndex
the BuildIndex function has created a table of Double_t* of sorted values
corresponding to val = major<<31 + minor;
The function performs binary search in this sorted table.
If it finds a pair that maches val, it returns directly the
index in the table.
If an entry corresponding to major and minor is not found, the function
returns the index of the major,minor pair immediatly lower than the
requested value, ie it will return -1 if the pair is lower than
the first entry in the index.
See also GetEntryNumberWithIndex
Long64_t GetEntryNumberWithIndex(Int_t major, Int_t minor) const
Return entry number corresponding to major and minor number
Note that this function returns only the entry number, not the data
To read the data corresponding to an entry number, use TTree::GetEntryWithIndex
the BuildIndex function has created a table of Double_t* of sorted values
corresponding to val = major<<31 + minor;
The function performs binary search in this sorted table.
If it finds a pair that maches val, it returns directly the
index in the table, otherwise it returns -1.
See also GetEntryNumberWithBestIndex
TTreeFormula* GetMajorFormula()
return a pointer to the TreeFormula corresponding to the majorname
TTreeFormula* GetMinorFormula()
return a pointer to the TreeFormula corresponding to the minorname
TTreeFormula* GetMajorFormulaParent(const TTree *T)
return a pointer to the TreeFormula corresponding to the majorname in parent tree T
TTreeFormula* GetMinorFormulaParent(const TTree *T)
return a pointer to the TreeFormula corresponding to the minorname in parent tree T
void Print(Option_t * option) const
print the table with : serial number, majorname, minorname
if option = "10" print only the first 10 entries
if option = "100" print only the first 100 entries
if option = "1000" print only the first 1000 entries
void Streamer(TBuffer &R__b)
Stream an object of class TTreeIndex.
Note that this Streamer should be changed to an automatic Streamer
once TStreamerInfo supports an index of type Long64_t
void SetTree(const TTree *T)
this function is called by TChain::LoadTree and TTreePlayer::UpdateFormulaLeaves
when a new Tree is loaded.
Because Trees in a TChain may have a different list of leaves, one
must update the leaves numbers in the TTreeFormula used by the TreeIndex.
Inline Functions
void ~TTreeIndex()
TTreeIndex TTreeIndex()
TTreeIndex TTreeIndex(const TTree* T, const char* majorname, const char* minorname)
Long64_t* GetIndexValues() const
Long64_t* GetIndex() const
const char* GetMajorName() const
const char* GetMinorName() const
Long64_t GetN() const
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void StreamerNVirtual(TBuffer& b)
TTreeIndex TTreeIndex(const TTreeIndex&)
TTreeIndex& operator=(const TTreeIndex&)
Author: Rene Brun 05/07/2004
Last update: root/tree:$Name: $:$Id: TTreeIndex.cxx,v 1.10 2005/04/12 09:26:27 brun Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.