Example of Root macro to copy a subset of a Tree to a new Tree, selecting entries.
Only selected entries are copied to the new Tree. The input file has been generated by the program in $ROOTSYS/test/Event
with Event 1000 1 99 1
#ifdef ACTUAL_RUN
void run()
{
oldtree->SetBranchAddress(
"event_split", &event);
if (event->GetNtrack() > 605)
event->Clear();
}
}
#else
{
gROOT->ProcessLine(
".L " +
tutdir +
"/io/tree/Event.cxx+");
gROOT->ProcessLine(
"#define ACTUAL_RUN yes");
gROOT->ProcessLine(
"run()");
}
#endif
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
A TTree represents a columnar dataset.
Namespace for new ROOT classes and functions.
- Author
- Rene Brun
Definition in file tree112_copy.C.