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. | |
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 TEntryList * | GetEntryList () |
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 TClass * | IsA () const |
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. | |
virtual void | Streamer (TBuffer &) |
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 TClass * | Class () |
static const char * | Class_Name () |
static constexpr Version_t | Class_Version () |
static const char * | DeclFileName () |
Static Public Member Functions inherited from TVirtualTableInterface | |
static TClass * | Class () |
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 | |
TEntryList * | fEntries |
Currently active entries. | |
Long64_t | fEntry |
Present entry number in fTree. | |
Long64_t | fFirstEntry |
First entry. | |
Bool_t | fForceDim |
Force dimension. | |
TList * | fFormulas |
Array of TTreeFormulas to display values. | |
TList * | fInput |
Used for fSelector. | |
TTreeFormulaManager * | fManager |
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. | |
TTreeFormula * | fSelect |
Selection condition. | |
TSelectorDraw * | fSelector |
Selector. | |
TTree * | fTree |
Data in a TTree. | |
#include <TTreeTableInterface.h>
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.
|
virtual |
TTreeTableInterface destructor.
Definition at line 86 of file TTreeTableInterface.cxx.
|
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.
|
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.
|
static |
|
inlinestaticconstexpr |
Definition at line 69 of file TTreeTableInterface.h.
|
inlinestatic |
Definition at line 69 of file TTreeTableInterface.h.
|
virtual |
Return a string to use as a label for columnheader at column.
Implements TVirtualTableInterface.
Definition at line 346 of file TTreeTableInterface.cxx.
|
inlinevirtual |
Definition at line 60 of file TTreeTableInterface.h.
|
virtual |
Return the amount of column available.
Implements TVirtualTableInterface.
Definition at line 360 of file TTreeTableInterface.cxx.
|
virtual |
Return the amount of rows in the Tree.
Implements TVirtualTableInterface.
Definition at line 368 of file TTreeTableInterface.cxx.
|
virtual |
Return a string to use as a label for rowheader at column.
Implements TVirtualTableInterface.
Definition at line 333 of file TTreeTableInterface.cxx.
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.
Return the content of row,column as string to use in a TGTableCell label.
Implements TVirtualTableInterface.
Definition at line 300 of file TTreeTableInterface.cxx.
|
private |
Initialise the TEntryList with the entries that match the selection criterium.
Definition at line 201 of file TTreeTableInterface.cxx.
|
inlinevirtual |
Reimplemented from TVirtualTableInterface.
Definition at line 69 of file TTreeTableInterface.h.
|
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.
|
virtual |
Set the currently active entrylist.
Definition at line 468 of file TTreeTableInterface.cxx.
|
virtual |
Set the TTreeFormula of position to formula.
Definition at line 445 of file TTreeTableInterface.cxx.
|
virtual |
Set the selection expression.
Definition at line 140 of file TTreeTableInterface.cxx.
|
private |
Compile the variables expression from the given varexp.
Definition at line 100 of file TTreeTableInterface.cxx.
|
virtual |
Reimplemented from TVirtualTableInterface.
|
inline |
Definition at line 69 of file TTreeTableInterface.h.
|
private |
Sync the formulas using the TTreeFormulaManager.
Definition at line 167 of file TTreeTableInterface.cxx.
|
private |
Currently active entries.
Definition at line 38 of file TTreeTableInterface.h.
|
private |
Present entry number in fTree.
Definition at line 30 of file TTreeTableInterface.h.
|
private |
First entry.
Definition at line 32 of file TTreeTableInterface.h.
|
private |
Force dimension.
Definition at line 37 of file TTreeTableInterface.h.
|
private |
Array of TTreeFormulas to display values.
Definition at line 29 of file TTreeTableInterface.h.
|
private |
Used for fSelector.
Definition at line 36 of file TTreeTableInterface.h.
|
private |
Coordinator for the formulas.
Definition at line 33 of file TTreeTableInterface.h.
|
private |
Amount of columns in the data.
Definition at line 40 of file TTreeTableInterface.h.
|
private |
Number of entries in the tree.
Definition at line 31 of file TTreeTableInterface.h.
|
private |
Amount of rows in the data.
Definition at line 39 of file TTreeTableInterface.h.
|
private |
Selection condition.
Definition at line 34 of file TTreeTableInterface.h.
|
private |
Selector.
Definition at line 35 of file TTreeTableInterface.h.
|
private |
Data in a TTree.
Definition at line 28 of file TTreeTableInterface.h.