Main features

The Event Viewer is the successor of the Event Dump application which is implemented in Python using Qt for GUI and parses events using the standard eformat package. Event Viewer can sample events from an active data taking system or read them from a standard ATLAS raw data file. Event Viewer shows data as a tree of ROB fragments displaying all attributes which are commonly defined in the ATLAS event format specification. Individual ROD fragments data is shown as a sequence of integer values in hex format. One can implement a plugin (in Python) to provide alternative representation of a specific ROD data.

How to run the Event Viewer

After setting up this TDAQ release the event Viewer can be started by using the following simple command:

> event_viewer.py

How to implement a custom plugin

There are 3 simple steps to follow in order to provide a custom representation of a ROD data:

A plugin is a simple Python function which has one argument - a sequnce of 4-byte integer values and must return an HTML string which contain representation of the input data. This function must be preceded by special annotation which defines what data it will be applied to. For example the following function implements a plugin which will be used for displaying both status and data values of all ROD fragments whose names are starting with "LAR_":
import EventViewer

@EventViewer.Plugin("data", "LAR_.*")
@EventViewer.Plugin("status", "LAR_.*")
def lar_converter(data):
    lines = [data[i:i+10] for i in range(0,len(data),10)]
    out = '<br />'.join(
        '<b><i>%03d</i></b> : %s' % (10*n,' '.join('0x%08x' % word for word in line))
            for n,line in enumerate(lines))
    return '<font face="courier" color="blue">' + out + '</font>'
The plugin formats input sequence into multiple rows with 10 hexadecimal integer values in each row. Each value is printed using mono-spaced font of blue color.
One can as well provide different functions for the "status" and "data" tags as well as have more specific formatting for a subset of RODs. For example in addition to the previous function a valid plugin may contain the following one in which case all RODs which start with  "LAR_EM_" will be displayed differently to the ones which have only "LAR_" in their names:
@EventViewer.Plugin("data", "LAR_EM_.*")
@EventViewer.Plugin("status", "LAR_EM.*")
def lar_converter(data):
    lines = [data[i:i+10] for i in range(0,len(data),10)]
    out = '<br />'.join(
        '<b><i>%03d</i></b> : %s' % (10*n,' '.join('0x%08x' % word for word in line))
            for n,line in enumerate(lines))
    return '<font face="courier" color="red">' + out + '</font>'
Those ones will be shown in a similar way but using red color for the data values.
> export PYTHONPATH=<location of the plugin file>:$PYTHONPATH
Finally if the plugin code is packed to the file called for example LArEventViewerPlugin.py one can put it into play by executing the following command:
> event_viewer.py LArEventViewerPlugin
One can also simplify the usage of the plugins providing to the end users a simple python script which contains custom plugins code and starts the Event Viewer. Such script will look like:

	#!/usr/bin/env tdaq_python

	import EventViewer

	# Put your plugins code here

	if __name__ == '__main__':
		w = EventViewer.EventViewer()
		w.run()