Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TTreeTableInterface.h
Go to the documentation of this file.
1 // Author: Roel Aaij 21/07/2007
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TTreeTableInterface
12 #define ROOT_TTreeTableInterface
13 
14 #include "TVirtualTableInterface.h"
15 
16 class TTree;
17 class TObjArray;
18 class TTreeFormula;
19 class TTreeFormulaManager;
20 class TSelectorDraw;
21 class TEntryList;
22 class TList;
23 
24 
25 class TTreeTableInterface : public TVirtualTableInterface {
26 
27 private:
28  TTree *fTree; // Data in a TTree
29  TList *fFormulas; // Array of TTreeFormulas to display values
30  Long64_t fEntry; // Present entry number in fTree.
31  Long64_t fNEntries; // Number of entries in the tree.
32  Long64_t fFirstEntry; // First entry.
33  TTreeFormulaManager *fManager; // Coordinator for the formulas.
34  TTreeFormula *fSelect; // Selection condition
35  TSelectorDraw *fSelector; // Selector
36  TList *fInput; // Used for fSelector.
37  Bool_t fForceDim; // Force dimension.
38  TEntryList *fEntries; // Currently active entries
39  UInt_t fNRows; // Amount of rows in the data
40  UInt_t fNColumns; // Amount of columns in the data
41 
42  void SetVariablesExpression(const char *varexp);
43  void SyncFormulas();
44  void InitEntries();
45 
46 protected:
47 
48 public:
49  TTreeTableInterface(TTree *tree = 0, const char *varexp = 0,
50  const char *selection = 0, Option_t *option = 0,
51  Long64_t nentries = 0, Long64_t firstentry = 0);
52  virtual ~TTreeTableInterface();
53 
54  virtual Double_t GetValue(UInt_t row, UInt_t column);
55  virtual const char *GetValueAsString(UInt_t row, UInt_t column);
56  virtual const char *GetRowHeader(UInt_t row);
57  virtual const char *GetColumnHeader(UInt_t column);
58  virtual UInt_t GetNRows();
59  virtual UInt_t GetNColumns();
60  virtual TEntryList *GetEntryList() { return fEntries; }
61 
62  virtual void AddColumn(const char *expression, UInt_t position);
63  virtual void AddColumn(TTreeFormula *formula, UInt_t position);
64  virtual void RemoveColumn(UInt_t position);
65  virtual void SetFormula(TTreeFormula *formula, UInt_t position);
66  virtual void SetSelection(const char *selection);
67  virtual void SetEntryList(TEntryList *entrylist = 0);
68 
69  ClassDef(TTreeTableInterface, 0) // Interface to data in a TTree
70 };
71 
72 #endif