I make a TEventList like this:
TEventList *elist = new TEventList(Form("elist_it"));
I then set the event list like:
ch is a previously defined TChain. I need to unset this after I am through with it so that I can essentially repeat the above for a new cut.c_str(). This should be simple, but I can’t remember how to do it and for the life of me I can’t find the answer online.
I’ve tried doing:
But that doesn’t seem to work correctly.
ch->SetEventList(0);This is supposed to be the right call. How does it fail for you?
I think this issue was actually related to trying to use a TEntryList on a TChain (see [url]TEntryList and TChain
When I retry this simply as stated above, I get the expected behaviour. However, when I use the TEventList to make the TChain return a TEntryList, strangeness happens. Basically, the cut is only properly applied to the first file in the chain.
I think I was mistaking this for failure of the reset of the TEventList. I’d like to be concrete about this and write exactly what happened here, but I don’t think I’ll have time.
Anyway, I now use a TEventList and loop through the original TChain by doing:
where “elist” is the TEventList and “count” is the iteration. I then reset the TEventList in the standard way, and it works.
I am not sure if this is actually the most efficient way to loop through the tree, and I am concerned about that because my data set is somewhat large. I do have some experience instead writing an implementation of a TSelector and running through TChain::Process (like example $ROOTSYS/tutorials/hist/h1Analysis), but I don’t know if this is likely to be faster.
I would appreciate any comments on the speed issues I just mentioned.
However, when I use the TEventList to make the TChain return a TEntryList, strangeness happens.
I am not sure what that means? [i.e apriori I don’t see a reason to mix TEventList (the older implementation) and TEntryList (The newer more efficient implementation).