Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <vector>
27
28class TTreeFormula;
30class TH1;
31class TEntryListArray;
32
33class TSelectorDraw : public TSelector {
34
35protected:
36 enum EStatusBits { kWarn = BIT(12) };
37
38 TTree *fTree; // Pointer to current Tree
39 TTreeFormula **fVar; //![fDimension] Array of pointers to variables formula
40 TTreeFormula *fSelect; // Pointer to selection formula
41 TTreeFormulaManager *fManager; // Pointer to the formula manager
42 TObject *fTreeElist; // pointer to Tree Event list
43 TEntryListArray *fTreeElistArray; //! pointer to Tree Event list array
44 TH1 *fOldHistogram; //! Pointer to previously used histogram
45 Int_t fAction; //! Action type
46 Long64_t fDraw; //! Last entry loop number when object was drawn
47 Int_t fNfill; //! Total number of histogram fills
48 Int_t fMultiplicity; // Indicator of the variability of the size of entries
49 Int_t fDimension; // Dimension of the current expression
50 Long64_t fSelectedRows; // Number of selected entries
51 Long64_t fOldEstimate; // value of Tree fEstimate when selector is called
52 Int_t fForceRead; // Force Read flag
53 Int_t *fNbins; //![fDimension] Number of bins per dimension
54 Double_t *fVmin; //![fDimension] Minima of varexp columns
55 Double_t *fVmax; //![fDimension] Maxima of varexp columns
56 Double_t fWeight; // Tree weight (see TTree::SetWeight)
57 Double_t **fVal; //![fSelectedRows][fDimension] Local buffer for the variables
59 Double_t *fW; //![fSelectedRows]Local buffer for weights
60 Bool_t *fVarMultiple; //![fDimension] true if fVar[i] has a variable index
61 Bool_t fSelectMultiple; // true if selection has a variable index
62 Bool_t fCleanElist; // true if original Tree elist must be saved
63 Bool_t fObjEval; // true if fVar1 returns an object (or pointer to).
64 Long64_t fCurrentSubEntry; // Current subentry when fSelectMultiple is true. Used to fill TEntryListArray
65
66protected:
67 virtual void ClearFormula();
68 virtual Bool_t CompileVariables(const char *varexp="", const char *selection="");
69 virtual void InitArrays(Int_t newsize);
70
71private:
72 TSelectorDraw(const TSelectorDraw&); // not implemented
73 TSelectorDraw& operator=(const TSelectorDraw&); // not implemented
74
75public:
77 virtual ~TSelectorDraw();
78
79 virtual void Begin(TTree *tree);
80 virtual Int_t GetAction() const {return fAction;}
81 virtual Bool_t GetCleanElist() const {return fCleanElist;}
82 virtual Int_t GetDimension() const {return fDimension;}
83 virtual Long64_t GetDrawFlag() const {return fDraw;}
84 TObject *GetObject() const {return fObject;}
86 virtual Int_t GetNfill() const {return fNfill;}
88 TTreeFormula *GetSelect() const {return fSelect;}
89 virtual Long64_t GetSelectedRows() const {return fSelectedRows;}
90 TTree *GetTree() const {return fTree;}
91 TTreeFormula *GetVar(Int_t i) const;
92 // See TSelectorDraw::GetVar
93 TTreeFormula *GetVar1() const {return GetVar(0);}
94 // See TSelectorDraw::GetVar
95 TTreeFormula *GetVar2() const {return GetVar(1);}
96 // See TSelectorDraw::GetVar
97 TTreeFormula *GetVar3() const {return GetVar(2);}
98 // See TSelectorDraw::GetVar
99 TTreeFormula *GetVar4() const {return GetVar(3);}
100 virtual Double_t *GetVal(Int_t i) const;
101 // See TSelectorDraw::GetVal
102 virtual Double_t *GetV1() const {return GetVal(0);}
103 // See TSelectorDraw::GetVal
104 virtual Double_t *GetV2() const {return GetVal(1);}
105 // See TSelectorDraw::GetVal
106 virtual Double_t *GetV3() const {return GetVal(2);}
107 // See TSelectorDraw::GetVal
108 virtual Double_t *GetV4() const {return GetVal(3);}
109 virtual Double_t *GetW() const {return fW;}
110 virtual Bool_t Notify();
111 virtual Bool_t Process(Long64_t /*entry*/) { return kFALSE; }
112 virtual void ProcessFill(Long64_t entry);
113 virtual void ProcessFillMultiple(Long64_t entry);
114 virtual void ProcessFillObject(Long64_t entry);
115 virtual void SetEstimate(Long64_t n);
116 virtual UInt_t SplitNames(const TString &varexp, std::vector<TString> &names);
117 virtual void TakeAction();
118 virtual void TakeEstimate();
119 virtual void Terminate();
120
121 ClassDef(TSelectorDraw,1); //A specialized TSelector for TTree::Draw
122};
123
124#endif
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
const Bool_t kFALSE
Definition RtypesCore.h:92
bool Bool_t
Definition RtypesCore.h:63
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:73
#define ClassDef(name, id)
Definition Rtypes.h:325
#define BIT(n)
Definition Rtypes.h:85
A list of entries and subentries in a TTree or TChain.
TH1 is the base class of all histogram classes in ROOT.
Definition TH1.h:58
Mother of all ROOT objects.
Definition TObject.h:37
A specialized TSelector for TTree::Draw.
TEntryListArray * fTreeElistArray
virtual void SetEstimate(Long64_t n)
Set number of entries to estimate variable limits.
virtual void InitArrays(Int_t newsize)
Initialization of the primitive type arrays if the new size is bigger than the available space.
virtual Double_t * GetW() const
Int_t fAction
Pointer to previously used histogram.
Int_t GetMultiplicity() const
TTreeFormulaManager * fManager
TTreeFormula * GetSelect() const
TTreeFormula * GetVar(Int_t i) const
Return the TTreeFormula corresponding to the i-th component of the request formula (where the compone...
Bool_t * fVarMultiple
[fSelectedRows]Local buffer for weights
virtual Bool_t CompileVariables(const char *varexp="", const char *selection="")
Compile input variables and selection expression.
virtual Double_t * GetV4() const
TTreeFormula * GetVar3() const
TSelectorDraw & operator=(const TSelectorDraw &)
virtual Long64_t GetDrawFlag() const
TSelectorDraw()
Default selector constructor.
Double_t * fW
virtual void Terminate()
Called at the end of a loop on a TTree.
TH1 * GetOldHistogram() const
virtual Long64_t GetSelectedRows() const
virtual UInt_t SplitNames(const TString &varexp, std::vector< TString > &names)
Build Index array for names in varexp.
Long64_t fCurrentSubEntry
TTreeFormula * fSelect
[fDimension] Array of pointers to variables formula
TSelectorDraw(const TSelectorDraw &)
Long64_t fSelectedRows
virtual void ClearFormula()
Delete internal buffers.
virtual ~TSelectorDraw()
Selector destructor.
virtual void TakeAction()
Execute action for object obj fNfill times.
TObject * GetObject() const
virtual Double_t * GetV2() const
Long64_t fOldEstimate
Double_t fWeight
[fDimension] Maxima of varexp columns
Int_t fNfill
Last entry loop number when object was drawn.
virtual Bool_t GetCleanElist() const
virtual void ProcessFill(Long64_t entry)
Called in the entry loop for all entries accepted by Select.
TH1 * fOldHistogram
pointer to Tree Event list array
TTreeFormula * GetVar2() const
virtual Int_t GetAction() const
Double_t * fVmax
[fDimension] Minima of varexp columns
TTreeFormula * GetVar1() const
Int_t fMultiplicity
Total number of histogram fills.
TTreeFormula ** fVar
virtual void ProcessFillMultiple(Long64_t entry)
Called in the entry loop for all entries accepted by Select.
TTreeFormula * GetVar4() const
virtual Double_t * GetV1() const
virtual Bool_t Process(Long64_t)
virtual Int_t GetDimension() const
TObject * fTreeElist
virtual Double_t * GetVal(Int_t i) const
Return the last values corresponding to the i-th component of the formula being processed (where the ...
virtual Double_t * GetV3() const
Double_t ** fVal
Long64_t fDraw
Action type.
Bool_t fSelectMultiple
[fDimension] true if fVar[i] has a variable index
TTree * GetTree() const
Int_t fValSize
[fSelectedRows][fDimension] Local buffer for the variables
virtual void TakeEstimate()
Estimate limits for 1-D, 2-D or 3-D objects.
virtual Int_t GetNfill() const
virtual void ProcessFillObject(Long64_t entry)
Called in the entry loop for all entries accepted by Select.
Double_t * fVmin
[fDimension] Number of bins per dimension
virtual void Begin(TTree *tree)
Called every time a loop on the tree(s) starts.
virtual Bool_t Notify()
This function is called at the first entry of a new tree in a chain.
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
Definition TSelector.h:31
TObject * fObject
! Current object if processing object (vs. TTree)
Definition TSelector.h:40
Basic string class.
Definition TString.h:136
Used to coordinate one or more TTreeFormula objects.
Used to pass a selection expression to the Tree drawing routine.
A TTree represents a columnar dataset.
Definition TTree.h:79
const Int_t n
Definition legend1.C:16
Definition tree.py:1