library: libTree
#include "TEntryList.h"

TEntryList


class description - header file - source file
viewCVS header - viewCVS source

class TEntryList: public TNamed

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TEntryList()
TEntryList(const TTree* tree)
TEntryList(const TEntryList& elist)
TEntryList(const char* name, const char* title)
TEntryList(const char* name, const char* title, const TTree* tree)
TEntryList(const char* name, const char* title, const char* treename, const char* filename)
virtual~TEntryList()
voidTObject::AbstractMethod(const char* method) const
virtual voidAdd(const TEntryList* elist)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual Int_tContains(Long64_t entry, TTree* tree = 0)
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual Bool_tEnter(Long64_t entry, TTree* tree = 0)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TEntryList*GetCurrentList()
virtual TDirectory*GetDirectory() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Long64_tGetEntry(Int_t index)
virtual Long64_tGetEntryAndTree(Int_t index, Int_t& treenum)
virtual TEntryList*GetEntryList(const char* treename, const char* filename)
virtual const char*GetFileName()
virtual const char*TObject::GetIconName() const
virtual TList*GetLists() const
virtual Long64_tGetN() const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual const char*TNamed::GetTitle() const
virtual const char*GetTreeName()
virtual Int_tGetTreeNumber()
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Int_tMerge(TCollection* list)
virtual Long64_tNext()
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TEntryList&operator=(const TEntryList&)
virtual voidOptimizeStorage()
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual Bool_tRemove(Long64_t entry, TTree* tree = 0)
virtual voidReset()
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidSetDirectory(TDirectory* dir)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetFileName(const char* filename)
virtual voidTNamed::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetShift(Bool_t shift)
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidSetTree(const TTree* tree)
virtual voidSetTree(const char* treename, const char* filename)
virtual voidSetTreeName(const char* treename)
virtual voidSetTreeNumber(Int_t index)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidSubtract(const TEntryList* elist)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

public:
enum { kBlockSize
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TList*fListsa list of underlying entry lists for each tree of a chain
TEntryList*fCurrent! currently filled entry list
Int_tfNBlocksnumber of TEntryListBlocks
TObjArray*fBlocksblocks with indices of passing events (TEntryListBlocks)
Long64_tfNnumber of entries in the list
TStringfTreeNamename of the tree
TStringfFileNamename of the file, where the tree is
ULong_tfStringHash! Hash value of a string of treename and filename
Int_tfTreeNumber! the index of the tree in the chain (used when the entry
Long64_tfLastIndexQueried! used to optimize GetEntry() function from a loop
Long64_tfLastIndexReturned! used to optimize GetEntry() function from a loop
Bool_tfShift! true when some sub-lists don't correspond to trees
TDirectory*fDirectory! Pointer to directory holding this tree
TStringTNamed::fNameobject identifier
TStringTNamed::fTitleobject title

Class Description

 TEntryList

 Stores entry numbers. 

 There are two types of entry lists:
 - for a TTree (fBlocks data member is non-zero)
   Entry numbers are stored in TEntryListBlocks, which, in their turn, are stored
   in the TObjArray fBlocks. The range of the entry numbers is cut into intervals
   of kBlockSize entries (currently 64000), so that the first block contains
   information which entries out of the first 64000 pass the selection, the second
   block - which entries out of the 64000-127999 interval pass the selection, etc.
   Some blocks, obviously, might be empty. The internal representation of entry
   numbers in the blocks is described in the TEntryListBlock class description, and
   this representation might be changed by calling OptimizeStorage() function
   (when the list is filled via the Enter() function, this is done automatically).
   Individual entry lists can be merged (functions Merge() and Add())
   to make an entry list for a TChain of corresponding TTrees.
  
 - for a TChain (fLists data member is non-zero)
   It contains a TList of sub-lists (TEntryList objects, corresponding to each TTree)
   Trees and lists are matched by the TTree name and its file name (full path). 
   All sub-lists are returned by the GetLists() function and individual lists are
   returned by GetEntryList() function. Such lists are no different from the lists for
   TTrees, described above.

 Operations on entry lists (see also function comments):
 - Add() - if the lists are for the same tree, adds all the entries of the second list
           to the first list. If the lists are for different trees, creates a TEntryList
           with 2 sublists for each TTree. If the lists are for TChains, merges the ones
           for the same trees and adds new sublists for the TTrees that were not included
           in the first TEntryList
 - Subtract() - if the lists are for the same TTree, removes the entries of the second
                list from the first list. If the lists are for TChains, loops over all
                sub-lists
 - GetEntry(n) - returns the n-th non-zero entry number 
 - Next()      - returns next non-zero entry number. Note, that this function is 
                 much faster than GetEntry, and it's called when GetEntry() is called
                 for 2 or more indices in a row.

 TEntryList objects are added to the list of objects in the current directory

 TTree::Draw() and TChain::Draw():
   tree->Draw(">>elist", "x<0 && y>0");
   TEntryList *elist = (TEntryList*)gDirectory->Get("elist");

 TSelectors:
   To fill an TEntryList from a TSelector correctly, one must add the TEntryList object
   to the output list of the selector (TSelector::fOutput). This is the only way to 
   make the sub-lists of the TEntryList switch when the current tree of the TChain is
   changed. 

 Using a TEntryList as input (TTree::SetEntryList() and TChain::SetEntryList())
   - while the TTree::SetEntryList() function is only setting the TTree::fEntryList
     data member, the same function in TChain also finds correspondance between
     the TTrees of this TChain and the sub-lists of this TEntryList.

 TEntryList and the current directory:
   - TEntryList objects are automatically added to the current directory (like TTrees).
     However, in case of a TEntryList for a chain, only the top-level entry list is added,
     not the sub-lists for specific trees. Placing entry lists in the current directory
     allows calling them as a part of a TTreeFormula expression, so if the user wants 
     to extract a sublist from a TChain entry list via the GetEntryList() or some other
     function, he has to add it to the current directory to be able to use it in 
     TTreeFormula expressions.
 

TEntryList()
default c-tor
TEntryList(const char *name, const char *title)
c-tor with name and title
TEntryList(const char *name, const char *title, const TTree *tree)
constructor with name and title, which also sets the tree
TEntryList(const char *name, const char *title, const char *treename, const char *filename)
c-tor with name and title, which also sets the treename and the filename
TEntryList(const TTree *tree)
c-tor, which sets the tree
TEntryList(const TEntryList &elist)
copy c-tor
~TEntryList()
 d-tor
void Add(const TEntryList *elist)
Add 2 entry lists
If the resulting list has sublists (fLists!=0), its fCurrent member is reset to 0
Int_t Contains(Long64_t entry, TTree *tree)
When tree = 0, returns from the current list
When tree != 0, finds the list, corresponding to this tree
When tree is a chain, the entry is assumed to be global index and the local
entry is recomputed from the treeoffset information of the chain
Bool_t Enter(Long64_t entry, TTree *tree)
Add entry #entry to the list
When tree = 0, returns from the current list
When tree != 0, finds the list, corresponding to this tree
When tree is a chain, the entry is assumed to be global index and the local
entry is recomputed from the treeoffset information of the chain
Bool_t Remove(Long64_t entry, TTree *tree)
Remove entry #entry from the list
When tree = 0, returns from the current list
When tree != 0, finds the list, corresponding to this tree
When tree is a chain, the entry is assumed to be global index and the local
entry is recomputed from the treeoffset information of the chain
Long64_t GetEntry(Int_t index)
return the number of the entry #index of this TEntryList in the TTree or TChain
See also Next().
Long64_t GetEntryAndTree(Int_t index, Int_t &treenum)
return the index of "index"-th non-zero entry in the TTree or TChain
and the # of the corresponding tree in the chain
TEntryList * GetEntryList(const char *treename, const char *filename)
return the entry list, correspoding to treename and filename
Int_t Merge(TCollection *list)
Merge this list with the lists from the collection
Long64_t Next()
return the next non-zero entry index (next after fLastIndexQueried)
this function is faster than GetEntry()
void OptimizeStorage()
Checks if the array representation is more economical and if so, switches to it
void Print(const Option_t* option)
Print this list
option = "" - default - print the name of the tree and file
option = "all" - print all the entry numbers
void Reset()
Reset this list
void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
void SetTree(const char *treename, const char *filename)
If a list for a tree with such name and filename exists, sets it as the current sublist
If not, creates this list and sets it as the current sublist
void SetTree(const TTree *tree)
If a list for a tree with such name and filename exists, sets it as the current sublist
If not, creates this list and sets it as the current sublist
void Subtract(const TEntryList *elist)
remove all the entries of this entry list, that are contained in elist
TEntryList * GetCurrentList()
{ return fCurrent; }
TList * GetLists()
{ return fLists; }
TDirectory * GetDirectory()
{ return fDirectory; }
Long64_t GetN()
{ return fN; }
const char * GetTreeName()
{ return fTreeName.Data(); }
const char * GetFileName()
{ return fFileName.Data(); }
Int_t GetTreeNumber()
{return fTreeNumber; }
void SetShift(Bool_t shift)
{ fShift = shift; }
void SetTreeName(const char *treename)
{ fTreeName = treename; }
void SetFileName(const char *filename)
{ fFileName = filename; }
void SetTreeNumber(Int_t index)
{ fTreeNumber=index; }

Author: Anna Kreshuk 27/10/2006
Last update: root/tree:$Name: $:$Id: TEntryList.cxx,v 1.6 2006/11/30 07:49:39 brun Exp $
Copyright (C) 1995-2006, 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.