Skip to content

niess/calzone

Calzone

Calzone (CALorimeter ZONE) is a Python package built on top of Geant4. It was developed in the context of geosciences with the objective of studying the emission of radioactivity from volcanoes (Terray et al., 2020), and in particular to simulate the response of gamma spectrometers deployed in the field. To this end, Calzone was developed in conjunction with Goupil (Niess et al., 2024), a backward gamma transport engine, and is interoperable with the latter. Yet, both packages can be used entirely independently, if necessary.

Please refer to the online documentation and the examples for further information.

Installation

Binary distributions of Calzone are available from PyPI, e.g. as

python -m pip install calzone

In addition, Calzone requires 2 GB of Geant4 data tables, which are not included in the Python package. Once Calzone has been installed, these can be downloaded as

python -m calzone download

Please refer to the documentation for alternative installation methods.

Quick start

# file: geometry.toml

[Environment]
sphere = 1E+05  # cm
material = "G4_WATER"

[Environment.Source]
sphere = 1E+02  # cm
material = "G4_WATER"

[Environment.Source.Detector]
cylinder = { length = 5.1, radius = 2.55 }  # cm
material = "G4_SODIUM_IODIDE"
role = "record_deposits"
# file: run.py

import calzone

# Instanciate a simulation engine (using a TOML geometry).
# Requires installing `tomli` for Python < 3.11.
simulation = calzone.Simulation("geometry.toml")

# Generate primary particles.
source = simulation.geometry.find("Source")
energy = 1.0  # MeV
primaries = simulation.particles()  \
    .pid("gamma")                   \
    .energy(energy)                 \
    .inside(source)                 \
    .generate(1000)

# Run the simulation and fetch deposits.
detector = simulation.geometry.find("Detector")
deposits = simulation  \
    .run(primaries)    \
    .deposits[detector.path]

License

The Calzone source is distributed under the GNU LGPLv3 license. See the provided LICENSE and COPYING.LESSER files. Additionaly, Calzone uses software developed by Members of the Geant4 Collaboration, which is under a specific license.

About

A Geant4 Python wrapper for the simulation of outdoor particle detectors

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
LICENSE

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors