Loading [MathJax]/extensions/tex2jax.js
Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
TTreeTableInterface Class Reference

TTreeTableInterface is used to interface to data that is stored in a TTree.

When the interface is created, an expression can be specified. This expression will define the columns to be shown.

A selection criterium can also be specified. A TEntryList will be created and applied to the TTree using this criterium. a new TEntryList to use can be specified using SetEntryList. TGTable->Update() will need to be called to show the effects.

WARNING: Do not apply an entrylist to the tree in any other way than through the interface, this will have undefined consequences.

Columns can be manipulated using the appropriate methods. A TGTable->Update is always needed afterwards to make the table aware of the changes.

Definition at line 25 of file TTreeTableInterface.h.

Public Member Functions

 TTreeTableInterface (TTree *tree=0, const char *varexp=0, const char *selection=0, Option_t *option=0, Long64_t nentries=0, Long64_t firstentry=0)
 TTreeTableInterface constructor.
 
virtual ~TTreeTableInterface ()
 TTreeTableInterface destructor.
 
virtual void AddColumn (const char *expression, UInt_t position)
 Add column according ot expression at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.
 
virtual void AddColumn (TTreeFormula *formula, UInt_t position)
 Add column with formula at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.
 
virtual const char * GetColumnHeader (UInt_t column)
 Return a string to use as a label for columnheader at column.
 
virtual TEntryListGetEntryList ()
 
virtual UInt_t GetNColumns ()
 Return the amount of column available.
 
virtual UInt_t GetNRows ()
 Return the amount of rows in the Tree.
 
virtual const char * GetRowHeader (UInt_t row)
 Return a string to use as a label for rowheader at column.
 
virtual Double_t GetValue (UInt_t row, UInt_t column)
 Return the value of row,column.
 
virtual const char * GetValueAsString (UInt_t row, UInt_t column)
 Return the content of row,column as string to use in a TGTableCell label.
 
virtual void RemoveColumn (UInt_t position)
 Remove column at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.
 
virtual void SetEntryList (TEntryList *entrylist=0)
 Set the currently active entrylist.
 
virtual void SetFormula (TTreeFormula *formula, UInt_t position)
 Set the TTreeFormula of position to formula.
 
virtual void SetSelection (const char *selection)
 Set the selection expression.
 
- Public Member Functions inherited from TVirtualTableInterface
 TVirtualTableInterface ()
 
virtual ~TVirtualTableInterface ()
 

Private Member Functions

void InitEntries ()
 Initialise the TEntryList with the entries that match the selection criterium.
 
void SetVariablesExpression (const char *varexp)
 Compile the variables expression from the given varexp.
 
void SyncFormulas ()
 Sync the formulas using the TTreeFormulaManager.
 

Private Attributes

TEntryListfEntries
 Currently active entries.
 
Long64_t fEntry
 Present entry number in fTree.
 
Long64_t fFirstEntry
 First entry.
 
Bool_t fForceDim
 Force dimension.
 
TListfFormulas
 Array of TTreeFormulas to display values.
 
TListfInput
 Used for fSelector.
 
TTreeFormulaManagerfManager
 Coordinator for the formulas.
 
UInt_t fNColumns
 Amount of columns in the data.
 
Long64_t fNEntries
 Number of entries in the tree.
 
UInt_t fNRows
 Amount of rows in the data.
 
TTreeFormulafSelect
 Selection condition.
 
TSelectorDrawfSelector
 Selector.
 
TTreefTree
 Data in a TTree.
 

#include <TTreeTableInterface.h>

Inheritance diagram for TTreeTableInterface:
[legend]

Constructor & Destructor Documentation

◆ TTreeTableInterface()

TTreeTableInterface::TTreeTableInterface ( TTree tree = 0,
const char *  varexp = 0,
const char *  selection = 0,
Option_t option = 0,
Long64_t  nentries = 0,
Long64_t  firstentry = 0 
)

TTreeTableInterface constructor.

Definition at line 43 of file TTreeTableInterface.cxx.

◆ ~TTreeTableInterface()

TTreeTableInterface::~TTreeTableInterface ( )
virtual

TTreeTableInterface destructor.

Definition at line 86 of file TTreeTableInterface.cxx.

Member Function Documentation

◆ AddColumn() [1/2]

void TTreeTableInterface::AddColumn ( const char *  expression,
UInt_t  position 
)
virtual

Add column according ot expression at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.

Definition at line 380 of file TTreeTableInterface.cxx.

◆ AddColumn() [2/2]

void TTreeTableInterface::AddColumn ( TTreeFormula formula,
UInt_t  position 
)
virtual

Add column with formula at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.

Definition at line 404 of file TTreeTableInterface.cxx.

◆ GetColumnHeader()

const char * TTreeTableInterface::GetColumnHeader ( UInt_t  column)
virtual

Return a string to use as a label for columnheader at column.

Implements TVirtualTableInterface.

Definition at line 348 of file TTreeTableInterface.cxx.

◆ GetEntryList()

virtual TEntryList * TTreeTableInterface::GetEntryList ( )
inlinevirtual

Definition at line 60 of file TTreeTableInterface.h.

◆ GetNColumns()

UInt_t TTreeTableInterface::GetNColumns ( )
virtual

Return the amount of column available.

Implements TVirtualTableInterface.

Definition at line 362 of file TTreeTableInterface.cxx.

◆ GetNRows()

UInt_t TTreeTableInterface::GetNRows ( )
virtual

Return the amount of rows in the Tree.

Implements TVirtualTableInterface.

Definition at line 370 of file TTreeTableInterface.cxx.

◆ GetRowHeader()

const char * TTreeTableInterface::GetRowHeader ( UInt_t  row)
virtual

Return a string to use as a label for rowheader at column.

Implements TVirtualTableInterface.

Definition at line 335 of file TTreeTableInterface.cxx.

◆ GetValue()

Double_t TTreeTableInterface::GetValue ( UInt_t  row,
UInt_t  column 
)
virtual

Return the value of row,column.

If the position does not exist or does not contain a number, 0 is returned.

Implements TVirtualTableInterface.

Definition at line 266 of file TTreeTableInterface.cxx.

◆ GetValueAsString()

const char * TTreeTableInterface::GetValueAsString ( UInt_t  row,
UInt_t  column 
)
virtual

Return the content of row,column as string to use in a TGTableCell label.

Implements TVirtualTableInterface.

Definition at line 302 of file TTreeTableInterface.cxx.

◆ InitEntries()

void TTreeTableInterface::InitEntries ( )
private

Initialise the TEntryList with the entries that match the selection criterium.

Definition at line 201 of file TTreeTableInterface.cxx.

◆ RemoveColumn()

void TTreeTableInterface::RemoveColumn ( UInt_t  position)
virtual

Remove column at position, TGTable->Update() is needed afterwards to apply the change to the TGTable.

Definition at line 423 of file TTreeTableInterface.cxx.

◆ SetEntryList()

void TTreeTableInterface::SetEntryList ( TEntryList entrylist = 0)
virtual

Set the currently active entrylist.

Definition at line 470 of file TTreeTableInterface.cxx.

◆ SetFormula()

void TTreeTableInterface::SetFormula ( TTreeFormula formula,
UInt_t  position 
)
virtual

Set the TTreeFormula of position to formula.

Definition at line 447 of file TTreeTableInterface.cxx.

◆ SetSelection()

void TTreeTableInterface::SetSelection ( const char *  selection)
virtual

Set the selection expression.

Definition at line 140 of file TTreeTableInterface.cxx.

◆ SetVariablesExpression()

void TTreeTableInterface::SetVariablesExpression ( const char *  varexp)
private

Compile the variables expression from the given varexp.

Definition at line 100 of file TTreeTableInterface.cxx.

◆ SyncFormulas()

void TTreeTableInterface::SyncFormulas ( )
private

Sync the formulas using the TTreeFormulaManager.

Definition at line 167 of file TTreeTableInterface.cxx.

Member Data Documentation

◆ fEntries

TEntryList* TTreeTableInterface::fEntries
private

Currently active entries.

Definition at line 38 of file TTreeTableInterface.h.

◆ fEntry

Long64_t TTreeTableInterface::fEntry
private

Present entry number in fTree.

Definition at line 30 of file TTreeTableInterface.h.

◆ fFirstEntry

Long64_t TTreeTableInterface::fFirstEntry
private

First entry.

Definition at line 32 of file TTreeTableInterface.h.

◆ fForceDim

Bool_t TTreeTableInterface::fForceDim
private

Force dimension.

Definition at line 37 of file TTreeTableInterface.h.

◆ fFormulas

TList* TTreeTableInterface::fFormulas
private

Array of TTreeFormulas to display values.

Definition at line 29 of file TTreeTableInterface.h.

◆ fInput

TList* TTreeTableInterface::fInput
private

Used for fSelector.

Definition at line 36 of file TTreeTableInterface.h.

◆ fManager

TTreeFormulaManager* TTreeTableInterface::fManager
private

Coordinator for the formulas.

Definition at line 33 of file TTreeTableInterface.h.

◆ fNColumns

UInt_t TTreeTableInterface::fNColumns
private

Amount of columns in the data.

Definition at line 40 of file TTreeTableInterface.h.

◆ fNEntries

Long64_t TTreeTableInterface::fNEntries
private

Number of entries in the tree.

Definition at line 31 of file TTreeTableInterface.h.

◆ fNRows

UInt_t TTreeTableInterface::fNRows
private

Amount of rows in the data.

Definition at line 39 of file TTreeTableInterface.h.

◆ fSelect

TTreeFormula* TTreeTableInterface::fSelect
private

Selection condition.

Definition at line 34 of file TTreeTableInterface.h.

◆ fSelector

TSelectorDraw* TTreeTableInterface::fSelector
private

Selector.

Definition at line 35 of file TTreeTableInterface.h.

◆ fTree

TTree* TTreeTableInterface::fTree
private

Data in a TTree.

Definition at line 28 of file TTreeTableInterface.h.

Libraries for TTreeTableInterface:

The documentation for this class was generated from the following files: