Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TTreeIndex.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Rene Brun 05/07/2004
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TTreeIndex
13 #define ROOT_TTreeIndex
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TTreeIndex //
19 // //
20 // A Tree Index with majorname and minorname. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 
25 #include "TVirtualIndex.h"
26 
27 class TTreeFormula;
28 
29 class TTreeIndex : public TVirtualIndex {
30 
31 protected:
32  TString fMajorName; // Index major name
33  TString fMinorName; // Index minor name
34  Long64_t fN; // Number of entries
35  Long64_t *fIndexValues; //[fN] Sorted index values, higher 64bits
36  Long64_t *fIndexValuesMinor; //[fN] Sorted index values, lower 64bits
37  Long64_t *fIndex; //[fN] Index of sorted values
38  TTreeFormula *fMajorFormula; //! Pointer to major TreeFormula
39  TTreeFormula *fMinorFormula; //! Pointer to minor TreeFormula
40  TTreeFormula *fMajorFormulaParent; //! Pointer to major TreeFormula in Parent tree (if any)
41  TTreeFormula *fMinorFormulaParent; //! Pointer to minor TreeFormula in Parent tree (if any)
42 
43 private:
44  TTreeIndex(const TTreeIndex&) = delete; // Not implemented.
45  TTreeIndex &operator=(const TTreeIndex&) = delete; // Not implemented.
46 
47 public:
48  TTreeIndex();
49  TTreeIndex(const TTree *T, const char *majorname, const char *minorname);
50  virtual ~TTreeIndex();
51  virtual void Append(const TVirtualIndex *,Bool_t delaySort = kFALSE);
52  bool ConvertOldToNew();
53  Long64_t FindValues(Long64_t major, Long64_t minor) const;
54  virtual Long64_t GetEntryNumberFriend(const TTree *parent);
55  virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const;
56  virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const;
57  virtual Long64_t *GetIndex() const {return fIndex;}
58  virtual Long64_t *GetIndexValues() const {return fIndexValues;}
59  virtual Long64_t *GetIndexValuesMinor() const;
60  const char *GetMajorName() const {return fMajorName.Data();}
61  const char *GetMinorName() const {return fMinorName.Data();}
62  virtual Long64_t GetN() const {return fN;}
63  virtual TTreeFormula *GetMajorFormula();
64  virtual TTreeFormula *GetMinorFormula();
65  virtual TTreeFormula *GetMajorFormulaParent(const TTree *parent);
66  virtual TTreeFormula *GetMinorFormulaParent(const TTree *parent);
67  virtual Bool_t IsValidFor(const TTree *parent);
68  virtual void Print(Option_t *option="") const;
69  virtual void UpdateFormulaLeaves(const TTree *parent);
70  virtual void SetTree(const TTree *T);
71 
72  ClassDef(TTreeIndex,2); //A Tree Index with majorname and minorname.
73 };
74 
75 #endif
76