[ROOT] TTree event selection

From: Mike Carson (M.J.Carson@sheffield.ac.uk)
Date: Tue Feb 24 2004 - 11:58:22 MET

Dear Rooters,

I've got two TTrees, tree1 and tree2, with the same variable list 
(EventNum X Y Z). I'd like to select those events in tree2 which have the 
same EventNum as the events in tree1. I can do this with a couple of for 
loops but it takes too long. I also tried this:

Int_t numberOfEvents = tree1->GetEntries(); 
Char_t myString[20];

for (Int_t i=0; i<numberOfEvents; i++) {
 sprintf(myString,"\"EventNum == %d \"",EventNum);

but that didn't work. I tried a similar thing with a TCut object instead 
of myString...didn't work either. Any ideas?

I'm using root version 3.10/02, gcc 3.2.2, RH9.0. 

Many thanks,

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET