ROOT » TREE » TREE » TTreeCloner

class TTreeCloner


TTreeCloner

Class implementing or helping  the various TTree cloning method


Function Members (Methods)

public:
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()
const char*GetWarning() const
virtual TClass*IsA() const
Bool_tIsValid()
Bool_tNeedConversion()
virtual voidShowMembers(TMemberInspector& insp) const
voidSortBaskets()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
TTreeCloner(TTree* from, TTree* to, Option_t* method, UInt_t options = kNone)
voidWriteBaskets()

Data Members

public:
static TTreeCloner::EClonerOptionskIgnoreMissingTopLevel
static TTreeCloner::EClonerOptionskNoWarnings
static TTreeCloner::EClonerOptionskNone
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
Bool_tfNeedConversionTrue if the fast merge is not possible but a slow merge might possible.
UInt_tfOptions
UShort_tfPidOffsetOffset to be added to the copied key/basket.
TObjArrayfToBranches
Long64_tfToStartEntriesNumber of entries in the target tree before any addition.
TTree*fToTree
TStringfWarningMsgText of the error message lead to an 'invalid' state
static TTreeCloner::ECloneMethodkDefault
static TTreeCloner::ECloneMethodkSortBasketsByBranch
static TTreeCloner::ECloneMethodkSortBasketsByEntry
static TTreeCloner::ECloneMethodkSortBasketsByOffset

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TTreeCloner(TTree* from, TTree* to, Option_t* method, UInt_t options = kNone)
 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 ImportClusterRanges()
 Set the entries and import the cluster range of the
void SortBaskets()
 Sort the basket according to the user request.
void WriteBaskets()
 Transfer the basket from the input file to the output file
TTreeCloner(const TTreeCloner& )
TTreeCloner & operator=(const TTreeCloner& )
const char * GetWarning() const
{ return fWarningMsg; }
Bool_t IsValid()
{ return fIsValid; }
Bool_t NeedConversion()
{ return fNeedConversion; }