class TTreeCloner


TTreeCloner

Class implementing or helping  the various TTree cloning method


Function Members (Methods)

public:
TTreeCloner(TTree* from, TTree* to, Option_t* method)
virtual~TTreeCloner()
static TClass*Class()
voidCloseOutWriteBaskets()
voidCollectBaskets()
UInt_tCollectBranches()
UInt_tCollectBranches(TBranch* from, TBranch* to)
UInt_tCollectBranches(TObjArray* from, TObjArray* to)
voidCopyMemoryBaskets()
voidCopyProcessIds()
voidCopyStreamerInfos()
Bool_tExec()
virtual TClass*IsA() const
Bool_tIsValid()
virtual voidShowMembers(TMemberInspector& insp, char* parent)
voidSortBaskets()
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidWriteBaskets()

Data Members

public:
enum ECloneMethod { kDefault
kSortBasketsByBranch
kSortBasketsByOffset
kSortBasketsByEntry
};
private:
UInt_t*fBasketBranchNum[fMaxBaskets] Index of the branch(es) of the basket.
Long64_t*fBasketEntry[fMaxBaskets] list of basket start entries.
UInt_t*fBasketIndex[fMaxBaskets] ordered list of basket indices to be written.
UInt_t*fBasketNum[fMaxBaskets] index of the basket within the branch.
Long64_t*fBasketSeek[fMaxBaskets] list of basket position to be read.
UInt_tfCloneMethodIndicates which cloning method was selected.
TObjArrayfFromBranches
TTree*fFromTree
Bool_tfIsValid
UInt_tfMaxBaskets
Option_t*fMethod
UShort_tfPidOffsetOffset to be added to the copied key/basket.
TObjArrayfToBranches
Long64_tfToStartEntriesNumber of entries in the target tree before any addition.
TTree*fToTree

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TTreeCloner(TTree* from, TTree* to, Option_t* method)
 Constructor.  This object would transfer the data from
 'from' to 'to' using the method indicated in method.

 The value of the parameter 'method' determines in which
 order the branches' baskets are written to the output file.

 When a TTree is filled the data is stored in the individual
 branches' basket.  Each basket is written individually to
 the disk as soon as it is full.  In consequence the baskets
 of branches that contain 'large' data chunk are written to
 the disk more often.

 There is currently 3 supported sorting order:
    SortBasketsByOffset (the default)
    SortBasketsByBranch
    SortBasketsByEntry

 When using SortBasketsByOffset the baskets are written in
 the output file in the same order as in the original file
 (i.e. the basket are sorted on their offset in the original
 file; Usually this also means that the baskets are sorted
 on the index/number of the _last_ entry they contain)

 When using SortBasketsByBranch all the baskets of each
 individual branches are stored contiguously.  This tends to
 optimize reading speed when reading a small number (1->5) of
 branches, since all their baskets will be clustered together
 instead of being spread across the file.  However it might
 decrease the performance when reading more branches (or the full
 entry).

 When using SortBasketsByEntry the baskets with the lowest
 starting entry are written first.  (i.e. the baskets are
 sorted on the index/number of the first entry they contain).
 This means that on the file the baskets will be in the order
 in which they will be needed when reading the whole tree
 sequentially.

Bool_t Exec()
 Execute the cloning.
~TTreeCloner()
 TTreeCloner destructor
void CloseOutWriteBaskets()
 Before we can start adding new basket, we need to flush to
 disk the partially filled baskets (the WriteBasket)
UInt_t CollectBranches(TBranch *from, TBranch *to)
 Fill the array of branches, adding the branch 'from' and 'to',
 and matching the sub-branches of the 'from' and 'to' branches.
 Returns the total number of baskets in all the from branch and
 it sub-branches.
UInt_t CollectBranches(TObjArray *from, TObjArray *to)
 Fill the array of branches, matching the branches of the 'from' and 'to' arrays.
 Returns the total number of baskets in all the branches.
UInt_t CollectBranches()
 Fill the array of branches, matching the branches of the 'from' and 'to' TTrees
 Returns the total number of baskets in all the branches.
void CollectBaskets()
 Collect the information about the on-file basket that need
 to be copied.
void CopyStreamerInfos()
 Make sure that all the needed TStreamerInfo are
 present in the output file
void CopyMemoryBaskets()
 Transfer the basket from the input file to the output file
void CopyProcessIds()
 Make sure that all the needed TStreamerInfo are
 present in the output file
void SortBaskets()
 Sort the basket according to the user request.
void WriteBaskets()
 Transfer the basket from the input file to the output file
Bool_t IsValid()
{ return fIsValid; }

Author: Philippe Canal 07/11/2005
Last change: root/tree:$Id: TTreeCloner.h 26028 2008-10-30 20:09:44Z brun $
Last generated: 2008-10-31 14:49
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *

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.