Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Tutorial

hep-ml edited this page Feb 10, 2021 · 12 revisions

Introduction

This tutorial should give an introduction to trigger algorithm developers how to set up the environment needed, make changed, compile, build and run the system

Overview

Overview DUNE DAQ DUNE DAQ consists of several Modules that themselfs consist of Plugins. In this tutorial, we will see how to create a plugin for the triggermodules module.

Setting up the environment under dunedaq-v2.2.0

Detailed documentation can be found at https://github.com/DUNE- DAQ/appfwk/wiki/Compiling-and-running-under-v2.2.0

Environmental variables

We want to work with a specific tag/version, and within a specific working directory. In our example, we use:

export VERSION=dunedaq-v2.2.0

export MYDIR=dunedaq

Setup daq-buildtools

Set up daq-builtools via your shell:

git clone https://github.com/DUNE-DAQ/daq-buildtools.git -b $VERSION
source daq-buildtools/dbt-setup-env.sh

The expected answer is

Added /your/path/to/daq-buildtools/bin to PATH
Added /your/path/to/daq-buildtools/scripts to PATH
DBT setuptools loaded

Setup working directory

mkdir $MYDIR
cd $MYDIR
dbt-create.sh $VERSION

This may take a couple of minutes and will create your working area in the $MYDIR location.

Setting up modules

DUNE DAQ consists of several mod- ules. The most important one is appfwk that provides the basic func- tionalities. The data selection is based on two modules: triggermodules and triggeralgs. The source code for the modules are located in sourcecode. Following commands can be run to check out all the required modules:

cd sourcecode
MODULES="appfwk triggermodules triggeralgs cmdlib ers filecmd listrev restcmd"
for MODULE in $MODULES
do
git clone https://github.com/DUNE-DAQ/$MODULE.git
cd $MODULE
git fetch;git checkout $VERSION
cd ..
done

You should now have a complete working environment!

Example

In this tutorial, we will use $MYDIR/sourcecode/DAQDuneTrigger/Plugins/ TriggerPrimitiveFromFile.cpp as an example. It simply takes a (shorter) waveform from a csv (comma-separated values) file indicated by the user, formatted as follows:

time_start time_over_threshold time_peak channel adc_integral detid type
value, value, value, value, value, value, value,
...
...

moo-based files

moo is a tool for code generation based on schema files using either python or jsonnet. A complete moo documentation is available We want our module and our plugins to be configurable. Typically, we use three different kinds of moo source files in the schema folder of a module.

  • the plugin schema
  • the plugin make
  • the app / command facility

We will give a short introductions to all of them. An exhaustive documentation is available here.

Clone this wiki locally