You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering about how to access the values of a particle's ID and other attributes (in numerical values) such as Px and Py. Are there any functions or methods I could use to get their numerical values?
Thanks!
The text was updated successfully, but these errors were encountered:
Hello there! I have been exploring a little, and a possible way to do it (surely not the most efficient) would be:
import pylhe
path = 'path_to_you/file.lhe'
var_of_interest = 'px' # let's say px to illustrate
data = {var_of_interest: []}
main_object = pylhe.readLHE(path)
for obj in main_object:
for particle in obj.particles:
data[var_of_interest].append(getattr(particle, var_of_interest))
print(data)
Furthermore, I have been working in some functionalities to read the data of .root files and .lhe files to a dataframe. This work is heavily based on uproot and pylhe. If you need something like that feel free to give a glimpse to https://pypi.org/project/nndm-library/.
Hi,
I was wondering about how to access the values of a particle's ID and other attributes (in numerical values) such as Px and Py. Are there any functions or methods I could use to get their numerical values?
Thanks!
The text was updated successfully, but these errors were encountered: