Hi,
I have a Delphes style tree in which there are branches with leaves that appear to be arrays of their own right. I would like to access the leaf variables using a TChain, but can not figure out how to do so.
And here is my code attempting to access a leaf using the TChain:
TChain chain("Delphes");
chain.AddFile("qcd_sqrtshatTeV_13TeV_PU20_1.root");
int size=-1, eventNumber=-1;
chain.SetBranchAddress("Jet_size", &size);
chain.SetBranchAddress("Event.Number", &eventNumber);
int i = 123; // random number for testing
chain.GetEvent(i)
cout << size << endl;
cout << eventNumber << endl;
When running this code, with any event, I am able to get the size branch for the ith event, but the eventNumber is always -1.
Hi Danilo,
Thank you very much for your response. Unfortunately I need to do more with the data than filtering it; I will have many data components which in turn create compound variables, etc, while looping through each event.
How exactly could you use the RDataFrame to access directly the value for Event.Number, on an event by event basis?