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=nullptr, const char *varexp=nullptr, const char *selection=nullptr, Option_t *option=nullptr, Long64_t nentries=0, Long64_t firstentry=0)
 TTreeTableInterface constructor.
 
 ~TTreeTableInterface () override
 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.
 
const char * GetColumnHeader (UInt_t column) override
 Return a string to use as a label for columnheader at column.
 
virtual TEntryListGetEntryList ()
 
UInt_t GetNColumns () override
 Return the amount of column available.
 
UInt_t GetNRows () override
 Return the amount of rows in the Tree.
 
const char * GetRowHeader (UInt_t row) override
 Return a string to use as a label for rowheader at column.
 
Double_t GetValue (UInt_t row, UInt_t column) override
 Return the value of row,column.
 
const char * GetValueAsString (UInt_t row, UInt_t column) override
 Return the content of row,column as string to use in a TGTableCell label.
 
TClassIsA () const override
 
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=nullptr)
 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.
 
void Streamer (TBuffer &) override
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
- Public Member Functions inherited from TVirtualTableInterface
 TVirtualTableInterface ()
 
virtual ~TVirtualTableInterface ()
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
- Static Public Member Functions inherited from TVirtualTableInterface
static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

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 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 = nullptr,
const char * varexp = nullptr,
const char * selection = nullptr,
Option_t * option = nullptr,
Long64_t nentries = 0,
Long64_t firstentry = 0 )

TTreeTableInterface constructor.

Definition at line 43 of file TTreeTableInterface.cxx.

◆ ~TTreeTableInterface()

TTreeTableInterface::~TTreeTableInterface ( )
override

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 378 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 402 of file TTreeTableInterface.cxx.

◆ Class()

static TClass * TTreeTableInterface::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TTreeTableInterface::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TTreeTableInterface::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 69 of file TTreeTableInterface.h.

◆ DeclFileName()

static const char * TTreeTableInterface::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 69 of file TTreeTableInterface.h.

◆ GetColumnHeader()

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

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

Implements TVirtualTableInterface.

Definition at line 346 of file TTreeTableInterface.cxx.

◆ GetEntryList()

virtual TEntryList * TTreeTableInterface::GetEntryList ( )
inlinevirtual

Definition at line 60 of file TTreeTableInterface.h.

◆ GetNColumns()

UInt_t TTreeTableInterface::GetNColumns ( )
overridevirtual

Return the amount of column available.

Implements TVirtualTableInterface.

Definition at line 360 of file TTreeTableInterface.cxx.

◆ GetNRows()

UInt_t TTreeTableInterface::GetNRows ( )
overridevirtual

Return the amount of rows in the Tree.

Implements TVirtualTableInterface.

Definition at line 368 of file TTreeTableInterface.cxx.

◆ GetRowHeader()

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

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

Implements TVirtualTableInterface.

Definition at line 333 of file TTreeTableInterface.cxx.

◆ GetValue()

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

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 264 of file TTreeTableInterface.cxx.

◆ GetValueAsString()

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

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

Implements TVirtualTableInterface.

Definition at line 300 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.

◆ IsA()

TClass * TTreeTableInterface::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TVirtualTableInterface.

Definition at line 69 of file TTreeTableInterface.h.

◆ 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 421 of file TTreeTableInterface.cxx.

◆ SetEntryList()

void TTreeTableInterface::SetEntryList ( TEntryList * entrylist = nullptr)
virtual

Set the currently active entrylist.

Definition at line 468 of file TTreeTableInterface.cxx.

◆ SetFormula()

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

Set the TTreeFormula of position to formula.

Definition at line 445 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.

◆ Streamer()

void TTreeTableInterface::Streamer ( TBuffer & )
overridevirtual

Reimplemented from TVirtualTableInterface.

◆ StreamerNVirtual()

void TTreeTableInterface::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 69 of file TTreeTableInterface.h.

◆ 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 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: