AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MakeTreeStat.C File Reference
#include "TFile.h"
#include "TTree.h"
#include "TBranch.h"
#include "TMath.h"
#include "TArrayF.h"
#include "TObjArray.h"
#include "TObjString.h"
Include dependency graph for MakeTreeStat.C:

Go to the source code of this file.

Functions

void MakeStat (TTree *tree, Bool_t zipSort)
 
void PrintSorted (Bool_t zipSort)
 
void AddToReport (const char *prefix, const char *name, Float_t size[2], Float_t ratio)
 
void MakeStat (const char *prefix, TBranch *branch, Float_t *size, Float_t mratio)
 

Variables

TTree * fTree
 
TObjArray aReport
 
TArrayF totSize
 
TArrayF zipSize
 
TArrayF zipRatio
 

Detailed Description

Macro to get the size of the Tree As a improvment to tree->Print() function, this algorithm gives the size of all of the branchces and in addition print them sorted according total tree size (MEMORY USAGE if one event in tree) or zip size (THE storage size on disk)

Printed statistic:

  1. Order
  2. TotSize (in memory) + fraction of total size
  3. ZipSize (in memory) + fraction of zip size
  4. Compression ratio

Usage:

  1. Enable macro
.L $ALICE_ROOT/TPC/macros/MakeTreeStat.C+
  1. Open the tree (eg.)
TFile f("AliESDs.root");
TTree * tree = (TTree*)f.Get("esdTree");
  1. Print statistic (sorting according secon argument - either zip Bytes (kTRUE or TotSize (kFALSE)
MakeStat(tree, kTRUE);
Author
M.Ivanov, GSI, m.iva.nosp@m.nov@.nosp@m.gsi.d.nosp@m.e

Definition in file MakeTreeStat.C.

Function Documentation

void AddToReport ( const char *  prefix,
const char *  name,
Float_t  size[2],
Float_t  ratio 
)

add branch info to array

Definition at line 95 of file MakeTreeStat.C.

Referenced by MakeStat().

void MakeStat ( TTree *  tree,
Bool_t  zipSort 
)

make recursve loop over tree branches

Definition at line 120 of file MakeTreeStat.C.

Referenced by MakeStat().

void MakeStat ( const char *  prefix,
TBranch *  branch,
Float_t *  size,
Float_t  mratio 
)

Recursive function to get size of the branches and ratios

Definition at line 140 of file MakeTreeStat.C.

void PrintSorted ( Bool_t  zipSort)

print statistic

Definition at line 65 of file MakeTreeStat.C.

Referenced by MakeStat().

Variable Documentation

TObjArray aReport

Definition at line 56 of file MakeTreeStat.C.

Referenced by AddToReport(), MakeStat(), and PrintSorted().

TTree* fTree

Definition at line 55 of file MakeTreeStat.C.

Referenced by MakeStat().

TArrayF totSize

Definition at line 57 of file MakeTreeStat.C.

Referenced by AddToReport(), and PrintSorted().

TArrayF zipRatio

Definition at line 59 of file MakeTreeStat.C.

Referenced by AddToReport(), and PrintSorted().

TArrayF zipSize

Definition at line 58 of file MakeTreeStat.C.

Referenced by AddToReport(), and PrintSorted().