Re: Using TEventList

Rene Brun (Rene.Brun@cern.ch)
Mon, 01 Jun 1998 10:44:13 +0200


Scott Sampson wrote:
>
> Hi,
>
> I'm having trouble using TEventList. I try the following on a TTree h1:
>
> TCut acut "Pt>25";
> TEventList *nlist = (TEventList *)h1->Select(acut);
> nlist->Print();
> Error: illegal pointer to class object nlist 0x0 258 . . .
>
> could you give an example of how to get an EventList from a Tree? In the
> end I want to print out some variables (e.g. run number) for the events
> which pass the cut TCut. Thanks,
>

Scott,
The TTree::Select function is currently dummy. Sorry, I should have put
a warning message inside. I will try to code it for the coming release.
Meanwhile you can use the TEventList class directly:
- Create a TEventList object
- Loop yourself on the entries of the Tree.
- For each entry satisfying your cut, add the entry in the eventlist.
- Save the list on a file (eventlist->Write();)

In an another session, you can loop on the entries in the event list
and invoke TTRee::GetEvent for the corresponding entries.
I hope to have all this sequence becoming automatic.

Rene Brun