TEventList not effective in Loop generated by MakeClass

Hi,

My program below doesn’t seem to pick up the right sequence of events defined by TEventList:

NN.h, NN.C are produced by tree->MakeClass(). I expect that after

chain->SetEventList(test_list);

t->Loop() will run on the chain that’s defined by test_list. However, it still go through the entilre chain. A bit more information:

test_list->Print();

does tell me that the list has the correct number of entries.

Could anyone help? Thanks.

John

============================
void ana_NN()
{
gROOT->Time();
gSystem->CompileMacro(“NN.C”,“kO”);
TChain *chain = new TChain(“NN”);

NN *t = new NN(chain);

 chain->Add("nn_Higgs_m120.root");
 chain->Draw(">>test","Entry$%2==1");

TEventList *test_list = (TEventList *)gDirectory->Get("test");
chain->SetEventList(test_list);
test_list->Print();

t->Loop();

}

Hi

In your Loop method you have something like

fChain->LoadEntry(entry);which explicitly ignores the event list.
Instead of a MakeClass you should consider using the skeleton creted by MakeSelector or MakeProxy. Alternatively you might be able to modify Loop to use:Long64_t realEntry = fChain->GetEntryNumber(entry); fChain->LoadEntry(realEntry);

Cheers,
Philippe.