00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "TEveTreeTools.h"
00018 #include "TTree.h"
00019 #include "TTreeFormula.h"
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 ClassImp(TEveSelectorToEventList)
00032
00033
00034 TEveSelectorToEventList::TEveSelectorToEventList(TEventList* evl, const char* sel) :
00035 TSelectorDraw(), fEvList(evl)
00036 {
00037
00038
00039 fInput.Add(new TNamed("varexp", ""));
00040 fInput.Add(new TNamed("selection", sel));
00041 SetInputList(&fInput);
00042 }
00043
00044
00045 Bool_t TEveSelectorToEventList::Process(Long64_t entry)
00046 {
00047
00048
00049 if(GetSelect()->EvalInstance(0) != 0)
00050 fEvList->Enter(entry);
00051 return kTRUE;
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 ClassImp(TEvePointSelector)
00065 ClassImp(TEvePointSelectorConsumer)
00066
00067
00068 TEvePointSelector::TEvePointSelector(TTree* t,
00069 TEvePointSelectorConsumer* c,
00070 const char* vexp, const char* sel) :
00071 TSelectorDraw(),
00072
00073 fTree (t),
00074 fConsumer (c),
00075 fVarexp (vexp),
00076 fSelection (sel),
00077 fSubIdExp (),
00078 fSubIdNum (0)
00079 {
00080
00081
00082 SetInputList(&fInput);
00083 }
00084
00085
00086 Long64_t TEvePointSelector::Select(const char* selection)
00087 {
00088
00089
00090 TString var(fVarexp);
00091 if (fSubIdExp.IsNull()) {
00092 fSubIdNum = 0;
00093 } else {
00094 fSubIdNum = fSubIdExp.CountChar(':') + 1;
00095 var += ":" + fSubIdExp;
00096 }
00097
00098 TString sel;
00099 if (selection != 0)
00100 sel = selection;
00101 else
00102 sel = fSelection;
00103
00104 fInput.Delete();
00105 fInput.Add(new TNamed("varexp", var.Data()));
00106 fInput.Add(new TNamed("selection", sel.Data()));
00107
00108 if (fConsumer)
00109 fConsumer->InitFill(fSubIdNum);
00110
00111
00112 if(fTree)
00113 fTree->Process(this, "goff para");
00114
00115 return fSelectedRows;
00116 }
00117
00118
00119 Long64_t TEvePointSelector::Select(TTree* t, const char* selection)
00120 {
00121
00122
00123 fTree = t;
00124 return Select(selection);
00125 }
00126
00127
00128 void TEvePointSelector::TakeAction()
00129 {
00130
00131
00132
00133 fSelectedRows += fNfill;
00134
00135 if (fConsumer) {
00136 fConsumer->TakeAction(this);
00137 }
00138 }