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:
- https://github.com/mctools/mcpl-geant4/tree/main/example_write
- https://github.com/mctools/mcpl-geant4/tree/main/example_read
Installation and Configuration
To use the MCPL-Geant4 bindings, one must:
- 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. - 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 variableNCrystalGeant4_DIRto point at thesrc/mcpl_geant4/cmakesubdir of the cloned repo. - Edit your projects CMakeLists.txt to add a
find_package(MCPLGeant4)statement, and adding theMCPLGeant4::MCPLGeant4target as a dependency of the Geant4 application you are building. - Edit your C++ code and include the header file(s)
MCPLGeant4/G4MCPLWriter.hhand/orMCPLGeant4/G4MCPLGenerator.hhas 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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcpl_geant4-0.0.4.tar.gz.
File metadata
- Download URL: mcpl_geant4-0.0.4.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca249fa422026cfdc5d9660ba55e0194f8aeba69dee0d84e9c6e473eaf8480dd
|
|
| MD5 |
5af7c68a927f05f7261751c399c49496
|
|
| BLAKE2b-256 |
3669a2bac8a3ddb9ccb20613f55034662934bc194336acde0d7e9d1dce075914
|
Provenance
The following attestation bundles were made for mcpl_geant4-0.0.4.tar.gz:
Publisher:
pypi.yml on mctools/mcpl-geant4
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpl_geant4-0.0.4.tar.gz -
Subject digest:
ca249fa422026cfdc5d9660ba55e0194f8aeba69dee0d84e9c6e473eaf8480dd - Sigstore transparency entry: 662343741
- Sigstore integration time:
-
Permalink:
mctools/mcpl-geant4@ed6ee77103457b645654a31ae769bbe7b3f14aa3 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/mctools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ed6ee77103457b645654a31ae769bbe7b3f14aa3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcpl_geant4-0.0.4-py3-none-any.whl.
File metadata
- Download URL: mcpl_geant4-0.0.4-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.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
651dbd932d906a4ba4d37dba12dba7711313843b9ba93da068b728d78b26009e
|
|
| MD5 |
a884d97c8992251718fc86e4ca691ea1
|
|
| BLAKE2b-256 |
2c58606d1b2b04ed00c74d740e89d7af32878a05c0af549c0853f14cae75c654
|
Provenance
The following attestation bundles were made for mcpl_geant4-0.0.4-py3-none-any.whl:
Publisher:
pypi.yml on mctools/mcpl-geant4
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcpl_geant4-0.0.4-py3-none-any.whl -
Subject digest:
651dbd932d906a4ba4d37dba12dba7711313843b9ba93da068b728d78b26009e - Sigstore transparency entry: 662343746
- Sigstore integration time:
-
Permalink:
mctools/mcpl-geant4@ed6ee77103457b645654a31ae769bbe7b3f14aa3 -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/mctools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@ed6ee77103457b645654a31ae769bbe7b3f14aa3 -
Trigger Event:
push
-
Statement type: