Skip to main content

McStas Readout Master for ESS detectors

Components and tools linking McStas 3.3+ ray-tracing neutron simulations to the ESS data pipeline via the Event Formation Unit (EFU).

Simulated readout records are collected to HDF5 files while the simulation runs, combined across repeated runs or scan points, and replayed to EFUs afterwards, statistically correctly — the data-acquisition stack does not need to be running (or reachable) during the simulation.

Documentation

Guides, per-component parameter references, CLI documentation, and the C/C++ API reference are published at

https://mcdotstar.github.io/mcstas-readout-master/

To build the site locally (requires Doxygen):

cmake -S . -B build-docs -DREADOUT_DOCS_ONLY=ON
cmake --build build-docs --target docs
# open build-docs/docs/html/index.html

Quickstart

1. Install

git clone https://github.com/mcdotstar/mcstas-readout-master.git
cmake -S mcstas-readout-master -B mcstas-readout-master-build -DCMAKE_INSTALL_PREFIX=~/.local
cmake --build mcstas-readout-master-build --target install

This installs libreadout, the readout-config, readout-combine, and readout-replay tools, and the McStas component files.

2. Collect

Add a Collector* component matching your detector electronics (CAEN, CDT, VMM3, BM0, BM2, BMI) to the end of your instrument's TRACE section. Identifying values are read by name from particle variables (typically USER_VARS set in an EXTEND block):

TRACE
  ...
  SEARCH SHELL "readout-config --show compdir"
  COMPONENT collect = CollectorCAEN(
    ring="ring_id", tube="tube_id", a_name="left", b_name="right",
    filename="run", dataset_name="caen_bank0")
  AT (0, 0, 0) ABSOLUTE

Each run produces a cue-based HDF5 file; several collectors can share one file, each writing its own named group.

3. Combine

readout-combine validate run_*.h5
readout-combine append      --output merged.h5 run_a.h5 run_b.h5   # identical parameters
readout-combine concatenate --output scan.h5   point_*.h5          # scan points

4. Replay

readout-replay --time 2.0 --seed 42 --addr my-efu.example.org --port 9000 scan.h5

Replay steps through the stored points, publishes each point's parameters, draws n ~ Poisson(w * counting_time) events per stored readout, and sends them to EFUs resolved from explicit configuration, file-embedded attributes, or the command-line defaults — in that order. See the CLI reference for all options.

Legacy runtime streaming

The original per-ray streaming components remain available for use cases where the EFU runs alongside the simulation: ReadoutCAEN makes a Poisson-distributed Monte Carlo choice per traced neutron and send packets immediately, and ReadoutDiscreteCAEN sends an exact number of weighted-sampled events at the end of the run. Their parameters are documented on the site and in the component headers (mcdoc-compatible).

MPI support

The Collector* components gather records to the master node, which writes one HDF5 file. For the streaming Readout* components, all nodes need network access to the EFU host.

Development

See DEVELOPMENT.md for the development-mode build (-DREADOUT_DEVELOPMENT_MODE=ON), test suites, and the reasoning behind the self-locating readout-config.

Use with McStas 3.2

The SEARCH SHELL automatic path modification used above requires McStas 3.3+. With McStas 3.2, copy the component files into one of the McStas component search directories and omit the SEARCH SHELL line.

Metadata

Release files for mcstas-readout-master 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcstas-readout-master 0.9.0
File Size Uploaded Provenance Actions
mcstas_readout_master-0.9.0.tar.gz 350.9 kB With provenance Details for mcstas_readout_master-0.9.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mcstas-readout-master 0.9.0
File Interpreter ABI Platform Actions
mcstas_readout_master-0.9.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for mcstas_readout_master-0.9.0-py3-none-manylinux_2_28_x86_64.whl
mcstas_readout_master-0.9.0-py3-none-macosx_14_0_x86_64.whl Python 3 none macOS 14.0+ x86-64 Details for mcstas_readout_master-0.9.0-py3-none-macosx_14_0_x86_64.whl
mcstas_readout_master-0.9.0-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details for mcstas_readout_master-0.9.0-py3-none-macosx_14_0_arm64.whl

Total release size: 20.2 MB

Release files / mcstas_readout_master-0.9.0.tar.gz

Download URL mcstas_readout_master-0.9.0.tar.gz
Size 350.9 kB
Tags Source
SHA-256 checksum
How to use checksums
869d2a6869a307d3770dbf3935548c732ea1ce25e40e23256cd5327cef36ac29
BLAKE2b-256 checksum
How to use checksums
d1d62b3da61fbd1f59af5e28a9a18ca72091b800ef3126564787f5bbbf9db1d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / mcstas_readout_master-0.9.0-py3-none-manylinux_2_28_x86_64.whl

Download URL mcstas_readout_master-0.9.0-py3-none-manylinux_2_28_x86_64.whl
Size 9.2 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5082d963bab80b34609890c3e1064252a0caf613d91ecbbf2001fe8408c8f838
BLAKE2b-256 checksum
How to use checksums
162fb0d585a60f539464344180e7644d8196d6d6e5858b77515142aa391e7e53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / mcstas_readout_master-0.9.0-py3-none-macosx_14_0_x86_64.whl

Download URL mcstas_readout_master-0.9.0-py3-none-macosx_14_0_x86_64.whl
Size 5.9 MB
Tags Python 3 macOS 14.0+ x86-64
SHA-256 checksum
How to use checksums
69c582500823039811b7eb59947f9e61eeb1d2a6bf4e676cd1725ccb4ee6fee0
BLAKE2b-256 checksum
How to use checksums
22399d0f73be7a600b24490ba55546c657db137976ccbb7fa1978c8aa6297c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / mcstas_readout_master-0.9.0-py3-none-macosx_14_0_arm64.whl

Download URL mcstas_readout_master-0.9.0-py3-none-macosx_14_0_arm64.whl
Size 4.8 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
88499371b585f488ff1325f53ed6e856b44d098e56e423acbb3ef3d6886ca375
BLAKE2b-256 checksum
How to use checksums
fbab4a509dbb00ba7155b8d1809c9bbaaa664e9894b73d1c8cc23d2e3fe4881d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for mcstas-readout-master 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for mcstas_readout_master-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page