3 #ifndef REVE_TTreeTools_H
4 #define REVE_TTreeTools_H
6 #include <TSelectorDraw.h>
7 #include <TEventList.h>
9 /**************************************************************************/
10 // TSelectorToEventList
11 /**************************************************************************/
13 class TSelectorToEventList : public TSelectorDraw
15 TSelectorToEventList(const TSelectorToEventList&); // Not implemented
16 TSelectorToEventList& operator=(const TSelectorToEventList&); // Not implemented
22 TSelectorToEventList(TEventList* evl, const Text_t* sel);
24 virtual Int_t Version() const { return 1; }
25 virtual Bool_t Process(Long64_t entry);
27 ClassDef(TSelectorToEventList, 1)
30 /**************************************************************************/
32 /**************************************************************************/
34 class TTreeQuery : public TEventList
37 TTreeQuery() : TEventList() {}
39 Int_t Select(TTree* t, const Text_t* selection);
41 ClassDef(TTreeQuery, 1)
44 /**************************************************************************/
45 // TPointSelectorConsumer, TPointSelector
46 /**************************************************************************/
50 class TPointSelectorConsumer
53 enum TreeVarType_e { TVT_XYZ, TVT_RPhiZ };
56 TreeVarType_e fSourceCS; // Coordinate-System of the source tree variables
59 TPointSelectorConsumer(TreeVarType_e cs=TVT_XYZ) :fSourceCS(cs) {}
60 virtual ~TPointSelectorConsumer() {}
62 virtual void InitFill(Int_t /*subIdNum*/) {}
63 virtual void TakeAction(TPointSelector*) = 0;
65 TreeVarType_e GetSourceCS() const { return fSourceCS; }
66 void SetSourceCS(TreeVarType_e cs) { fSourceCS = cs; }
68 ClassDef(TPointSelectorConsumer, 1);
71 class TPointSelector : public TSelectorDraw
73 TPointSelector(const TPointSelector&); // Not implemented
74 TPointSelector& operator=(const TPointSelector&); // Not implemented
78 TPointSelectorConsumer *fConsumer;
89 TPointSelector(TTree* t=0, TPointSelectorConsumer* c=0,
90 const Text_t* vexp="", const Text_t* sel="");
91 virtual ~TPointSelector() {}
93 virtual Long64_t Select(const Text_t* selection=0);
94 virtual Long64_t Select(TTree* t, const Text_t* selection=0);
95 virtual void TakeAction();
98 TTree* GetTree() const { return fTree; }
99 void SetTree(TTree* t) { fTree = t; }
101 TPointSelectorConsumer* GetConsumer() const { return fConsumer; }
102 void SetConsumer(TPointSelectorConsumer* c) { fConsumer = c; }
104 const Text_t* GetVarexp() const { return fVarexp; }
105 void SetVarexp(const Text_t* v) { fVarexp = v; }
107 const Text_t* GetSelection() const { return fSelection; }
108 void SetSelection(const Text_t* s) { fSelection = s; }
110 const Text_t* GetSubIdExp() const { return fSubIdExp; }
111 void SetSubIdExp(const Text_t* s) { fSubIdExp = s; }
113 Int_t GetSubIdNum() const { return fSubIdNum; }
115 ClassDef(TPointSelector, 1);
118 /**************************************************************************/
119 /**************************************************************************/