Logo ROOT  
Reference Guide
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 
45 
46 private:
47  TTreeIndex(const TTreeIndex&) = delete; // Not implemented.
48  TTreeIndex &operator=(const TTreeIndex&) = delete; // Not implemented.
49 
50 public:
51  TTreeIndex();
52  TTreeIndex(const TTree *T, const char *majorname, const char *minorname);
53  virtual ~TTreeIndex();
54  virtual void Append(const TVirtualIndex *,Bool_t delaySort = kFALSE);
55  bool ConvertOldToNew();
56  Long64_t FindValues(Long64_t major, Long64_t minor) const;
57  virtual Long64_t GetEntryNumberFriend(const TTree *parent);
58  virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const;
59  virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const;
60  virtual Long64_t *GetIndex() const {return fIndex;}
61  virtual Long64_t *GetIndexValues() const {return fIndexValues;}
62  virtual Long64_t *GetIndexValuesMinor() const;
63  const char *GetMajorName() const {return fMajorName.Data();}
64  const char *GetMinorName() const {return fMinorName.Data();}
65  virtual Long64_t GetN() const {return fN;}
66  virtual TTreeFormula *GetMajorFormula();
67  virtual TTreeFormula *GetMinorFormula();
68  virtual Bool_t IsValidFor(const TTree *parent);
69  virtual void Print(Option_t *option="") const;
70  virtual void UpdateFormulaLeaves(const TTree *parent);
71  virtual void SetTree(const TTree *T);
72 
73  ClassDef(TTreeIndex,2); //A Tree Index with majorname and minorname.
74 };
75 
76 #endif
77 
TTreeIndex::Print
virtual void Print(Option_t *option="") const
Print the table with : serial number, majorname, minorname.
Definition: TTreeIndex.cxx:518
TTreeIndex::FindValues
Long64_t FindValues(Long64_t major, Long64_t minor) const
find position where major|minor values are in the IndexValues tables this is the index in IndexValues...
Definition: TTreeIndex.cxx:357
TVirtualIndex
Definition: TVirtualIndex.h:30
TString::Data
const char * Data() const
Definition: TString.h:369
TTreeIndex::GetEntryNumberWithBestIndex
virtual Long64_t GetEntryNumberWithBestIndex(Long64_t major, Long64_t minor) const
Return entry number corresponding to major and minor number.
Definition: TTreeIndex.cxx:392
TTreeIndex::GetMajorFormulaParent
TTreeFormula * GetMajorFormulaParent(const TTree *parent)
Pointer to minor TreeFormula in Parent tree (if any)
Definition: TTreeIndex.cxx:464
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TTree
Definition: TTree.h:79
TTreeIndex::GetIndexValues
virtual Long64_t * GetIndexValues() const
Definition: TTreeIndex.h:61
TTreeIndex::TTreeIndex
TTreeIndex()
Default constructor for TTreeIndex.
Definition: TTreeIndex.cxx:49
TTreeIndex::~TTreeIndex
virtual ~TTreeIndex()
Destructor.
Definition: TTreeIndex.cxx:202
TString
Definition: TString.h:136
TTreeIndex::SetTree
virtual void SetTree(const TTree *T)
this function is called by TChain::LoadTree and TTreePlayer::UpdateFormulaLeaves when a new Tree is l...
Definition: TTreeIndex.cxx:614
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TTreeIndex::GetMinorFormula
virtual TTreeFormula * GetMinorFormula()
Return a pointer to the TreeFormula corresponding to the minorname.
Definition: TTreeIndex.cxx:452
TTreeIndex::Append
virtual void Append(const TVirtualIndex *, Bool_t delaySort=kFALSE)
Append 'add' to this index.
Definition: TTreeIndex.cxx:219
TTreeIndex::fMajorFormula
TTreeFormula * fMajorFormula
Definition: TTreeIndex.h:38
bool
TTreeIndex::ConvertOldToNew
bool ConvertOldToNew()
conversion from old 64bit indexes return true if index was converted
Definition: TTreeIndex.cxx:300
TTreeIndex::operator=
TTreeIndex & operator=(const TTreeIndex &)=delete
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TTreeIndex::fIndexValues
Long64_t * fIndexValues
Definition: TTreeIndex.h:35
TTreeIndex::GetN
virtual Long64_t GetN() const
Definition: TTreeIndex.h:65
TTreeIndex::fIndexValuesMinor
Long64_t * fIndexValuesMinor
Definition: TTreeIndex.h:36
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TTreeIndex::GetEntryNumberWithIndex
virtual Long64_t GetEntryNumberWithIndex(Long64_t major, Long64_t minor) const
Return entry number corresponding to major and minor number.
Definition: TTreeIndex.cxx:417
TTreeIndex::GetMinorName
const char * GetMinorName() const
Definition: TTreeIndex.h:64
TVirtualIndex.h
TTreeFormula
Definition: TTreeFormula.h:58
TTreeIndex::fMajorName
TString fMajorName
Definition: TTreeIndex.h:32
TTreeIndex::UpdateFormulaLeaves
virtual void UpdateFormulaLeaves(const TTree *parent)
Called by TChain::LoadTree when the parent chain changes it's tree.
Definition: TTreeIndex.cxx:595
TTreeIndex::fMinorFormula
TTreeFormula * fMinorFormula
Pointer to major TreeFormula.
Definition: TTreeIndex.h:39
TTreeIndex::fMinorName
TString fMinorName
Definition: TTreeIndex.h:33
TTreeIndex
Definition: TTreeIndex.h:29
TTreeIndex::IsValidFor
virtual Bool_t IsValidFor(const TTree *parent)
Return kTRUE if index can be applied to the TTree.
Definition: TTreeIndex.cxx:502
TTreeIndex::GetMinorFormulaParent
TTreeFormula * GetMinorFormulaParent(const TTree *parent)
Return a pointer to the TreeFormula corresponding to the minorname in parent tree.
Definition: TTreeIndex.cxx:483
TTreeIndex::fMajorFormulaParent
TTreeFormula * fMajorFormulaParent
Pointer to minor TreeFormula.
Definition: TTreeIndex.h:40
TTreeIndex::GetMajorName
const char * GetMajorName() const
Definition: TTreeIndex.h:63
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
ROOT::Math::Chebyshev::T
double T(double x)
Definition: ChebyshevPol.h:52
TTreeIndex::GetIndex
virtual Long64_t * GetIndex() const
Definition: TTreeIndex.h:60
TTreeIndex::fIndex
Long64_t * fIndex
Definition: TTreeIndex.h:37
TTreeIndex::GetEntryNumberFriend
virtual Long64_t GetEntryNumberFriend(const TTree *parent)
Returns the entry number in this (friend) Tree corresponding to entry in the master Tree 'parent'.
Definition: TTreeIndex.cxx:322
TTreeIndex::fN
Long64_t fN
Definition: TTreeIndex.h:34
TTreeIndex::GetIndexValuesMinor
virtual Long64_t * GetIndexValuesMinor() const
Definition: TTreeIndex.cxx:430
TTreeIndex::fMinorFormulaParent
TTreeFormula * fMinorFormulaParent
Pointer to major TreeFormula in Parent tree (if any)
Definition: TTreeIndex.h:41
TTreeIndex::GetMajorFormula
virtual TTreeFormula * GetMajorFormula()
Return a pointer to the TreeFormula corresponding to the majorname.
Definition: TTreeIndex.cxx:440