Skip to main content

Bindings supporting MCPL usage in Geant4.

Project description

mcpl-geant4

This package faciliates the usage of Monte Carlo Particle Lists ( MCPL, https://mctools.github.io/mcpl/ ) files with Geant4.

Usage in Geant4 (C++) code

The interface between MCPL and Geant4 consists of two classes, G4MCPLGenerator and G4MCPLWriter, which users can use to either generate primary events from the particles in an existing MCPL file (1 particle per event), or to capture the particle state of particles entering one or more specified volumes in the simulation geometry and write them to a new MCPL file.

Refer to https://mctools.github.io/mcpl/hooks_geant4/ and section 3.1 of the MCPL paper (https://doi.org/10.1016/j.cpc.2017.04.012) for how to use these two classes in a Geant4 simulation.

Usage Examples

Two complete usage examples along with the necessary CMake code is provided in the mcpl-geant4 repository at:

Installation and Configuration

To use the MCPL-Geant4 bindings, one must:

  1. Install MCPL and Geant4. Although it is possible to build both projects manually, it should be noted that both are available on conda-forge. If not using conda, note that MCPL is also available on PyPI, so assuming Geant4 has already been installed in another manner, it might be possible to simply complete the setup by a pip install mcpl.
  2. Install mcpl-geant4. This can be done by pip install mcpl-geant4, or alternatively by cloning the repository at https://github.com/mctools/ncrystal-geant4 and setting the CMake variable NCrystalGeant4_DIR to point at the src/mcpl_geant4/cmake subdir of the cloned repo.
  3. Edit your projects CMakeLists.txt to add a find_package(MCPLGeant4) statement, and adding the MCPLGeant4::MCPLGeant4 target as a dependency of the Geant4 application you are building.
  4. Edit your C++ code and include the header file(s) MCPLGeant4/G4MCPLWriter.hh and/or MCPLGeant4/G4MCPLGenerator.hh as needed. Then use the corresponding classes in your Geant4 code as needed (see above for usage instructions.

Scientific reference

A substantial effort went into developing MCPL. If you use it for your work, we would appreciate it if you would use the following reference in your work:

T. Kittelmann, et al., Monte Carlo Particle Lists: MCPL, Computer Physics Communications, Volume 218, September 2017, Pages 17-42, ISSN 0010-4655, https://doi.org/10.1016/j.cpc.2017.04.012

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

mcpl_geant4-0.0.2.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

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

mcpl_geant4-0.0.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file mcpl_geant4-0.0.2.tar.gz.

File metadata

  • Download URL: mcpl_geant4-0.0.2.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for mcpl_geant4-0.0.2.tar.gz
Algorithm Hash digest
SHA256 0677e8cb3d1d50c1d251001f3695897e7a4bd9f46b41a5454a7246906d94fd28
MD5 13463454fc5544250909c25421b4a51d
BLAKE2b-256 acece5fd5fb2b4bf55bf5db55c34dca8d24b211f57a5912de02918a05e643707

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpl_geant4-0.0.2.tar.gz:

Publisher: pypi.yml on mctools/mcpl-geant4

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpl_geant4-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: mcpl_geant4-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for mcpl_geant4-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 752ba1d117fdc5c1fd7f0b2b18b3122e1ac70cc917c7410cc3be61e345eca489
MD5 b66dd3c23574ad499c05c1fc0c98a399
BLAKE2b-256 d721e1abcd90ee7cbe2638e3531e4d9d6838f177a628ea3a40d9a24d94972598

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpl_geant4-0.0.2-py3-none-any.whl:

Publisher: pypi.yml on mctools/mcpl-geant4

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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