Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:30

0001 // @(#)root/treeplayer:$Id$
0002 // Author: Rene Brun   05/07/2004
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TTreeIndex
0013 #define ROOT_TTreeIndex
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TTreeIndex                                                           //
0019 //                                                                      //
0020 // A Tree Index with majorname and minorname.                           //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TVirtualIndex.h"
0026 
0027 class TTreeFormula;
0028 
0029 class TTreeIndex : public TVirtualIndex {
0030 protected:
0031    TString        fMajorName;           ///< Index major name
0032    TString        fMinorName;           ///< Index minor name
0033    Long64_t       fN;                   ///< Number of entries
0034    Long64_t      *fIndexValues;         ///<[fN] Sorted index values, higher 64bits
0035    Long64_t      *fIndexValuesMinor;    ///<[fN] Sorted index values, lower 64bits
0036    Long64_t      *fIndex;               ///<[fN] Index of sorted values
0037    TTreeFormula  *fMajorFormula;        ///<! Pointer to major TreeFormula
0038    TTreeFormula  *fMinorFormula;        ///<! Pointer to minor TreeFormula
0039    TTreeFormula  *fMajorFormulaParent;  ///<! Pointer to major TreeFormula in Parent tree (if any)
0040    TTreeFormula  *fMinorFormulaParent;  ///<! Pointer to minor TreeFormula in Parent tree (if any)
0041 
0042    TTreeFormula  *GetMajorFormulaParent(const TTree *parent);
0043    TTreeFormula  *GetMinorFormulaParent(const TTree *parent);
0044 
0045 private:
0046    TTreeIndex(const TTreeIndex&) = delete;            // Not implemented.
0047    TTreeIndex &operator=(const TTreeIndex&) = delete; // Not implemented.
0048 
0049 public:
0050    TTreeIndex();
0051    TTreeIndex(const TTree *T, const char *majorname, const char *minorname);
0052    ~TTreeIndex() override;
0053    void                   Append(const TVirtualIndex *,bool delaySort = false) override;
0054    bool                   ConvertOldToNew();
0055    Long64_t               FindValues(Long64_t major, Long64_t minor) const;
0056    Long64_t               GetEntryNumberFriend(const TTree *parent) override;
0057    Long64_t               GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const override;
0058    Long64_t               GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const override;
0059    virtual Long64_t      *GetIndex()        const {return fIndex;}
0060    virtual Long64_t      *GetIndexValues()  const {return fIndexValues;}
0061    virtual Long64_t      *GetIndexValuesMinor()  const;
0062    const char            *GetMajorName()    const override {return fMajorName.Data();}
0063    const char            *GetMinorName()    const override {return fMinorName.Data();}
0064    Long64_t               GetN()            const override {return fN;}
0065    virtual TTreeFormula  *GetMajorFormula();
0066    virtual TTreeFormula  *GetMinorFormula();
0067    bool           IsValidFor(const TTree *parent) override;
0068    void           Print(Option_t *option="") const override;
0069    void           UpdateFormulaLeaves(const TTree *parent) override;
0070    void           SetTree(TTree *T) override;
0071    TObject *Clone(const char *newname = "") const override;
0072 
0073    ClassDefOverride(TTreeIndex,2);  //A Tree Index with majorname and minorname.
0074 };
0075 
0076 #endif
0077