]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Reve/TTreeTools.h
Merge from EVE-dev to HEAD.
[u/mrichter/AliRoot.git] / EVE / Reve / TTreeTools.h
CommitLineData
5a5a1232 1// $Header
2
3#ifndef REVE_TTreeTools_H
4#define REVE_TTreeTools_H
5
6#include <TSelectorDraw.h>
7#include <TEventList.h>
8
9/**************************************************************************/
10// TSelectorToEventList
11/**************************************************************************/
12
13class TSelectorToEventList : public TSelectorDraw
14{
265ecb21 15 TSelectorToEventList(const TSelectorToEventList&); // Not implemented
16 TSelectorToEventList& operator=(const TSelectorToEventList&); // Not implemented
17
5a5a1232 18protected:
19 TEventList* fEvList;
20 TList fInput;
21public:
22 TSelectorToEventList(TEventList* evl, const Text_t* sel);
23
9ce3a7e7 24 virtual Int_t Version() const { return 1; }
5a5a1232 25 virtual Bool_t Process(Long64_t entry);
5a5a1232 26
27 ClassDef(TSelectorToEventList, 1)
28};
29
30/**************************************************************************/
31// TTreeQuery
32/**************************************************************************/
33
34class TTreeQuery : public TEventList
35{
36public:
37 TTreeQuery() : TEventList() {}
38
39 Int_t Select(TTree* t, const Text_t* selection);
40
41 ClassDef(TTreeQuery, 1)
42};
43
9ce3a7e7 44/**************************************************************************/
45// TPointSelectorConsumer, TPointSelector
46/**************************************************************************/
47
48class TPointSelector;
49
50class TPointSelectorConsumer
51{
52public:
53 enum TreeVarType_e { TVT_XYZ, TVT_RPhiZ };
54
55protected:
56 TreeVarType_e fSourceCS;
57
58public:
59 TPointSelectorConsumer(TreeVarType_e cs=TVT_XYZ) :fSourceCS(cs) {}
60 virtual ~TPointSelectorConsumer() {}
61
62 virtual void TakeAction(TSelectorDraw*) = 0;
63
64 TreeVarType_e GetSourceCS() const { return fSourceCS; }
65 void SetSourceCS(TreeVarType_e cs) { fSourceCS = cs; }
66
67 ClassDef(TPointSelectorConsumer, 1);
68};
69
70class TPointSelector : public TSelectorDraw
71{
265ecb21 72 TPointSelector(const TPointSelector&); // Not implemented
73 TPointSelector& operator=(const TPointSelector&); // Not implemented
74
9ce3a7e7 75protected:
76 TTree *fTree;
77 TPointSelectorConsumer *fConsumer;
78
79 TString fVarexp;
80 TString fSelection;
81
82 TList fInput;
83
84public:
85 TPointSelector(TTree* t=0, TPointSelectorConsumer* c=0,
86 const Text_t* vexp="", const Text_t* sel="");
87 virtual ~TPointSelector() {}
88
89 virtual Long64_t Select(const Text_t* selection=0);
90 virtual Long64_t Select(TTree* t, const Text_t* selection=0);
91 virtual void TakeAction();
92
93
94 TTree* GetTree() const { return fTree; }
95 void SetTree(TTree* t) { fTree = t; }
96
97 TPointSelectorConsumer* GetConsumer() const { return fConsumer; }
98 void SetConsumer(TPointSelectorConsumer* c) { fConsumer = c; }
99
100 const Text_t* GetVarexp() const { return fVarexp; }
101 void SetVarexp(const Text_t* v) { fVarexp = v; }
102
103 const Text_t* GetSelection() const { return fSelection; }
104 void SetSelection(const Text_t* s) { fSelection = s; }
105
106 ClassDef(TPointSelector, 1);
107};
108
5a5a1232 109/**************************************************************************/
110/**************************************************************************/
111
112#endif