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.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcstas_readout_master-0.7.0.tar.gz | 356.4 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcstas_readout_master-0.7.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| mcstas_readout_master-0.7.0-py3-none-macosx_14_0_x86_64.whl | Python 3 | none | macOS 14.0+ x86-64 | Details |
| mcstas_readout_master-0.7.0-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.7.0.tar.gz
| Download URL | mcstas_readout_master-0.7.0.tar.gz |
|---|---|
| Size | 356.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d199ed87f6cec13390c700466af82a79c98cd371eeaccd31f95ca1890e37bdc
|
|
BLAKE2b-256 checksum How to use checksums |
6b6ececb15f499b019588bf5df648f3d75fc0e149e5831c9f2fbe3cb2f6107fc
|
| 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 5, 2026.
Transparency logRelease files / mcstas_readout_master-0.7.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | mcstas_readout_master-0.7.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 |
bbee19cf9346cdc3db776178d02cf14649e1e842d1417ff50dcdb99c3ec811bf
|
|
BLAKE2b-256 checksum How to use checksums |
13d82a5d953c2438dff20f7b0ebc42912850937b69e61fb543e6194ae8e8d352
|
| 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 5, 2026.
Transparency logRelease files / mcstas_readout_master-0.7.0-py3-none-macosx_14_0_x86_64.whl
| Download URL | mcstas_readout_master-0.7.0-py3-none-macosx_14_0_x86_64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | Python 3 macOS 14.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
d3924c50cd08e3669a39253441cfbd7757b5f5ccdf0917152d5a962c27041cbd
|
|
BLAKE2b-256 checksum How to use checksums |
e319821243b6254ba1552e99f67b482a793576953226243afabe72adb6c9f8aa
|
| 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 5, 2026.
Transparency logRelease files / mcstas_readout_master-0.7.0-py3-none-macosx_14_0_arm64.whl
| Download URL | mcstas_readout_master-0.7.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 |
8429bc8b9a4c7a95e0f54b46a4705c3b00a1d6244fb0ff49d81b1536e9c92dc5
|
|
BLAKE2b-256 checksum How to use checksums |
bbaf18fb3f8c9f45131af14c515a0a834771ce31e99a752ffda1b6a2ee1958df
|
| 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 5, 2026.
Transparency log