The CMS DAQ Pinball Machine

We present an interactive game for up to seven players that demonstrates the challenges of on-line event selection at the Compact Muon Solenoid (CMS) experiment to the public. The game in the shape of a popular classic pinball machine was conceived and prototyped by an interdisciplinary team of graphic designers, physicists and engineers at the CMS Create hackathon in 2016. Having won the competition, the prototype was turned into a fully working machine that is now exhibited on the CMS visitors’ path. Teams of 2-7 visitors can compete with one another to collect as many interesting events as possible within a simulated LHC fill. In a fun and engaging way, the game conveys concepts such as multi-level triggering, pipelined processing, event building, the importance of purity in event selection and more subtle details such as dead time. The multi-player character of the game corresponds to the distributed nature of the actual trigger and data acquisition system of the experiment. We present the concept of the game, its design and its technical implementation centered around an Arduino micro-controller controlling 700 RGB LEDs and a sound subsystem running on a Mac mini.


CMS Create
Recognizing the importance of outreach, the Compact Muon Solenoid (CMS) experiment [1] at CERN organizes an annual hackathon in which multi-disciplinary teams compete to prototype new exhibits explaining aspects of the experiment to the public. In this two-day event called CMS Create [2], teams composed of four physicists or engineers from CMS and two students from Geneva's IPAC Design school collaborate for 33 hours in the stimulating environment of CERN's IdeaSquare [3]. Teams can draw on support from the event organizers, CMS physicists, IdeaSquare personnel and the CMS mechanical workshop, and are provided a large choice of building / prototyping materials and electronics. At the end of the second day, the prototypes are presented to a jury who ranks the contributions. We report on the winning prototype of the 2016 edition of CMS Create.

Conception and making of the CMS DAQ pinball machine
With four team members from the trigger / data acquisition (DAQ) area of the experiment, the winning team started with the idea of explaining the two-stage event selection and DAQ of the experiment to the public. During the initial brainstorming, mechanical and electronic exhibits were considered. Mainly because of the experience available in the team, the electronic approach, illustrating particles and data flow by RGB LEDs 1 , was pursued. In the following discussions, the idea to involve the visitors in a game rather than showing them an interactive display was born. While discussing the shape of the game, the idea of building it in the form of a classical pinball machine with a vertical and a horizontal surface emerged. A lab bench was found and converted into the skeleton of the game by the mechanical workshop. Team members started assembling electronics, writing code to control the game and elaborating a graphics design. At the end of the 33 hours, the machine had its mechanical structure, a catchy title, the almost final graphic design and LEDs illustrating some of the data paths and two of the processing units. The game and its enthusiastic presentation convinced the jury.
Over the subsequent weeks during many hours of work the prototype was finalized: segments comprising about 700 RGB LEDs were soldered together and installed, industrialstrength push buttons were mounted, microcontroller code running on an Arduino Uno [4] was written, a sound server running on an Apple Mac Mini was developed, the graphic design was refined and the mechanical design completed with front and side panels. In November 2016, the final and fully working prototype shown in Figure 1 was presented at a public event.
1 RGB LEDs are light-emitting diodes, whose color and intensity can be controlled through individual control of the red, green and blue component.  The exhibit was subsequently ruggedized at the CMS mechanical workshop and is now exhibited at the CMS experiment since June 2018 ( Figure 2).

Playing the game
Two to seven players have to collaborate to perform the event selection of CMS, one player performing the first-level trigger selection and one to six players performing the highlevel trigger selection. Players face various problems that are also faced in the real experiment. One round of the game takes a little over one minute. The main elements of the game are illustrated in Figure 3. After pressing the start button, the hydrogen bottle's fill level rises over a few seconds in preparation of a fill. During the simulated fill, lasting 60 seconds, protons are colliding at the centre of the experiment at a rate of 3 Hz, producing particle tracks in the detector. As in the real experiment, the next collision is happening before the particles generated by the preceding collision have left the detector. Over the simulated fill, the fill level of the hydrogen bottle decreases indicating the remaining time. Data packets corresponding to event fragments travel down data links to the first-level trigger (right-hand two electronic circuits) or to data buffers (left-hand two electronics circuits) illustrating that, just as in the real experiment, the first-level trigger decision is based only on a sub-set of detectors. In the first-level trigger, data packets are processed in a pipeline, moving down the pipeline stages at 3 Hz. Interesting events are illustrated in blue colour, non-interesting events in various other colours. On average one in 3 events is interesting. The player operating the first-level trigger needs to accept interesting events when they appear at the last pipeline stage. This is challenging, since events appear in the final stage only for 1/3 of a second. The player needs to select as little un-interesting events as possible, as these would unnecessarily consume resources downstream, which may lead to back-pressure and dead-time of the firstlevel trigger. Fragments of accepted events, both from the data buffers and first-level trigger, travel through the event builder switch to event processing units in a way that all fragments corresponding to one event end up in the same processing unit. In the event processing farm, consisting of 6 processing units, events are processed for an average of 6 seconds. The maximum processing rate is therefore 1 Hz. If events at the first-level trigger are selected at a higher rate, this results in back-pressure and the first-level trigger being inhibited until the processing farm can again accept events. Players are notified of an inhibited first-level trigger accept by a different sound from a successful accept.
At the end of processing in the processors, events that are still interesting at the high-level trigger briefly show up in blue. Non-interesting events show up in various other colours. Players, playing the high-level trigger select events to be recorded by pressing the event selection button, trying to select all blue events and none of the other events. Events that were interesting at the first-level trigger have a one in three chance to turn out as interesting at the high-level trigger. Events not interesting at the first-level trigger always turn out as non-interesting in the high-level trigger. Events selected at the high-level trigger travel to the data storage, which, just as in the real experiment, is limited. Up to 20 events may be recorded. Players have to try to record as many as possible interesting events. Selecting noninteresting events may result in exhausting the data storage before the game is over. The number of interesting events stored is shown by a counter on the game so that teams can easily compare their scores. Table 1 shows a comparison of the most important parameters of the game and their correspondence in the CMS experiment. The Table is displayed next to the machine on the visitors' path helping guides to communicate the relation to the real experiment.

Implementation details
The final game is controlled by an Arduino Mega [4] microcontroller that is programmed in the C++-like Arduino programming language. Approximately 700 Adafruit DotStar LEDs [5] are all controlled via a single Serial Peripheral Interface (SPI) bus. 5V power from a PC power supply is fed to the LED chain at various points in the chain. A two-digit 7segment display showing the score is connected via a secondary SPI bus. The Arduino is connected via a USB interface to an Apple Mac Mini computer that runs a sound server written in Python. The program on the Arduino triggers the playing of sounds by sending commands to the Mac Mini over a serial line interface at the appropriate moment.
All design files including graphics and software are available in a GitLab repository [6] to enable interested institutes to build a copy of the pinball machine.

Experience on the CMS visitors' path
Welcoming about 35 000 out of a total of 130 000 visitors to CERN each year (estimated numbers from 2019 excluding the September 2019 Open Days), the Compact Muon Solenoid (CMS) Experiment is one of the main points of public interest at CERN. The CMS DAQ pinball machine is regularly used during CMS visits, especially when large groups are visiting that have to take turns at visiting the underground installations. It is particularly popular with groups of high-school and university students. At the time of writing, about 2700 games have been played with the machine in total. The distribution of the number of interesting events recorded, illustrated in Figure 4b, shows that up to 19 interesting events have been selected by some teams (the record of the developers of the game being 16), while no group ever reached 20. This indicates that the level of difficulty of the game is right. The distribution of the total number of events recorded (Figure 4a) shows a peak at zero, probably due to game started but not really played and a peak at 20, due to either exhaustion of the storage or the pressing of random buttons.