Skip to content

krisfur/ZeroMQ-C-plus-plus-DAQ

Repository files navigation

CLI-Based Distributed DAQ Simulator (ZeroMQ + tmux)

C++ C++

This is a command-line DAQ-style simulation system built with C++ and ZeroMQ, designed for real-time control and visualization using tmux. It mimics a particle physics detector pipeline, featuring:

  • 🛰️ Multiple Detectors generating random events
  • ⚙️ A Broker that load-balances data
  • 🧠 Multiple Workers processing the data
  • 📥 A Collector tallying total hits
  • 📡 A Monitor Bus relaying system logs
  • 🧾 A Monitor CLI dashboard
  • 🕹️ A CCM (Command & Control Module) to gracefully shut everything down

🧱 Architecture

        +-----------+          +---------+         +-----------+
        | Detectors | PUSH --> | Broker  | PUSH -->|  Workers  |
        +-----------+          +---------+         +-----------+
                                   |                    |
                              Control via              PUSH
                              zmq::proxy()              |
                                   v                 +--------+
                               +--------+ <-------- | Collector |
                               |  CCM   |           +--------+
                               | PUB --> all        (tallies PARTICLEs)

Log Flow:

All components PUSH logs to monitor_bus (PULL → PUB), which are displayed in a monitor (SUB) pane in tmux.


🖥️ Live View

Screenshot

Launches into a live tmux session with all components in a tiled layout.
Use the top-left CCM pane to type shutdown and gracefully exit all components.


🚀 Quickstart (Fedora)

1. Install dependencies

sudo dnf install -y gcc-c++ cmake make tmux zeromq zeromq-devel

2. Clone and run

git clone <this repo>
cd ZeroMQ-C-plus-plus-DAQ
chmod +x run_all_tmux.sh
./run_all_tmux.sh

The script will:

  • Build all components
  • Start a tmux grid view
  • Stream logs
  • Wait for you to type shutdown

📦 Components

Component Description
ccm Command interface (sends shutdown)
broker Load balances data between detector/worker
collector Tallies up processed hits
detector Sends random PARTICLE / MISS events
worker Processes and forwards only PARTICLEs
monitor_bus Relays logs to monitor
monitor Displays logs in a clean CLI view

🧹 Cleanup

tmux kill-session -t daq_grid

About

A full simulation of a DAQ setup with ZeroMQ in C++, with a tmux command-centre-like set of screens.

Topics

Resources

Stars

Watchers

Forks