Creating TEventList by comparing values from 2 root files


I have 2 root files which have a branch called “eventLabel”.
When 2 root files have the same entries (made it so) all the time, I want to make a TEventList of when “eventLabel” of the same entry, i, is the same label in both files.

When I tried to do the following routine, it crashes.

     TEventList *eventList;

     for(int i=0; i<4000; i++){

          cout << i << "  " << friend_eventLabel_dc1 << "  " << friend_eventLabel_dc2 << endl;

          if((friend_eventLabel_dc1 ==0) && (friend_eventLabel_dc2 ==0)){
               cout << "******* " << i << "************" << endl;

Is it possible to make a such TEventList? any advice or suggestions would be greatly appreciated.

Please read tips for efficient and successful posting and posting code

ROOT Version: 6.24.02
Platform: mac 11.2.3
Compiler: Not Provided

Dear Satoko,

I add in the loop @pcanal who could have a suggestion on how to proceed.


You need to create the TEventList:

 TEventList *eventList = new TEventList("duplicates");
1 Like

Thank you so much!