Package: chromo
Cosmic ray and HadROnic interactiOn MOnte-carlo frontendThis 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.UsagePython user interfaceTo 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.importnumpyasnpimportchromo# Define the parameters of the collisionskinematics=chromo.kinematics.CenterOfMass(13*chromo.constants.TeV,"proton","proton")# Create an instance of an event generatorgenerator=chromo.models.Sibyll23d(kinematics)nevents=0average_pt=0# Generate 10000 eventsforeventingenerator(10000):# Filter eventevent=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 likept=event.pt[np.abs(event.pid)==211]# The list could be emptyiflen(pt)>0:nevents+=1average_pt+=np.mean(pt)average_pt=average_pt/neventsprint("Average pT for charged pions{0:4.3f}".format(average_pt))Further examples, such asthiscan be found in the examples folder.Command line user interface (CLI)Installingchromoalso makes a command-line interface available. If your Python runtime environment is properly set up, you can dochromo --helpTo see the help of the command-line interface. If that does not work, just replacechromowithpython -m chromo. The command-line interface was designed to feel familiar for users ofCRMC. 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 formatsHepMC (via pyhepmc, optionally gzip compressed)ROOT (via uproot)SVG images of events (via pyhepmc package)Supported models and how to cite themPlease note thatchromoonly 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 findchromouseful in your work, we would appreciate an acknowledgement, footnote, or link tochromo.Interaction modelSupported proj/targCommentDPMJET-III 3.0.7&PHOJET 1.12-36hN, γγ, γN, hA, γA, AADPMJET-III & PHOJET 19.1 and 19.3(repo on GitHub)hN, γγ, γN, hA, γA, AAEPOS-LHChN, hA, AAPYTHIA 6.4hN, ee, γγ, γNPYTHIA 8.3(https://pythia.org/)hN, ee, γγ, γN&hA, AA(Argantyr)unavailable on WindowsQGSJet-01hN, hA, AAQGSJet-II-03hN, hA, AAQGSJet-II-04hN, hA, AASIBYLL-2.1hN, hA (A<=20)SIBYLL-2.3dhN, hA (A<=20)incl. legacy versions -2.3/-2.3cSOPHIA 2.0γNUrQMD 3.4+ second citationhN, hA, AA*unavailable on Windowsh= hadron,N= nucleon (p or n),A= nucleus,γ= photon,e= electron/positronInstallation via PyPISupported platformsPython 3.8+Linux, Mac OS X (x86 and M1/M2), WindowsThe recommended way to installchromois by using the pre-compiled binary wheel, which is available for most common architectures and Python versionspip install chromoAdvanced and developer installation instructions can be foundhere.AuthorsAnatoli FedynitchHans DembinskiAnton ProsekinSonia El HadriKeito WatanabeLICENSEThe source code of chromo is licensed under theBSD 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).