Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TTreeTableInterface.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Author: Roel Aaij   21/07/2007
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_TTreeTableInterface
0012 #define ROOT_TTreeTableInterface
0013 
0014 #include "TVirtualTableInterface.h"
0015 
0016 class TTree;
0017 class TObjArray;
0018 class TTreeFormula;
0019 class TTreeFormulaManager;
0020 class TSelectorDraw;
0021 class TEntryList;
0022 class TList;
0023 
0024 
0025 class TTreeTableInterface : public TVirtualTableInterface {
0026 
0027 private:
0028    TTree               *fTree;       ///< Data in a TTree
0029    TList               *fFormulas;   ///< Array of TTreeFormulas to display values
0030    Long64_t             fEntry;      ///< Present entry number in fTree.
0031    Long64_t             fNEntries;   ///< Number of entries in the tree.
0032    Long64_t             fFirstEntry; ///< First entry.
0033    TTreeFormulaManager *fManager;    ///< Coordinator for the formulas.
0034    TTreeFormula        *fSelect;     ///< Selection condition
0035    TSelectorDraw       *fSelector;   ///< Selector
0036    TList               *fInput;      ///< Used for fSelector.
0037    bool                 fForceDim;   ///< Force dimension.
0038    TEntryList          *fEntries;    ///< Currently active entries
0039    UInt_t               fNRows;      ///< Amount of rows in the data
0040    UInt_t               fNColumns;   ///< Amount of columns in the data
0041 
0042    void SetVariablesExpression(const char *varexp);
0043    void SyncFormulas();
0044    void InitEntries();
0045 
0046 protected:
0047 
0048 public:
0049    TTreeTableInterface(TTree *tree = nullptr, const char *varexp = nullptr,
0050                        const char *selection = nullptr, Option_t *option = nullptr,
0051                        Long64_t nentries = 0, Long64_t firstentry = 0);
0052    ~TTreeTableInterface() override;
0053 
0054    Double_t    GetValue(UInt_t row, UInt_t column) override;
0055    const char *GetValueAsString(UInt_t row, UInt_t column) override;
0056    const char *GetRowHeader(UInt_t row) override;
0057    const char *GetColumnHeader(UInt_t column) override;
0058    UInt_t      GetNRows() override;
0059    UInt_t      GetNColumns() override;
0060    virtual TEntryList *GetEntryList() { return fEntries; }
0061 
0062    virtual void AddColumn(const char *expression, UInt_t position);
0063    virtual void AddColumn(TTreeFormula *formula, UInt_t position);
0064    virtual void RemoveColumn(UInt_t position);
0065    virtual void SetFormula(TTreeFormula *formula, UInt_t position);
0066    virtual void SetSelection(const char *selection);
0067    virtual void SetEntryList(TEntryList *entrylist = nullptr);
0068 
0069    ClassDefOverride(TTreeTableInterface, 0) // Interface to data in a TTree
0070 };
0071 
0072 #endif