Skip to content
Snippets Groups Projects
Commit 267f4eec authored by Jihee Kim's avatar Jihee Kim
Browse files

fixed warning message and reading mcparticles info

parent 58e6dda3
Branches
Tags
No related merge requests found
......@@ -5,6 +5,10 @@
Author: Chao Peng (ANL)
Date: 04/30/2021
Added true decaying particles on eta-phi plane projection plot
Author: Jihee Kim (ANL)
Data: 08/06/2021
'''
import os
......@@ -144,10 +148,10 @@ if __name__ == '__main__':
df['eta'] = -np.log(np.tan(df['theta'].values/1000./2.))
# Read all mc particles
########################
dfallmcp = get_all_mcp(args.file, args.iev, 'mcparticles2')
# Select decaying particles
dfdecaymcp = dfallmcp[dfallmcp['g4Parent'] == 1.0]
dftemp = dfallmcp[dfallmcp['g4Parent'] == 1.0]
dfdecaymcp = dftemp.copy()
pdgbase = ROOT.TDatabasePDG()
for iptl in [0, len(dfdecaymcp) - 1]:
infoptl = pdgbase.GetParticle(int(dfdecaymcp['pid'].iloc[iptl]))
......
......@@ -104,7 +104,7 @@ def get_all_mcp(path, evnums=None, branch='mcparticles2'):
events.GetEntry(iev)
# extract mc particle data
for ptl in getattr(events, branch):
dbuf[idb] = (iev, ptl.psx, ptl.psy, ptl.psz, ptl.pdgID, ptl.status, ptl.g4Parent, ptl.vex, ptl.vey, ptl.vez)
dbuf[idb] = (iev, ptl.ps.x, ptl.ps.y, ptl.ps.z, ptl.pdgID, ptl.status, ptl.g4Parent, ptl.ve.x, ptl.ve.y, ptl.ve.z)
idb += 1
return pd.DataFrame(data=dbuf[:idb], columns=['event', 'px', 'py', 'pz', 'pid', 'status', 'g4Parent', 'vex', 'vey', 'vez'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment