Skip to content

Instantly share code, notes, and snippets.

@ndawe
Last active August 3, 2017 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndawe/0651e08fa5098f892df7fa872b007218 to your computer and use it in GitHub Desktop.
Save ndawe/0651e08fa5098f892df7fa872b007218 to your computer and use it in GitHub Desktop.
pyjet and numpythia
from numpythia import Pythia
from numpythia import STATUS, HAS_END_VERTEX, ABS_PDG_ID
from numpythia.testcmnd import get_cmnd
from pyjet import cluster
pythia = Pythia(get_cmnd('w'), random_state=1)
selection = ((STATUS == 1) & ~HAS_END_VERTEX &
(ABS_PDG_ID != 12) & (ABS_PDG_ID != 14) & (ABS_PDG_ID != 16))
# generate one event
for event in pythia(events=1):
jets = cluster(event.all(selection), R=0.5, p=-1).inclusive_jets(ptmin=3)
# constituents of leading jet as numpy array
constits = jets[0].constituents_array()
print(constits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment