Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TSelectorDraw.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Rene Brun 08/01/2003
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TSelectorDraw
13 #define ROOT_TSelectorDraw
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TSelectorDraw //
19 // //
20 // A specialized TSelector for TTree::Draw. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TSelector.h"
25 
26 class TTreeFormula;
27 class TTreeFormulaManager;
28 class TH1;
29 class TEntryListArray;
30 
31 class TSelectorDraw : public TSelector {
32 
33 protected:
34  enum EStatusBits { kWarn = BIT(12) };
35 
36  TTree *fTree; // Pointer to current Tree
37  TTreeFormula **fVar; //![fDimension] Array of pointers to variables formula
38  TTreeFormula *fSelect; // Pointer to selection formula
39  TTreeFormulaManager *fManager; // Pointer to the formula manager
40  TObject *fTreeElist; // pointer to Tree Event list
41  TEntryListArray *fTreeElistArray; //! pointer to Tree Event list array
42  TH1 *fOldHistogram; //! Pointer to previously used histogram
43  Int_t fAction; //! Action type
44  Long64_t fDraw; //! Last entry loop number when object was drawn
45  Int_t fNfill; //! Total number of histogram fills
46  Int_t fMultiplicity; // Indicator of the variability of the size of entries
47  Int_t fDimension; // Dimension of the current expression
48  Long64_t fSelectedRows; // Number of selected entries
49  Long64_t fOldEstimate; // value of Tree fEstimate when selector is called
50  Int_t fForceRead; // Force Read flag
51  Int_t *fNbins; //![fDimension] Number of bins per dimension
52  Double_t *fVmin; //![fDimension] Minima of varexp columns
53  Double_t *fVmax; //![fDimension] Maxima of varexp columns
54  Double_t fWeight; // Tree weight (see TTree::SetWeight)
55  Double_t **fVal; //![fSelectedRows][fDimension] Local buffer for the variables
56  Int_t fValSize;
57  Double_t *fW; //![fSelectedRows]Local buffer for weights
58  Bool_t *fVarMultiple; //![fDimension] true if fVar[i] has a variable index
59  Bool_t fSelectMultiple; // true if selection has a variable index
60  Bool_t fCleanElist; // true if original Tree elist must be saved
61  Bool_t fObjEval; // true if fVar1 returns an object (or pointer to).
62  Long64_t fCurrentSubEntry; // Current subentry when fSelectMultiple is true. Used to fill TEntryListArray
63 
64 protected:
65  virtual void ClearFormula();
66  virtual Bool_t CompileVariables(const char *varexp="", const char *selection="");
67  virtual void InitArrays(Int_t newsize);
68 
69 private:
70  TSelectorDraw(const TSelectorDraw&); // not implemented
71  TSelectorDraw& operator=(const TSelectorDraw&); // not implemented
72 
73 public:
74  TSelectorDraw();
75  virtual ~TSelectorDraw();
76 
77  virtual void Begin(TTree *tree);
78  virtual Int_t GetAction() const {return fAction;}
79  virtual Bool_t GetCleanElist() const {return fCleanElist;}
80  virtual Int_t GetDimension() const {return fDimension;}
81  virtual Long64_t GetDrawFlag() const {return fDraw;}
82  TObject *GetObject() const {return fObject;}
83  Int_t GetMultiplicity() const {return fMultiplicity;}
84  virtual Int_t GetNfill() const {return fNfill;}
85  TH1 *GetOldHistogram() const {return fOldHistogram;}
86  TTreeFormula *GetSelect() const {return fSelect;}
87  virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
88  TTree *GetTree() const {return fTree;}
89  TTreeFormula *GetVar(Int_t i) const;
90  // See TSelectorDraw::GetVar
91  TTreeFormula *GetVar1() const {return GetVar(0);}
92  // See TSelectorDraw::GetVar
93  TTreeFormula *GetVar2() const {return GetVar(1);}
94  // See TSelectorDraw::GetVar
95  TTreeFormula *GetVar3() const {return GetVar(2);}
96  // See TSelectorDraw::GetVar
97  TTreeFormula *GetVar4() const {return GetVar(3);}
98  virtual Double_t *GetVal(Int_t i) const;
99  // See TSelectorDraw::GetVal
100  virtual Double_t *GetV1() const {return GetVal(0);}
101  // See TSelectorDraw::GetVal
102  virtual Double_t *GetV2() const {return GetVal(1);}
103  // See TSelectorDraw::GetVal
104  virtual Double_t *GetV3() const {return GetVal(2);}
105  // See TSelectorDraw::GetVal
106  virtual Double_t *GetV4() const {return GetVal(3);}
107  virtual Double_t *GetW() const {return fW;}
108  virtual Bool_t Notify();
109  virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
110  virtual void ProcessFill(Long64_t entry);
111  virtual void ProcessFillMultiple(Long64_t entry);
112  virtual void ProcessFillObject(Long64_t entry);
113  virtual void SetEstimate(Long64_t n);
114  virtual UInt_t SplitNames(const TString &varexp, std::vector<TString> &names);
115  virtual void TakeAction();
116  virtual void TakeEstimate();
117  virtual void Terminate();
118 
119  ClassDef(TSelectorDraw,1); //A specialized TSelector for TTree::Draw
120 };
121 
122 #endif