Pad Monitor for BRAHMS

Contents:

Introduction

This document is meant as a users guide to the Padmonitor program for the BRAHMS TPC's. Details about the actual code can be found here.
The program was originally written by Joachim Schambach, (jschamba@physics.utexas.edu) and was later modified by Lucas Pereira, (lucasp@sseos.lbl.gov) to be used in STAR. Modifications and new features have been added for the use of BRAHMS by Allan G. Hansen, (aghansen@nbi.dk).
Some of the features described here are only relevant to STAR, but may be useful to BRAHMS later.

Getting Started:

The executable is ./padm/bin/padm. It takes no command-line arguments.

To run the pad monitor, you must set the environment variable XENVIRONMENT. This variable should specify the name of the attribute file. For example, to use the default (supplied) file, type:

setenv XENVIRONMENT ./padm/wrk/PadMonitor.ad

Alternatively, the X-Windows software will look for a file called PadMonitor in your home directory, if your XFILESEARCHPATH environment variable is setup correctly.

The PadMonitor.ad file controls the colors of the padmonitor histograms and points to a configuration file, which specifies the layout of the padplane and details about the data. The default file in PadMonitor.ad is ./padm/wrk/.ConfigurationFile. Should the program not find the PadMonitor.ad file it will look for the configurationfile .ConfigurationFile in the directory where the program is called from. If no configuration file is found, the program will stop.

NOTE: Some entries concerning the padplane setup must be set in the configuration file, otherwise the program will not work properly. See more on this in the Configuration File section.

Since BRAHMS has different TPC's, different configurationfiles will be needed. To make an easy userfriendly environment a small setup program can be used together with the padmonitor program. The setup program is ./padm/bin/select and can be used independently of the padmonitor. The program pops up a window as seen below, and a TPC can then be selected with the mouse.

When Continue is pressed the select program generates a file tpc.dat with the name of the chosen TPC and the program then closes. The padmonitor now looks for a configuration file with the name of the chosen TPC as an extension to the configuration file name. If for example the name of the configuration file is specified as .Configuration the padmonitor program now looks for a file called .Configuration_TPC1, if TPC1 has been selected. The select program can be used in combination with the padmonitor program simply by running ./padm/bin/Padmonitor which is just a small commandfile that first calls select and then padm. Using the select program is optional, the padmonitor can be run without this if prefered.

If everything is OK the main window will fill out the screen showing the padplane, the histograms and the following menu:

The pad monitor is designed to have interchangeable I/O routines, while the overall interface remains much the same. To read in data, you should go to "File -> Open File" from the menu. A dialogue box will pop up, and you select the name of the data file you wish to open. An example datafile can be found in ./padm/doc/ with the name tpc_out.dat (see more on this in the I/O Formats section).

After you select an input file, click on OK. Click on "Get Event" (either from the "File" menu or from the button on the left side of the window.) The pad monitor will read in an event of data and display it on the screen.

Adjusting the Cuts:

After you read in the data, you can set the upper and lower cutoffs on pulsheights (ADC value) with the two sliders on the left side of the window. Pads that are below the minimum cutoff appear light blue, pads above the maximum cutoff appear rusty brown, and pads between the two cutoffs are green.

The max/min cutoffs have several different modes. To change modes, go to the "Edit" menu, and select one of the three modes:

Using The Histograms:

There are two histograms at the bottom of the screen. They both plot the ADC value of a single pad vs. time bin.

The content of the Left Histogram is controled by the padplane. With the left mouse button you can select from the padplane, which pad to display on the histogram. When you click on a pad, an indicator (bright red rectangle) will be drawn around the selected pad:

The pad row/number will appear over the histogram, and it will plot value vs. time.
NOTE: When there is no time bucket data for the selected pad,the histogram will have nothing to draw.

The Right Histogram is meant as a "backup" histogram which makes it possible to compare histograms for different pads and/or different events. The layout for the right histogram is exactly the same as for the left.

Selecting an Area:

The pad monitor allows the user to select (highlight) an area of the TPC. This area can be any subset of the pads.

The middle and right mouse buttons are used to select an area. The middle button is used to "positively select" area. This means that, when you drag the middle mouse button, it will create a rectangle. When you let go of the middle mouse button, every pad that touches this rectangle will become selected. You can do this multiple times, and the total selected area will be the union of all the rectangles.

The right mouse button is used to "negatively select" area. This means that, when you drag the right mouse button, it will create a rectangle. (This rectangle uses a dashed line, rather than a solid line, to signify that it subtracts rather than adds to the selected area.) When you let go of the right mouse button, every pad that touches this rectangle will become deselected.

You can actually select two areas at the same time. These areas are called "area 1" and "area 2". Area 1 is the default area -- when you first start up the pad monitor, the middle and right mouse buttons will affect area 1. If you wish to select area 2, go up to the "Select Area -> Select Area 2" menu option. Now the mouse buttons will affect area 2. Use "Select Area -> Select Area 1" to get back to working with area 1.

To help remind you whether you're currently selecting area 1 or 2, there are three boxes on the left side of the screen. These three boxes represent the function of each of the three mouse buttons. When you first start up the pad monitor, the three boxes will say "Hist.", "+Area1", and "-Area1". The three buttons are also shaded with the appropriate highlighting color. When you switch between selecting area1 and area2, the text and color of these buttons will change.

Finally, there are a number of options under the "Select Area" menu:

Action Menu:

In the "Actions" menu there are 3 items:

Configuration Files:

There are two files that the pad monitor needs in order to be able to run correctly. The first file is the Motif resource file. An example of this file is given in ./padm/wrk/PadMonitor.ad. This file lists several color choices that can be changed as the user prefers it. Most importantly, though, it also lists the location of the configuration file for the TPC.

An example of the configuration file is ./padm/wrk/.ConfigurationFile.

The configuration file may include the following fields, each field is followed by an argument:

To make the program run properly the following fields must be specified in the configuration file:
The other fields will be asigned a default value if they are not specified. Following default values will be used:

I/O Formats:

The padmonitor so far only supports reading data from file (BRAHMS). This file should have the following binary format:


	+----------------+		- start file
	| file ID        |	int
	+----------------+		- eventheader
	| event number   |	int
	| number of hits |	int
	+----------------+		- padheader
	| pad number     |	int
	| number of bins |	unsigned char
	| first bin      |	unsigned char
	+----------------+		
	| bin 0 ADC      |	unsigned char
	| bin 1 ADC      |	 ...
	| 	...      |
	| bin n ADC	 |
	+----------------+		- next eventheader 
	|       ...      |
        |                |

The first two bloks of an event (eventheader and padheader), are defined as structures . The ADC values are here shown as being of type char. If however the program is running with "Bits" larger than 8, the type should be "short". Currently the program only handles 1 byte ADC values, corresponding to "Bits 8". If two bytes ADC values are used, some minor modifications must be made in the function that reads in the events (see details here).

A Monte Carlo input file, specially for the padmonitor, can be created from SONATA. When the SONATA package i compiled with the preprocessor option -DPADM, a file called tpc_out.dat is created when events are processed in SONATA. The file will contain the digitized TPC response following the above data format.
Note: the tpc_out.dat file should be removed after each SONATA run, otherwise the new events will be written in the existing file and mess up the structure.

Troubleshooting:

Here is an overview of some of the common problems that you may encounter when running the pad monitor:

If you get the message:

No Configuration File. Quitting ...

when you try to run the pad monitor, then the program is unable to find the Configuration file. Check to make sure that:


Latest update 24.07.97
Allan G. Hansen, aghansen@nbi.dk