Hi, I’m having a problem using a TEventList in my macro, but the same code works fine if I type it in to CINT one line at a time!
I’m using ROOT v 3.10/02, the following code is a file “mymacros.C” that I load using .L mymacros.C… Then I execute the routine using twotracks();
void twotracks() {
// Connect file generated by BaBar beta code
TFile f(“babar-data-4.root”);
ntp1->Draw(">>mylist",only2trks);
int nevt = mylist->GetN();
cout << “nevt = " << nevt << " with nphotons=nneutrals=0” << endl;
TEventList evlist = (TEventList)gDirectory->Get(“myList”);
ntp1->SetEventList(evlist); // now only scanning output list from cut above?
ntp1->Draw(“evt_pt_lab”);
}
The output histogram produced still has all events, without the cut!
Does anyone know why this would happen?