TTreeTableInterface.h

Go to the documentation of this file.
00001 // Author: Roel Aaij   21/07/2007
00002 
00003 /*************************************************************************
00004  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00009  *************************************************************************/
00010 
00011 #ifndef ROOT_TTreeTableInterface
00012 #define ROOT_TTreeTableInterface
00013 
00014 #ifndef ROOT_TVirtualTableInterface
00015 #include "TVirtualTableInterface.h"
00016 #endif
00017 
00018 class TTree;
00019 class TObjArray;
00020 class TTreeFormula;
00021 class TTreeFormulaManager;
00022 class TSelectorDraw;
00023 class TEntryList;
00024 class TList;
00025 
00026 
00027 class TTreeTableInterface : public TVirtualTableInterface {
00028 
00029 private:
00030    TTree               *fTree;       // Data in a TTree
00031    TList               *fFormulas;   // Array of TTreeFormulas to display values
00032    Long64_t             fEntry;      // Present entry number in fTree.
00033    Long64_t             fNEntries;   // Number of entries in the tree.
00034    Long64_t             fFirstEntry; // First entry.
00035    TTreeFormulaManager *fManager;    // Coordinator for the formulas.
00036    TTreeFormula        *fSelect;     // Selection condition
00037    TSelectorDraw       *fSelector;   // Selector
00038    TList               *fInput;      // Used for fSelector.
00039    Bool_t               fForceDim;   // Force dimension.
00040    TEntryList          *fEntries;    // Currently active entries
00041    UInt_t               fNRows;      // Amount of rows in the data
00042    UInt_t               fNColumns;   // Amount of columns in the data
00043 
00044    void SetVariablesExpression(const char *varexp);
00045    void SyncFormulas();
00046    void InitEntries();
00047 
00048 protected:
00049 
00050 public:
00051    TTreeTableInterface(TTree *tree = 0, const char *varexp = 0,
00052                        const char *selection = 0, Option_t *option = 0,
00053                        Long64_t nentries = 0, Long64_t firstentry = 0);
00054    virtual ~TTreeTableInterface();
00055 
00056    virtual Double_t    GetValue(UInt_t row, UInt_t column);
00057    virtual const char *GetValueAsString(UInt_t row, UInt_t column);
00058    virtual const char *GetRowHeader(UInt_t row);
00059    virtual const char *GetColumnHeader(UInt_t column);
00060    virtual UInt_t      GetNRows();
00061    virtual UInt_t      GetNColumns();
00062    virtual TEntryList *GetEntryList() { return fEntries; }
00063 
00064    virtual void AddColumn(const char *expression, UInt_t position);
00065    virtual void AddColumn(TTreeFormula *formula, UInt_t position);
00066    virtual void RemoveColumn(UInt_t position);
00067    virtual void SetFormula(TTreeFormula *formula, UInt_t position);
00068    virtual void SetSelection(const char *selection);
00069    virtual void SetEntryList(TEntryList *entrylist = 0);
00070 
00071    ClassDef(TTreeTableInterface, 0) // Interface to data in a TTree
00072 };
00073 
00074 #endif

Generated on Tue Jul 5 14:28:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1