mesytec_data 1.1.1
Toolkit for parsing Mesytec VME module data
No Matches
mesytec_data v1.2

mesytec data parsing library & GANIL acquisition interface

Website and class reference documentation:

This package provides the shared library

for analysing Mesytec data.

It can also provide the executable application


which encapsulates data received from the Mesytec acquisition application mvme into GANIL MFM metaframe format data (with frame type 0x4ADF) which are published on a ZeroMQ port: see below for more details.

The shared library

defines a Narval actor which can receive data from a ZeroMQ port and inject it into the Narval dataflow (this can be used with any type of data, not only Mesytec. The actor simply copies the incoming buffer to its output buffer).

It can also provide the

library if ROOT is found on the system, which can be used to automatically convert Mesytec data to the TTree format.


CMake version 3.12 or later. C++ compiler with at least C++11 compatibility.

To build <tt>mesytec_receiver_mfm_transmitter</tt>:

Configure the build with CMake option -DENABLE_RECEIVER_TRANSMITTER=ON

ZeroMQ [optional]

Required to build mesytec_receiver_mfm_transmitter and

If installed from Ubuntu/Debian packages, make sure to install the dev package.

If you have more than one version on your system in different places, you can specify the path to use when configuring the build by setting either ZeroMQ_DIR or ZeroMQ_ROOT CMake variable with the path to use (see below).

Build and install

$ cmake -S [source_dir] -B [build_dir]
$ cmake --build [build_dir] --target install --parallel [ncpu]

replacing [source_dir], [install_dir] and [ncpu] with appropriate values

The CMAKE_BUILD_TYPE determines the amount of optimisation of code: for production versions, use Release or RelWithDebInfo for the fastest execution.

To build mesytec_receiver_mfm_transmitter add option -DENABLE_RECEIVER_TRANSMITTER=ON.

If required, add -DZeroMQ_DIR=[path] or -DZeroMQ_ROOT=[path] to use a specific installation of ZeroMQ.

Define VME configuration

Parsing data requires a file containing the definitions of modules in the VME crate, and optionally a file with a correspondence between each bus/channel and detector.

Example crate_map.dat


Each line has the format: name, crate-address, number_channels, firmware

crate-address is the HW address of the module: remember that Mesytec data only uses the top two nibbles of these addresses, therefore make sure all modules have addresses such as 0xXY, not 0x0XY or 0x00XY.

number_channels is the number of channels (16 or 32) for MDPP modules, number of buses for VMMR (each bus is assumed to have 128 subaddresses).

firmware can be: (note that only MDPP modules can have different firmwares; for other modules the 'firmware' is used to define the type of the module - KLUDGE!)

  • for MTDC: MTDC
  • for VMMR: VMMR

Example detector_correspondence.dat


Each line has the format: crate-address, channel_number, name (MDPP modules) or crate-address, bus_number, channel_number, name (VMMR modules)

Data analysis

Buffers of data can be parsed with class mesytec::buffer_reader. See example_analysis.cpp.

GANIL Acquisition Interface

Using timestamps from CENTRUM/BEAST/GTS modules

In order to correlate data with other DAQ systems at GANIL, we add timestamps to each Mesytec data frame which can be retrieved from one of 2 modules placed in the same VME crate:

  • TGV module (with either CENTRUM or BEAST timestamp provider);
  • AGAVA module (with GTS timestamp provider)

The appropriate module should be added to the crate_map.dat file:


Only the 'firmware' (TGV or AGAVA) and the crate address are important here. Note that the crate address need not be the physical address of the module, rather it must correspond to the one used in the mvme interface when data from the module is read out.

MFM encapsulation

Run the mesytec_receiver_mfm_transmitter executable with suitable arguments in order to encapsulate data received by ZMQ from the mesytec mvme software into MFMMesytecFrame frames, which are in turn bufferized and transmitted on a ZMQ PUB socket. A timeout mechanism allows to flush any incomplete buffer if the DAQ stops transmitting data. Usage:

$ mesytec_receiver_mfm_transmitter --help
Optional arguments:
-c [ --config_dir ] arg (=.) directory in which to look for config
--config_file arg (=transceiver.cfg) file with default argument values (in
-h [ --mvme_host ] arg (=localhost) url of host where mvme-zmq is runnning
-m [ --crate_map ] arg (=crate_map.dat)
name of file containing crate map
-y [ --mvlc_config ] arg (=mvlc_crateconfig.yaml)
yaml file with exported MVLC config
-s [ --data_source ] arg (=0) data source id [0-255] for MFM frame
-p [ --mvme_port ] arg (=5575) port number of mvme-zmq host
-z [ --zmq_port ] arg (=9097) port on which to publish MFM data
-b [ --buffer_size ] arg (=64) buffer size to use (in kilobytes)
-t [ --timeout ] arg (=1000) timeout for buffer flush (in
--debug [option] enable debug output
--trace [option] enable trace output

The MVLC VME configuration can be exported from the mvme GUI menus:

File > mesytec-mvlc library import/export > Export VME config to mesytec-mvlc CrateConfig

It is possible to use a configuration file (default name: transceiver.cfg) to give values to options:


If a transceiver.cfg file, MVME export file & crate map are present in the same directory, the transceiver can be launched by just giving the path to the directory:

$ mesytec_receiver_mfm_transmitter -c /path/to/config

Narval receiver is a Narval actor which can receive the MFM frames produced by mesytec_receiver_mfm_transmitter in order to inject them into a Narval dataflow. Give the specification of the ZMQ port (tcp://hostname:port) in the algo_path option of the actor.

Use by other projects (CMake)

For other projects to use us we provide two targets in the mesytec_data:: namespace:

  • mesytec_data::mesytec_data: compile and link with;
  • mesytec_data::mesytec_data_root_interface: compile and link with the ROOT/TTree interface

You can build and link your own projects which use either or by adding to your CMakeLists.txt the following:

find_package(mesytec_data [optional:minimum version] [REQUIRED|QUIET])
# executable using
add_executable(MyApp my_code.cpp)
target_link_libraries(MyApp PRIVATE mesytec_data::mesytec_data)
# shared lib using
add_library(MyLib SHARED my_class1.cpp my_class2.cpp)
target_link_libraries(MyLib PUBLIC mesytec_data::mesytec_data_root_interface)