This question might seem really dumb, but here goes:
I have a dataset from a delphes output with the final product being muons. However, I’m not sure how many muons actually were created. I’ve been looking through the documentation as well as I could (I’m not too good at it) but I couldn’t find anything like a variable or method that returns how many particles are in each event/entry of a collision. Does anyone have any ideas what I could do?
The following is what I have right now, but the three should be replaced with something that actually shows the right number of particles in each entry.
for i in range(numEvents):
entry = tree.GetEntry(i)
collision = SimCol()
for a in range(3):
pt = tree.GetLeaf("Muon.PT").GetValue(a)
eta = tree.GetLeaf("Muon.Eta").GetValue(a)
phi = tree.GetLeaf("Muon.Phi").GetValue(a)
collision.muons.append(TLorentzVector())
collision.muons[-1].SetPtEtaPhiM(pt, eta, phi, 0.1)
collision.calcInvMass()
histo.Fill(collision.invMass)
Print the tree structure (tree.Print()) and see if there’s any “number of muons” (or whatever you want) branch/leaf. If not, you have to figure out how to count them --maybe make a histogram with the ones you want and get the number of entries (histo.GetEntries()), or just make a counter in the code.
I don’t know delphes, but searching the web there’s this: https://cp3.irmp.ucl.ac.be/projects/delphes/wiki/WorkBook/RootTreeDescription
Thanks! Sorry for the late reply, but how would I properly fill the histogram with all the muons? I feel like that rests on me actually knowing how many muons there are. As for when I printed the structure, it said there were 21 “baskets” in each Muon branch.
I know there are 10,000 entries because that’s how many collisions I set in the delphes run card, but I still don’t see anything telling me how many muons are actually produced in each entry.