An Event Display for ATLAS H8 Pixel Test Beam Data 

George Gollin

Centre de Physique des Particules de Marseille and University of Illinois

April 17, 1999


An event display program is now available for use with H8 test beam pixel data. The program is intended more as a data viewer than anything else, and is meant to allow physicists on shift to notice sudden changes in the data coming from the silicon strip telescope and pixel detectors. The event display can be launched by the data acquisition program, and is then controlled separately by users on shift through a mouse-driven interface.  There is a pdf version of this document available.


You can jump directly to descriptions of:



User Interface

 Here is how a typical 1998 test beam event looks. 

Figure 1. A typical event, from run 4275 (September, 1998).

The display screen can be resized in the usual way by dragging its boundaries, but you may need to click on the screen to refresh the window.

The screen is divided into four principal areas: x-view and y-view representations of the telescope are drawn above a row of control buttons; a message area is drawn below.

Hits in the strip and pixel detectors are drawn as blue lines whose length is proportional to the ADC signal from each strip, or time-over-threshold from struck pixels. Strips (or pixels) which have been identified as noisy will have their tick marks drawn in red. To zoom in on part of the telescope, left-click on the Zoom control button, then left-click twice on one of the telescope drawings as shown in Figure 2.  

Figure 2. Defining a zoom area.

 If the zoom area is small enough, strip hits are labeled strip-number:ADC-value, while struck pixels are labeled column,row:time-over-threshold, as shown in Figure 3.


Figure 3. After zooming.

Right-click on the zoom button to reset the zoom area.

The phi, psi, theta angles indicated in some of the buttons may be changed by clicking on the buttons. These are not Euler angles: phi corresponds to rotations around the lab frame y axis, psi around the lab frame x axis, and theta around the z axis. You can use these to reorient the pixel planes in order to better view the hit information. The angles are reset each time a new event is loaded.

The area in which detector and hit details will be drawn are indicated by marks near the corners of the x and y plots. The H8 frame (z,x) and (z,y) coordinate values of the marks are shown in millimeters.

Clicking once in the x-view (or y-view plot) causes the program to write the H8 coordinates of the click (also in millimeters) in the message area.


...back to the beginning


Interaction with the Data Acquisition Program

The event display program is launched by the data acquisition software after a request by a user. The program may be launched with a string of (optional) arguments which specify the IP address of the display, whether the job is running at CERN or not, and the x, y alignment constants of the last three strip planes and the pixel detectors. A positive value for an alignment constant indicates that the center of the detector is displaced in the positive direction with respect to the center of the first strip plane. Since the first strip plane is used to define the coordinate system, its alignment constants are zero, by definition, and ARE NOT entered as arguments to the program. As with PAW, an exclamation point (!) informs the program that it should use the default value of an argument.

The job generates no "printer output" when it runs normally, but will try to write a small amount of diagnostic information to standard output if it runs into problems. It probably makes sense to redirect standard output to a file.

The Unix command

will launch the program with the following arguments:

DISPLAY IP address
Location/directory structure CERN
Strip plane 2 x offset (mm) 2.626
Strip plane 2 y offset (mm) -.645
Strip plane 3 x offset (mm) 1.630
Strip plane 3 y offset (mm) 3.196
Strip plane 4 x offset (mm) ! (use default value of zero)
Strip plane 4 y offset (mm) 3.774
Pixel demo 1 x offset (mm) .710
Pixel demo 1 y offset (mm) 1.970
Pixel demo 2 x offset (mm) (not specified; use default of zero).
Pixel demo 2 y offset (mm) (not specified; use default of zero).
Marebo x offset (mm) (not specified; use default of zero).
Marebo y offset (mm) (not specified; use default of zero).
Module x offset (mm) (not specified; use default of zero).
Module y offset (mm) (not specified; use default of zero).

Any diagnostic information written to standard output by the program will be redirected to the file event_display.log.

Handshaking between the DAQ and event display routines is simple: upon launch, the event display creates a control file named /PixData/event_display, and then looks for data from a single event in the file /PixData/event_dump. If /PixData/event_dump doesnít exist, the event display waits for it to be created, repeatedly checking for the file roughly once per second. After reading the eventís data, the display program deletes the file. When the user clicks the "Next event" button the display program opens (or waits for) another event_dump file.

The DAQ can signal the event display to stop by deleting the control file. Because of some fine points concerning the queuing of mouse events, this is the only graceful way to stop the event display while it is waiting for event data. At other times, the event display can also be stopped by double-clicking on its STOP button.

The DAQ creates /PixData/event_dump if it detects the existence of the control file /PixData/event_display and sees that the event_dump file does not exist. The first line in the control file /PixData/event_display contains a number used by the DAQ to determine how many events to skip before creating a new event_dump file. A value of 1 indicates that the DAQ should create the file using the next available event.

When asked to stop, the event display program deletes /PixData/event_display and (if it exists) /PixData/event_dump.


...back to the beginning


Program Contents

The event display program is written in Fortran. Here is a list of the routines, along with the descriptive comments at the start of each routine. Links to the "include files" for common blocks and the Makefiles follow the routine descriptions.


c this is an event display routine for CERN h8 testbeam data for the
c pixel detector tests.
c The purpose of this routine is to allow people on shift to see whether or
c not most events are "sensible": strip detectors show hits that lie
c roughly on a line, and pixel detectors show activity in the expected
c regions. It is NOT the purpose of this to generate online calibration and
c alignment information while writing data.
c program takes arguments; first is which display to draw on. See comments
c in event_display_get_args for a more complete description.
c There are several different coordinate systems which come into play:
c the "telescope frame" or "lab frame" has its z axis parallel to the
c beam, and its x,y axes parallel to the coordinates determined by the
c first strip plane. The origin of the lab frame is at the
c (xstrip, ystrip) = (0,0) corner of the first strip plane. units: mm
c "raw coordinates" from a detector, also in millimeters, have
c (xraw, yraw, zraw) calculated from the number of the strip, column, or
c row that's struck, and the appropriate pitch. zraw=0.
c "screen pixels," "xpixels," "ypixels" refer to dots on the X11 display.
c The X11 origin puts (0,0) at the upper left corner of the screen.
c x increases as one moves to the right, while y increases as one moves
c DOWN the screen. This can cause a certain amount of confusion, since
c the telescope frame is displayed with its z axis moving to the right on
c the screen (positive X11 x), and with the positive x (or y) direction
c moving towards the top of the screen (negative X11 y direction).
c see
c event_display_documentation.html
c for WWW documentation of the event display.
c George Gollin, CPPM (Marseille) and University of Illinois (Urbana-Champaign)
c, 1999


c this routine takes raw coordinates (e.g., x = strip number * pitch) and
c transforms them into the telescope coordinate system.
c zraw_local is zero on the detector. More generally, zraw_local is
c the distance from the point in question to the detector plane, taken
c perpendicular to the detector surface.


c figure out if a mouse click just received was in one of my display
c control buttons. return 0 if not, and button number if yes.
c Input arguments are x and y of pixel, and mouse button if mouse was
c clicked.


c look to see if the control file exists.


c draw an empty set of detectors for the h8 telescope.


c draw hits in the already-drawn detector picture of the h8 telescope.


c parse arguments for the event_display program


c This routine fetches the next event from the event data file.
c The file is opened, read, and then deleted so that the DAQ will
c recognize that it's time to create a new file.


c figure out what to do in response to a mouse click.


c initialize geometry for the event display


c This routine takes lab coordinates in millimeters and returns the coordinates
c of the corresponding screen pixel in the x view. Keep in mind that X11 uses
c increasing x to move to the right, increasing y to move down on the screen.
c As a result, increasing lab x (or y) corresponds to decreasing X11 y;
c increasing lab z corresponds to X11 increasing x.


c This routine takes lab coordinates in millimeters and returns the coordinates
c of the corresponding screen pixel in the y view. Keep in mind that X11 uses
c increasing x to move to the right, increasing y to move down on the screen.
c As a result, increasing lab y (or x) corresponds to decreasing X11 y;
c increasing lab z corresponds to X11 increasing x.


c request a user click on the graphics window inside one of the buttons.
c return which button (.ge. 1), or zero if it wasn't in a button.


c open an event display graphics window


c This routine takes raw coordinates (e.g., x = strip number * pitch, and
c rotates them into a frame with origin at the detector center, but
c axes parallel to the telescope (lab) coordinate system.


c This routine takes row and column for a pixel detector and returns the
c "raw" coordinates. Since increasing row corresponds to increasing x,
c but increasing column might correspond to decreasing y, use this routine to
c handle the possible y-reversal. It works for strip planes too...


c This routine writes a short control file indicating the frequency with
c which events should be written to disk for consumption by the display
c routine.


c This routine writes a line of text into the message are in the display
c window.


c This routine takes x,y for a display pixel and returns telescope coordinates
c for the x view.
c Keep in mind that X11 uses increasing x to move to the right, increasing
c y to move down on the screen.


c This routine takes x,y for a display pixel and returns telescope coordinates
c for the y view.
c Keep in mind that X11 uses increasing x to move to the right, increasing
c y to move down on the screen.


c Provide wisdom for the user, to be written to the message area,
c if the user figures out where to click to obtain enlightenment.

common /event_display/

common /event_display_data/

Makefile for compiling fortran and linking object modules on Mardigra (a CPPM machine), and then to create an executable to be run on Mardigra.

Makefile for compiling fortran on Mardigra, but to create object modules which will be used on Mardaq2 (which does not have a fortran compiler)

Makefile for linking object modules on Mardaq2 which had been created on Mardigra.

...back to the beginning

CPPM phone: +33 (0)4 91 82 72 72
CPPM fax: +33 (0)4 91 82 72 99
Illinois phone: +1 (217) 333-4451
Illinois fax: +1 (217) 333-4990