RICH 2015 Testbeam DAQ

Hardware overview

The front-end data are acquired by the DBs (digital boards) that are connected to the ECs (elementary cells). The DBs capture events in response to external triggers, format the data into MEPs (multi-event packets) and transmit the MEPs to the DAQ PC using Gbit Ethernet. Configuration of the DAQ and the front end electronics is via the same Gbit Ethernet links. Triggers (pulser or beam) are sent to the DBs from the trigger logic board (Tengja). The Tengja sends the same triggers to the DBs and the Telescope. Configuration of the Tengja board is via the USB interface. The DAQ PC is located in the beam area.

Quick Start Guide

Control of the acquisition is done using Java GUIs. The JRichEcControl GUI takes care of run control functions. The data acquisition proxy started by the run control GUI, JRichEcControl, will currently only run on Linux systems. To start the DAQ, first log on to the DAQ account on the DAQ PC. This is usually done using ssh -Y from a PC in the control room. Type the command start_daqgui at the prompt, which launches the JRichTBTrigger and JRichEcControl panels. The JRichTBTrigger GUI controls and monitors the trigger sources. The JRichEcConfigurator panel can be loaded using Main->Configurator, and manages sets of elementary cell configuration parameters. The GUIs are described in more detail in their respective topics. A helper program (feb-proxy, that is started automatically by the GUI) forwards configuration packets to the DBs over the network and receives the data packets from the front-end. The packets are decoded by feb-proxy and the data saved in MDF format, one file per DB.

To start a run, first choose the desired trigger source from the trigger GUI (usually Pulser or Beam) then click Start on the DAQ panel to start acquiring data and Stop when you have finished. Data are saved to disk only if the Recording box is checked. The configured settings are also saved at the start of each run when recording is enabled. The run number is incremented automatically when starting a new run but can also be manually set (set it to one less than the number you want for the next run).

DAQ and network settings

DAQ settings
Name of DAQ PC
DAQ login richtbuser
DAQ netmask
Data directory lbrichtb:/work/tb2015/data
BB IOEx I2C 66 (dec)
BB DAC I2C 152 (dec)

Sept/Oct 2015 configuration
Location DB DNA IP
ST(AB) FB26 463D
ST(CD) A490 A311
SB(AB) 4D03 4AC0
SB(CD) 52F9 E10C
JT(AB) 9BA8 F7C0
JT(CD) 6450 776D
JB(AB) B4FE 8276


Different timing settings are required depending on the run type. The most important settings are tabulated below.

Run type Trigger Latency Delay Strobe DB testpulse enable LED pulse enable
Beam Beam 16 11 2 off off
Testpulse Pulser 16 20 6 on off
LED Pulser 16 75 6 off on

The LED delay needs to be checked.

The testpulse feature of the CLARO uses an internal capacitor to store the test charge. Periodic (i.e. pulser) triggers at a low enough rate must be used to give time for the capacitor to recharge between events.

The Kapustinsky LED

The LED pulser should be powered from an LV DC supply at about 7V. The precise value is not critical, but it will have some affect on the amount of light produced as it determines the amount of charge stored in the reservoir capacitor. The pulser is triggered by a fast rising edge. A 3V3 TTL pulse should work. In the testbeam the pulse is driven by an LVTTL output of the trigger board that can be enabled from the GUI when required. As for test pulse runs, a periodic trigger at low enough rate must be used to allow the capacitor to recharge between events.

Most of the light output is concentrated within about 50-100ns but you can expect a long tail.

JRichEcControl GUI

This is the main DAQ control GUI and is part of the RichEcKit package.


General installation instructions can be found in the RichEcKit topic.

After installing RichEcKit, change directory to the installation area and run the GUI as follows:

PATH=$PATH:./ java -Djava.library.path=./ -jar JRichEcControl.jar

Expert DAQ

The Expert DAQ panel is opened from Settings->Expert DAQ. The MAC address and IP address that are shown in the panel should correspond to the ethernet port on the DAQ PC. These addresses can be set in the JRichEcConfigurator through the Settings->PC network... panel, and should not need to be changed once the system is configured.

During beamtests, the number of MEP events per ethernet packet was increased to reduce the network packet loss. The optimal setting is probably the maximum number of events that will fit in a single Ethernet fragment. In this firmware the fragment buffer is around 1kb so up to about 16 events per MEP is optimal.

DB pulser

The settings for the internal pulser on the digital boards are controlled via the Settings->DB pulser... panel. The textfield Pulse count sets the total number of pulses generated on the DB. The Pulse delay is in units of DB clock ticks. Generally, for setups using the trigger board to distribute triggers, it is better to use the trigger board to generate pulser triggers rather than the internal DB pulser.

Threshold/Testpulse(DAC) scan

Threshold/Testpulse(DAC) scans can be launched from the Settings->Threshold/Testpulse(DAC) scan panel, which asks for the number of events per threshold setting, as well as the range of thresholds and increment size (which can be negative). The threshold or testpulse scan is started from the corresponding Threshold scan or Testpulse scan button. To record the scan, the Recording checkbox in the JRichEcControl panel should be ticked, but the Start and Stop buttons on the JRichEcControl panel should not be used to control the scan.

In case the scan gets stuck, use Interrupt to clean up before you can continue with a new scan or other new run.


JRichEcConfigurator allows you to manage settings for both CLARO-based or MAROC-based systems. How these are used depends on the run control program. Typically you can ignore the settings for the MAROC if you are working with the standard CLARO-based EC. The FEB system can be selected in the JRichEcControl panel using Settings->FEB type->CLARO/MAROC3.

Chimaera2 DB hardware

For more details on how to set up the hardware and software please read the Chimaera2 reference manual.

See the RichChimaera2 topic for more (including how to update firmware).

-- FlorisKeizer - 2015-07-24


This program is used to set up the DAQ trigger sources. It can be run standalone but it should normally be started from JRichEcControl.

Software Installation

The trigger GUI is part of the RICHECKIT package. Check the RichEcKit topic for installation details.

Using the Main->Devices... menu, select the ID of the connected trigger device (it is usually on a label on the underside of the board). Restart the GUI.


The hardware consists of a Chimaera2 FPGA board, Tengja breakout/adapter board and scintillator plug-in. The photograph shows the boards assembled in the 2017 beam test configuration which exposes the Tengja J6 connector.

The trigger board functions also as a 4-channel coincidence unit when coupled with the Tengja board and scintillator plugin module as shown. See the JCosmixerDepp topic for details. Any of the six programmable coincidences may be selected as the DAQ trigger source in the JRichTBTrigger main panel.


The latest firmware can be downloaded here.

Chimaera2 PL1 2x5 pin header

For 2017 beam tests the pin functions are assigned as follows:

Pin Signal Mode Typical usage
AA8/AB8 TRGOUT+/- LVDS toggle out Tracker A/B
Y9/AB9 TRGOUT+/- LVDS toggle out Tracker A/B
AA10/AB10 TRGOUT+/- LVDS pulse out Telescope or miniDAQ
W12/Y12 TRGIN+/- LVDS In External trigger source (called LVDS on GUI)

For 2018 beam tests the pin functions are assigned as follows (miniDAQ synchronous trigger):

Pin Signal Mode Typical usage
AA8/AB8 TRGOUT+/- LVDS pulse out (delayed) Telescope or miniDAQ
Y9/AB9 TRGOUT+/- LVDS pulse out (prompt,synchronous to W12/Y12) MiniDAQ trigger
AA10/AB10 TRGOUT+/- LVDS pulse out (delayed) Telescope or miniDAQ
W12/Y12 ExtClk+/- LVDS In External global clock input

LEMO connectors

Pin Function Mode

LEMOTOP may be used as an LVTTL pulse to trigger an LED or LASER pulser. It is driven synchronously to the trigger outputs but can be independently enabled or disabled from the panel.


For the 2017 beam test configuration, the PDMDB master link I2C can be driven from the Tengja J6 connector as follows:

Pin Signal Mode Typical usage
70 SDA0 I2C InOut PDMDB0 master link configuration
69 SCL0 I2C Out PDMDB0 master link configuration
76 SDA1 I2C InOut PDMDB1 master link configuration
75 SCL1 I2C Out PDMDB1 master link configuration


The trigger GUI displays a number of counters:

Counter name Description
External Tclk Number of rising edges on external clock input
Gated trigger Number of triggers for currently selected gated trigger
Ungated beam Number of ungated beam triggers after input conditioning
Gated beam Number of gated triggers after input conditioning
Telescope Number of trigger pulses to telescope
Gated pulser Number of gated pulser triggers

The counters are automatically reset when the Start button is pressed. Additional radio buttons are provided to reset the counters. The values of the counters are stored in the elog for each recorded run.

Trigger and DB selection

Radio buttons allow to select between three trigger sources (Pulser, Beam or FEB) or None. The connected DBs should be ticked in the GUI.

DB TB name Tengja trigger Tengja gate
0 JT-AB J5(3,4) J5(7,8)
1 JT-CD J5(5,6) J5(9,10)
2 ST-AB J2(3,4) J2(7,8)
3 ST-CD J2(5,6) J2(9,10)
4 SB-CD J3(3,4) J3(7,8)
5 SB-AB J3(5,6) J3(9,10)
6 JB-CD J4(3,4) J4(7,8)
7 JB-AB J4(5,6) J4(9,10)
8 Tracker-A J6(89,90)
9 Tracker-B J6(83,84)

Variable pulser frequency

The Pulse delay textfield can be used to vary the frequency of the pulser. The allowed range is from 10 to 65535. For normal operation the pulser should be set to the order of 100kHz, corresponding to setting 100. At higher frequency (lower delay), the ethernet switch discards packets and the online data processing may experience difficulties keeping up. The delay is set in steps of 100ns in the current version of the firmware.

Deadtime control

For reliable triggering it is essential to set a minimum trigger deadtime to veto triggers until the hardware is ready to respond to the next. This is especially important when several parts of the system are running synchronously (e.g. tracker, RICH and beam scintillators). For example, with the RICH upgrade readout in TAE mode sending 23 time slots, the deadtime can be used to enforce a minimum spacing between triggers of 23 times 25ns (575ns). The deadtime setting in the trigger board is an integer with each step being 100ns so in this case, a setting of at least 6 (i.e. 600ns) should be used, more to be safer. The allowed range is 1-511. The deadtime can also be used to limit the rate to reduce packet loss in the network switch.


The JRichTBTrigger register map can be viewed here.

New timing trigger TB2018

GUI installed in richtbuser account on lbrichtb.

Run it with

cd ~richtbuser/Public/Java/Trigger2Kit
java -Djava.library.path=. -jar JRichTBTrigger.jar

Requires external clock (from miniDAQ/muDAQ) connected to Y12/W12.

Set pulse widths to 10 (100ns). Set deadtime to 5 (500ns) or greater.

Firmware is not loaded permanently into flash. On power cycle, reload the firmware as follows (stop the trigger GUI first):

cd ~richtbuser/Public/Java/JAVAKIT
java -Djava.library.path=. -jar XilinxDjtg.jar

  • Click OK to connect to the trigger board.
  • Click Choose file to select the firmware.
  • Click Load FPGA to program the FPGA.
  • Exit program when done.

Use firmware richtbtrigger-x4-v3.bin.


This is a Java program that manages sets of elementary cell configuration parameters for use in small lab setups or beam tests. The GUI does not perform any run control or hardware configuration functions. It is always used in combination with a run control GUI such as JRichEcControl.

The basic unit of configuration is the Elementary Cell which consists of a 2-by-2 arrangement of MAPMTs labelled A, B, C and D. JRichEcConfigurator simplifies the setting of the configuration parameters by allowing selection of the channels to be configured by dragging and releasing the mouse. The program converts the xy coordinates on the EC of the selected anodes into hardware channel numbers. This mapping is stored in a lookup table and can be changed if necessary but has been set to reflect the hardware numbering of the channels as defined for the 2014 beam test hardware.

The configurator panel is started from the JRichEcControl panel: Main->Configurator..., and appears as follows:


Initial settings

A selection of Elementary Cell names have been predefined. You may wish to select one of the ones in the EC name pulldown list. Having selected your EC, choose a Preference set from the pulldown menu. Any settings you make will be associated with this set. Preference sets are global. You can associate the same preference set to any number of ECs. So if you want different preferences for different ECs, give the preference sets globally unique names. You can type in a new EC name or preference set name to create new configurations. There is no particular significance attached to the names, you can choose pretty much whatever you want. The default set behaves no differently from any other.

The next step is to assign digital boards to your EC. Each EC has one or two DBs. The hardware ids (DNA) of all known DBs were loaded from Chimaera2.xml. Select your DBs from the pulldown list. If you have only one DB, select ---- ---- as the id for the other. Note that the run control GUI JRichEcControl is DB-centric, i.e. it will try to read out all DBs that are associated with any EC. Therefore you should check that DBs are assigned only to EC names known to JRichEcConfigurator that you want to include in a data acquisition run.

When setting up multiple ECs, for example during test beam, remember to load the settings to the preference set: Set CLARO->Set selected, before moving on to a different EC.

Digital Board settings

The Settings->DB control menu allows the specific DBs to be configured. At the top of the panel, the trigger source for the DB can be chosen. To enable the trigger, both the Enable and Trigger checkboxes should be ticked. When using the trigger board the LVDS edge source is the one to use. The others should normally not be enabled.

The skip-smb checkbox should be checked when the EC is disconnected from the DB. By default, IOEx base address=66 and DAC base address=152.

Network settings

JRichEcConfigurator also manages the network configuration parameters. These settings are changed by using the Settings menu. Set the MAC address and IP address of your readout PC from the PC network submenu. For the DB MAC and IP addresses, select your DB from the DB network submenu. All MAC and IP addresses in use on your readout network must be unique. The IP address must all belong to the same sub-network. Private IP addresses should be used. Use address beginning 192.168. for example. The MAC addresses of the DBs can be chosen more or less freely. Addresses starting 02: may be preferred as that indicates a privately assigned address.

Setting front end parameters

Now the fun bit...

In order to set the front end parameters for a selected anode or group of anodes, point the mouse to the Anode selection area then press, drag and release to define the rectangular region of selected anodes. The colour will change when you release the mouse to indicate the selected anodes. You can build up complex patterns by repeating this operation. The selection is actually implemented as a toggle operation so selecting the same area again will deselect the anodes. You can create interesting effects by choosing overlapping regions.

Now you can use the Set CLARO button to choose your desired settings and apply them to all selected channels. The run control program, JRichEcControl, will use these settings when configuring the EC. The text area at the bottom will show a list of the channels that you have set.

You can use the Show selected button to show a list of the selected channels without affecting any settings.

Some settings are common to a whole front-end chip while some are channel specific. There are some restrictions on the allowed granularity for setting the common parameters. Typically front end chips conneted to a given photon detector will share the same common settings.

Rotating the display

You can change the orientation of the anode selection area using the Display menu. The current orientation is indicated next to the preference set name. The letters A, B, C & D indicate the position of the 4 photon detectors in the current view. The letters correspond to the labelling used on the EC hardware and the direction of view is looking into the photon detector entrance window. A different rotation can be associated with each EC name.

Exporting preference sets

In the File menu there are options for exporting all preference sets or just one. This is helpful if you want to duplicate your set-up under a different user account. JRichEcConfigurator stores all preferences in a subdirectory the user's home area (or in the user's area of the registry on Windows).

-- FlorisKeizer - 2015-07-24

JPixieBoogieWoogie (PBW)

This is a Java display program that can be used as an event display in real time. It can read MDF-formatted data from a file or from a network socket. The RICH testbeam readout task (feb-proxy) can send events over the network via an intermediary pbwrelay process to the PBW GUI. PBW is a pure Java application therefore it will run on any platform that supports Java.

Integrating PBW into the DAQ

A few simple steps are required:

  • Start a pbwrelayd process on the DAQ PC.
    • Create a FIFO: mkfifo /dev/shm/pbwrly
    • Start the PBW relay daemon: PATH=$PATH:. ./pbwrelayd
  • Enable the sending of events by feb-proxy
  • Start the PBW GUI
    • Run the command java -jar pbw.jar
    • In the Data source combo box, enter
    • Click Go

The first step is probably best done in a script that is executed when DAQ system boots but pbwrelayd can also be started from a non-privileged account.

The above example assumes you are setting up on lbrichtb. You can subsitute the nework address of your own DAQ PC or, If PBW is running on the same machine as pbwrelayd, you can use http://localhost:7999/.

When PBW starts, it connects to pbwrelayd which then starts a pbwrelay server to handle the connection. Several copies of PBW can be connected simultaneously. You should be able to see the pbwrelayd and any pbwrelay processes using the ps afx command.

When you start acquiring data (even if recording is off) you should see the various sources appear in the main PBW window. You can open the display for each source by clicking the checkbox on the left hand side of the panel next to the corresponding data source.

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r11 - 2017-05-30 - LhcbTestbeamSupportService
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback