The interface between PYTHIA and NumPy
Project description
numpythia provides an interface between PYTHIA and NumPy allowing you to generate events as NumPy arrays of particle four-momenta. By default numpythia only depends on NumPy and builds internal copies of the PYTHIA and HepMC source code.
from numpythia import generate, STATUS, HAS_END_VERTEX, ABS_PDG_ID
from numpythia.testcmnd import get_cmnd
for event in generate(
get_cmnd('w'), events=1,
find=(STATUS == 1) & ~HAS_END_VERTEX &
(ABS_PDG_ID != 12) & (ABS_PDG_ID != 14) & (ABS_PDG_ID != 16),
random_state=1):
print(event)
The dtype of each generated event is:
np.dtype([('E', 'f8'), ('px', 'f8'), ('py', 'f8'), ('pz', 'f8'), ('mass', 'f8'),
('prodx', 'f8'), ('prody', 'f8'), ('prodz', 'f8'), ('prodt', 'f8'),
('pdgid', 'i4'), ('status', 'i4')])
Also see pyjet for jet clustering.
Standalone Installation
To simply use the built-in PYTHIA and HepMC:
pip install --user -v numpythia
And you’re good to go!
Support for building against an external PYTHIA, Delphes, and much more will come soon.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
numpythia-0.1.0.tar.gz
(6.5 MB
view details)
File details
Details for the file numpythia-0.1.0.tar.gz
.
File metadata
- Download URL: numpythia-0.1.0.tar.gz
- Upload date:
- Size: 6.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac8ae1a728148298b56341c0ac05f573f9e39644134201b3e639332a2d397ee2 |
|
MD5 | 3844b8c600230ed4aa535994d6eb72ed |
|
BLAKE2b-256 | ce5af81bb3075c10b69f2998426f9c93bbbc6f026739ec0094f72fad2a0ed9c4 |