Skip to main content

McStas components and tools mimicking ESS Readout Master detector readouts: collect simulated events to HDF5, combine files, and replay them to Event Formation Units

Project description

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, TTLMonitor, 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 and ReadoutTTLMonitor make 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcstas_readout_master-0.3.3.tar.gz (305.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mcstas_readout_master-0.3.3-py3-none-manylinux_2_28_x86_64.whl (9.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

mcstas_readout_master-0.3.3-py3-none-macosx_14_0_x86_64.whl (5.8 MB view details)

Uploaded Python 3macOS 14.0+ x86-64

mcstas_readout_master-0.3.3-py3-none-macosx_14_0_arm64.whl (4.8 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file mcstas_readout_master-0.3.3.tar.gz.

File metadata

  • Download URL: mcstas_readout_master-0.3.3.tar.gz
  • Upload date:
  • Size: 305.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcstas_readout_master-0.3.3.tar.gz
Algorithm Hash digest
SHA256 ab9ed78c26e9ebdc96999e92e1fa6a7ef2a6d9cd0cbfee60ba0f8b552efed328
MD5 8ca9d89564f6edf1398b7bb108aba70e
BLAKE2b-256 736f1aa5899c1e187229425c8a5e0b637ab6dbc725d066b297eaf55ba6897a4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcstas_readout_master-0.3.3.tar.gz:

Publisher: wheels.yml on mcdotstar/mcstas-readout-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcstas_readout_master-0.3.3-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for mcstas_readout_master-0.3.3-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5ac5d891a41def96f4da8c757391da1dc5721db4ad01f80ca9d1b56340e71fd5
MD5 68a646cac4fa63d9f755beedb60201ae
BLAKE2b-256 8ffd93e3b767001383214e1c755b2be3f4a3a70e14165332ba00be8b0ba0fd85

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcstas_readout_master-0.3.3-py3-none-manylinux_2_28_x86_64.whl:

Publisher: wheels.yml on mcdotstar/mcstas-readout-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcstas_readout_master-0.3.3-py3-none-macosx_14_0_x86_64.whl.

File metadata

File hashes

Hashes for mcstas_readout_master-0.3.3-py3-none-macosx_14_0_x86_64.whl
Algorithm Hash digest
SHA256 267bfe57b032c436b8987bc7d3b5e831f80bedb632b486aead7797edf4d294c9
MD5 2dae2fd62f2038573a5019fd00b19a2c
BLAKE2b-256 d15d17a552afbe6877a8c2728d907e636a64f95c9d410af452e4636a303d3c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcstas_readout_master-0.3.3-py3-none-macosx_14_0_x86_64.whl:

Publisher: wheels.yml on mcdotstar/mcstas-readout-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcstas_readout_master-0.3.3-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for mcstas_readout_master-0.3.3-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 088e9155d5e7cdbe18589bf0a0d4488b082a8203e68a36870761eebf05a16811
MD5 b478949bb0d337af6740b35bca944a1b
BLAKE2b-256 1ec98c1006838f27d1b9074037b05c63a29550cd54f0a7515c8fed35813d89d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcstas_readout_master-0.3.3-py3-none-macosx_14_0_arm64.whl:

Publisher: wheels.yml on mcdotstar/mcstas-readout-master

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page