Cycle Number from CopyTree

Hello,

I have a skimming tool where I do:

TTree* selectEvents = allEvents->CopyTree(selection.c_str());
selectEvents->Write();

I’ve noticed that with original root files with large numbers of events I seem to get more than one event tree in the output file, which the manual says are “cycles” (not sure really what this means). It says they are just two things with the same name, but I don’t know why I should get more than one tree. This only happens when my input file gets over a certain number of events (between 300k and 400k).

Looking in them, the “Event;1” seems to have some selection of events → fine (~3% skim). “Event;2” however has the same events plus ~50% more.

  • Is this normal?
  • When I do tree->Get(“Event”) without an explicit cycle number in further analysis will it give me duplicate events or just the 2nd one with all the events?
  • Why are there 2 Event trees?

From 500k events in a file: “Event;1” : 15879 events. “Event;2” : 23632 events.
From 200k events in a file: 9544 events (expect ratio to be the same).

Happens consistently on EL9 / LCG_104c ROOT, local MacOS 13.6 / clang 15.0 / ROOT 31.01.

Many thanks,
Laurie

Is this normal?

Yes.

When I do tree->Get(“Event”) without an explicit cycle number in further analysis will it give me duplicate events or just the 2nd one with all the events?

No duplicates. Just the 2nd one with all the events.

Why are there 2 Event trees?

It is a backup copy of the tree meta-data that can be used to retrieve partial data is the writing job crashes after writing the first/previous copy and writing the second/last copy (i.e. you then lose only the data written after the first/previous copy).

Ok, understood. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.