Hi,
I’m trying to preform some analysis cuts using RDataFrame from root files generated by Delphes. But I seem to encounter a problem with reading particles data from arrays. As i understand, in a delphes file, an event may contain more than one same particle, like electron or muon. If i do
df = ROOT.RDataFrame("Delphes", filepath)
hist = df.Histo1D("Muon_size")
hist.Draw()
I get a histogram describing the distribution of muon numbers per event. For a particular event, that has say 2 muons, the Muon.PT branch contains an array that stores the pT of the two muons. When i try to the read the pT distrubution of the muons, with:
hist = df.Histo1D("Muon.PT")
hist.Draw()
I get a distribution for all muons in the file. But if i chose to look for the leading muons in pT, or subleading as follows:
hist = df.Histo1D("Muon.PT[0]")
hist.Draw()
I get the following error:
cppyy.gbl.std.runtime_error: Template method resolution failed:
ROOT::RDF::RResultPtr<TH1D> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Histo1D(string_view vName) =>
runtime_error: Unknown column: "Muon.PT[0]"
I’ve being trying many methods but none of them worked. Can please someone help me with this problem?
ROOT Version: 6.32.12
Platform: Linux
Compiler: PyROOT