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.
Here is the structure of the tree:
And here is my code attempting to access a leaf using the TChain:
int size=-1, eventNumber=-1;
int i = 123; // random number for testing
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.
I propose to use RDataFrame to analyse this dataset.
ROOT::RDataFrame rdf("Delphes", "qcd_sqrtshatTeV_13TeV_PU20_1.root");
h = rdf.Histo1D("Jet_size") //for example!
hfiltered = rdf.Filter("Event.Number % 2 == 0").Histo1D("Jet_size") //for example!
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?
See also the result of MakeSelector to facilitate access.
Ps. to make you original example work you can also use