3 //__________________________________________________________________________
6 // Collection of classes for TTree interaction.
8 #include "TTreeTools.h"
10 #include <TTreeFormula.h>
12 /**************************************************************************/
13 /**************************************************************************/
15 ClassImp(TSelectorToEventList)
17 TSelectorToEventList::TSelectorToEventList(TEventList* evl, const Text_t* sel) :
18 TSelectorDraw(), fEvList(evl)
20 fInput.Add(new TNamed("varexp", ""));
21 fInput.Add(new TNamed("selection", sel));
22 SetInputList(&fInput);
25 Bool_t TSelectorToEventList::Process(Long64_t entry)
27 if(GetSelect()->EvalInstance(0) != 0)
28 fEvList->Enter(entry);
32 /**************************************************************************/
33 /**************************************************************************/
37 Int_t TTreeQuery::Select(TTree* t, const Text_t* selection)
39 TSelectorToEventList sel(this, selection);
40 t->Process(&sel, "goff");
44 /**************************************************************************/
45 // TPointSelectorConsumer, TPointSelector
46 /**************************************************************************/
48 ClassImp(TPointSelectorConsumer)
49 ClassImp(TPointSelector)
51 TPointSelector::TPointSelector(TTree* t,
52 TPointSelectorConsumer* c,
53 const Text_t* vexp, const Text_t* sel) :
63 SetInputList(&fInput);
66 Long64_t TPointSelector::Select(const Text_t* selection)
69 if (fSubIdExp.IsNull()) {
72 fSubIdNum = fSubIdExp.CountChar(':') + 1;
73 var += ":" + fSubIdExp;
83 fInput.Add(new TNamed("varexp", var.Data()));
84 fInput.Add(new TNamed("selection", sel.Data()));
87 fConsumer->InitFill(fSubIdNum);
89 // 'para' option -> hack allowing arbitrary dimensions.
91 fTree->Process(this, "goff para");
96 Long64_t TPointSelector::Select(TTree* t, const Text_t* selection)
99 return Select(selection);
102 void TPointSelector::TakeAction()
104 fSelectedRows += fNfill;
105 // printf("TPointSelector::TakeAction nfill=%d, nall=%lld\n", fNfill, fSelectedRows);
107 fConsumer->TakeAction(this);