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.8.1

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.8.1
File Size Uploaded Provenance
mcstas_readout_master-0.8.1.tar.gz 349.6 kB With provenance Details

Built distributions (wheels)

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

Total release size: 20.2 MB

Release files / mcstas_readout_master-0.8.1.tar.gz

Download URL mcstas_readout_master-0.8.1.tar.gz
Size 349.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0ee1ce3c2737cc9945e1d245ae536b4ec3edae2c88ca68aec845d0d5029f6974
BLAKE2b-256 checksum
How to use checksums
674b141480e6a53723c72018aecf105fe641014ea0735d68b187d769d2d19022
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

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

Download URL mcstas_readout_master-0.8.1-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
95f5fad1c7bf1d0604b15a5a1da01c555c76e2527659b328bc6c36b77079f9d1
BLAKE2b-256 checksum
How to use checksums
c07af4658cdbb36bdba4c6e1eb6530822d1a8ea8914589202b6bb12c1931c3dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

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

Download URL mcstas_readout_master-0.8.1-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
4d11d8f79c2ecb9ced17b6ebf1874b61f28589c8fd08b3f6af335ced3e3d9703
BLAKE2b-256 checksum
How to use checksums
d06791725ab44e8375dea78b4ef7925336e25b9e3babb2e351dfaa659308068b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

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

Download URL mcstas_readout_master-0.8.1-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
957e16fce70bd6815665dcbcddfbeb262dea3e8a578a05d59689418fc71978d7
BLAKE2b-256 checksum
How to use checksums
153fa8783f60f999b11aa258b7e1b413f31cc6e65fc6b8ece691f592285be2fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 20, 2026.

Transparency log

Security for mcstas-readout-master 0.8.1

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.8.1.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 Oct 20, 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