Skip to main content

Hadronic Interaction Model interface in Python

Project description


Cosmic ray and HadROnic interactiOn MOnte-carlo frontend

DOI

This package provides a simple and generic user interface to popular event generators used in cosmic ray and high-energy particle physics. By removing the need for complicated Fortran-style interfaces, ASCII input cards, and C++ dependencies, the package simplifies the simulation of particle interactions, making it easier and faster for a wider audience to access.

Usage

Python user interface

To simulate interactions with one of the supported event generators, import the package and define the parameters of the collision. Then, create an instance of an event generator, and generate events.

import numpy as np
import chromo

# Define the parameters of the collisions
kinematics = chromo.kinematics.CenterOfMass(
    13 * chromo.constants.TeV,
    "proton", "proton")
# Create an instance of an event generator
generator = chromo.models.Sibyll23d(kinematics)

nevents = 0
average_pt = 0

# Generate 10000 events
for event in generator(10000):
    # Filter event
    event = event.final_state_charged()
    # do something with event.pid, event.eta, event.en, event.pt, etc.
    # these variables are numpy arrays, that can be histogrammed or counted like
    pt = event.pt[np.abs(event.pid) == 211]
    # The list could be empty
    if len(pt) > 0:
        nevents += 1
        average_pt += np.mean(pt)

average_pt = average_pt / nevents
print("Average pT for charged pions {0:4.3f}".format(average_pt))

Further examples, such as this can be found in the examples folder.

Command line user interface (CLI)

Installing chromo also makes a command-line interface available. If your Python runtime environment is properly set up, you can do

 chromo --help

To see the help of the command-line interface. If that does not work, just replace chromo with python -m chromo. The command-line interface was designed to feel familiar for users of CRMC. The CLI can write events in a variety of output formats, as detailed below. HepMC output can be piped into RIVET and many other tools supporting the format.

Output formats

  • HepMC (via pyhepmc, optionally gzip compressed)
  • ROOT (via uproot)
  • SVG images of events (via pyhepmc package)

Supported models and how to cite them

Please note that chromo only provides a user interface for the following models, and does not contain any particle physics models itself. When using any of these models in public-facing work, it is important to properly cite the original model reference by following the links below. Additionally, if you find chromo useful in your work, we would appreciate an acknowledgement, footnote, or link to chromo.

Interaction model Supported proj/targ Comment
DPMJET-III 3.0.7 & PHOJET 1.12-36 hN, γγ, γN, hA, γA, AA
DPMJET-III & PHOJET 19.1 and 19.3 (repo on GitHub) hN, γγ, γN, hA, γA, AA
EPOS-LHC hN, hA, AA
EPOS-LHC-R hN, hA, AA
EPOS-LHC-R (w/ hadr. rescattering) hN, hA, AA
PYTHIA 6.4 hN, ee, γγ, γN
PYTHIA 8.3 (https://pythia.org/) hN, ee, γγ, γN & hA, AA (Argantyr) unavailable on Windows
QGSJet-01 hN, hA, AA
QGSJet-II-03 hN, hA, AA
QGSJet-II-04 hN, hA, AA
QGSJet-III hN, hA, AA
SIBYLL-2.1 hN, hA (A<=20)
SIBYLL-2.3c/d/e hN, hA (A<=20) incl. legacy versions 2.3 can be build from source
SIBYLL* (based on 2.3d and 2.3e) hN, hA (A<=20)
SOPHIA 2.0 γN
UrQMD 3.4 + second citation hN, hA, AA* unavailable on Windows

h = hadron, N = nucleon (p or n), A = nucleus, γ = photon, e = electron/positron

Installation via PyPI

Supported platforms

  • Python 3.9+
  • Linux, Mac OS X (x86 and M1/M2), Windows

The recommended way to install chromo is by using the pre-compiled binary wheel, which is available for most common architectures and Python versions

pip install chromo

Advanced and developer installation instructions can be found here.

Citation

If you use chromo in your research, please cite it using the following DOI:

DOI

You can also cite it in your bibliography as:

Fedynitch, A., Dembinski, H., Prosekin, A., El Hadri, S., & Watanabe, K. (2025). 
CHROMO: Cosmic ray and HadROnic interactiOn MOnte-carlo frontend. 
Zenodo. https://doi.org/10.5281/zenodo.16562752

Authors

  • Anatoli Fedynitch
  • Hans Dembinski
  • Anton Prosekin
  • Sonia El Hadri
  • Keito Watanabe

LICENSE

The source code of chromo is licensed under the BSD 3-clause license (see LICENSE for detail). The source codes of the event generators are individually licensed under different conditions (see the COPYING files located in the subdirectories).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chromo-0.10.1.tar.gz (112.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

chromo-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

chromo-0.10.1-cp313-cp313-manylinux_2_28_aarch64.whl (25.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

chromo-0.10.1-cp313-cp313-macosx_14_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

chromo-0.10.1-cp313-cp313-macosx_13_0_x86_64.whl (29.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

chromo-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

chromo-0.10.1-cp312-cp312-manylinux_2_28_aarch64.whl (25.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

chromo-0.10.1-cp312-cp312-macosx_14_0_arm64.whl (26.8 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

chromo-0.10.1-cp312-cp312-macosx_13_0_x86_64.whl (29.0 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

chromo-0.10.1-cp311-cp311-manylinux_2_28_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

chromo-0.10.1-cp311-cp311-manylinux_2_28_aarch64.whl (25.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

chromo-0.10.1-cp311-cp311-macosx_14_0_arm64.whl (26.7 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

chromo-0.10.1-cp311-cp311-macosx_13_0_x86_64.whl (29.0 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

chromo-0.10.1-cp310-cp310-manylinux_2_28_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

chromo-0.10.1-cp310-cp310-manylinux_2_28_aarch64.whl (25.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

chromo-0.10.1-cp310-cp310-macosx_14_0_arm64.whl (26.7 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

chromo-0.10.1-cp310-cp310-macosx_13_0_x86_64.whl (29.0 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

chromo-0.10.1-cp39-cp39-manylinux_2_28_x86_64.whl (28.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

chromo-0.10.1-cp39-cp39-manylinux_2_28_aarch64.whl (25.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

chromo-0.10.1-cp39-cp39-macosx_14_0_arm64.whl (26.7 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

chromo-0.10.1-cp39-cp39-macosx_13_0_x86_64.whl (29.0 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file chromo-0.10.1.tar.gz.

File metadata

  • Download URL: chromo-0.10.1.tar.gz
  • Upload date:
  • Size: 112.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.12

File hashes

Hashes for chromo-0.10.1.tar.gz
Algorithm Hash digest
SHA256 c437ba3c41871395d015526d80a98c07b3dc3a6b72dee0ccd5b06e00b12c69e9
MD5 6649c718900253d3dbf6829266479e66
BLAKE2b-256 dd26011d47bd834fb52ee6d69606ad21973313130183d4bc86efd0012b016fde

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f4f136d38df9db722e5cefb923d9cb36ac5d004f913961c8d1c7efd660723294
MD5 649ff7483d9eb4bba54fb36080383b20
BLAKE2b-256 b203d79e6198bba0044b0860eec45ec72e4d4d7a28c53253b820dc3d82d94688

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 84a6d29fff4fc22aaea02c50f5e74c9c8941f5dac460e144b5fd82761f7643c3
MD5 065936f37ccdbad540e564c919fe0bb3
BLAKE2b-256 a79c5cd1aa3109ed9eabf1ba5ec4b31c6fc5381a853a288385de6c58fd4e0b5f

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 0379a75b2648ff58f76402b5f62b8ddf11a2a11e607c8b5d6e3ab02bab7d4f4e
MD5 28da7870b0055b451508936b2bee344c
BLAKE2b-256 566792bc87f6d973127f603845413ff5758c545d639cb265c69f23520d6dceac

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 5dd58c652b2a13712317365b31e7166499426c5d83fe45b4d1446cd59a99934b
MD5 710663f907a3987a3eaba78f42d9b54c
BLAKE2b-256 0d625db96282150c8d9dfda6336b9bf3c6736830a509447c50e2984d35bf20c8

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3b9aeec3bebe20c016c9091770130c455152b363ec44e5a346603741b94247fc
MD5 be483cad7175bd8f091bc06e9dd6d42e
BLAKE2b-256 120ccfd1f2206ab70a7d178d22648075e9ec2736d869119cd4d75009f00287a6

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6ba815d45301d81c52c3af79d38dbc8c60e16a7828dc37a02bf8f733626dd480
MD5 bc79efab5aa0d8d5b7fcff78abca131e
BLAKE2b-256 35ae5ff6165bf13c6a5ebc7d5683d1e32698c4078db207cf0cced5ae35d5651e

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1a3b6e566f7fd116dbd63cf91f4f2d52e86ce1b0d2ba097143f424c97ffe234d
MD5 e41de989b980f3ecbd2f1796df247c2b
BLAKE2b-256 cb56ee644776feca009a0bad32bef4b358b9790fa3161c65fb4edfb2fe9399aa

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 bc5a929b020ec5417c8404444bc12adb3e78642fa1e0210bd7f10f834b30e861
MD5 aaa4adedaaa2d045f8a50c0f8f11fd40
BLAKE2b-256 e5f9761ae6404d4a6f377236d6981868893d168815e82a9fb5cc94ed35fd4016

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec82b811f5e5f18eb1edaa0ac56695de1502ea19a375ddd9b4a44c2d1bd93968
MD5 2648c1ae90af6bf5f7c159ae450b9352
BLAKE2b-256 039369aa09daa29ab4b6b195f807eddf78294cd51e59486c020a621b31ede231

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bffa8bdc4b97fecff379a614eff3f6187b8bbc71759f3a50310218d54fa23dec
MD5 4db121fe2f173b0870c23f70ad5b3868
BLAKE2b-256 cabe4ee0a7e24c8bd054a1cbdcb1c47c4968d4682210e30543e2dfb2aa409e58

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 c2d34f040e068d3f769f1e7d1ad8c784d8426f0f585ee6e6ca44d02435065f8f
MD5 d4f702ddf7d44868666f0cac8f3fcff1
BLAKE2b-256 770b41a4e22c58e8b8bd6719e6bdadeffefdbe0ee2c18d48de0df2b40ef14e98

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 85e1eff2c3cf1f0717c688c24a483cd21a6660307c248a43217deb6d5b99e350
MD5 b189e6e3c6baf0bb7b2451bb41a4510d
BLAKE2b-256 ff846d153319a1e7a25d12c5f209bf598f8551b9e96316e82fb76f6e6f28478f

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e794fa81bb0b7a998889ff861416619722f75c8dcb234b1558118dcfb64cfbd
MD5 16d8d39137875035123a2d525fbb4449
BLAKE2b-256 19e52c507ee59c09d19eaafc06becd76100f93f5aa5e0cba235676bb45575ee5

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7820d9e18c5e507ffe4e04cd2a4fb1b4f3a4ca237ac2ba17d12ebf625275b1df
MD5 3186b1309f45e57c79a983adc17f84d2
BLAKE2b-256 260d099d9f4f33db67a6474c544246820cd0b4a49e35573def950d4e2deae363

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 9d1f01aca2f27869ce40bc9d869d94ebe8cefcf995ad30dae75ac92e662f4447
MD5 9476e9a4ee36625460334ed5ab615945
BLAKE2b-256 3be98d552abab1136dc2a8f51ddb6856a0473801378311321cd8fef8031251a0

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f1aa18a8730a57ad4dd56156f8535b64ac2075e9f39cdc8070296fdb2c82206f
MD5 42b69788ce536bea10c6b8dfd19cefc4
BLAKE2b-256 b5e4f5cede258273b3dfce91ca33348fa4348b451da7406ae2f83599956ddec8

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1b36d891881ec29d8cb927ff91692ffc0dc7ebec72414bd374e039730104d700
MD5 f10b2db4cad1de7ff62e9cf579e28523
BLAKE2b-256 ec121cb589c5795e3e0a0c094500bf37001e3ec10b4c5f84bc095020d4cc9fea

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 eba4c63dcf73aa8a4867bb644910e3ae66493fff602c23e7313f27ea8851e584
MD5 94f64067021a2b3970cce82d6ab3dbad
BLAKE2b-256 970e5c73ed42971a08e156a9a2052f3170284eb45709f4e35407652b42cd23ac

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f1725597999230e20784c60b6dd2be188add27b86904fdd200dd7ef9ba5c3736
MD5 6ba6c6772ce56204e9a2ce685f435955
BLAKE2b-256 b69e6552a7e67be3795f0b336997c8c733496cc33fba5c9a6ffb2dfe1c33a65c

See more details on using hashes here.

File details

Details for the file chromo-0.10.1-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for chromo-0.10.1-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 21b253074c2beef132e5d61373944f5bf59e732bdbad2023825a89499eea8c4e
MD5 812932c888459889a2e69a1c4257760d
BLAKE2b-256 1657749f8413b8538bc18b95a9d03abf7bef9bae390428a40b2260138dc0ca25

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page