Running the Pibeta Analyzer

Test run

A 1998 data file from run 10229 has been installed on the UNIX cluster for test purposes. This file is located under /projects/ritt/run10229.mid and can be read in directly be the analyzer. After you compiled the analyzer correctly, start it with following paramter:
$ analyzer -i /projects/ritt/run10229.mid -n 1000
This analyzes the first 1000 events from that file. Next, you can analyze this file and create an HBOOK RZ file. By default, all banks (raw and calculated) are written to the RZ file which makes it very large. In most cases, you are only interested in the "physics" banks but not in the raw (encoded) data. Therefore, most banks can be turned off. This can be achieved by setting /Analyzer/Bank switches/ to zero manually. A default collection of banks has been defined in bank_switches.odb in the analyzer directory. Load this now with ODBEdit:
$ odbedit
[local]> load bank_switches.odb
[local]> ls /Analyzer/Bank switches
Since the ODB is persistent, the settings are kept even after ODBEdit or the analyzer finish and will be used for the next runs.

Now, you can produce an RZ file with the banks TRIG, CADC, THIT, ASUM, MWPC and ACUM:

$ analyzer -i /projects/ritt/run10229.mid -o run10229.rz -n 1000
This produces a column-wise N-tuple file run10229.rz. It has a HBOOK record size of 8190 words. Therefore, you have to load it in PAW with
PAW> hi/file 1 run10229.rz 8190
With nt/print 1 you can see that all values from banks CADC, MWPC and THIT are present as N-tuple variables. Each bank was automatically converted to a "block".

To analyze your own files, get them from the archive to your own directory:

$ ftp psarchive 1021

ftp>cd pibeta98/data
ftp>get runxxxxx.mid

where xxxxx is the run number. Since the disk space under /projects is 
limited, only very few runs can be kept there. If several people are
working at the same time there, it might happen that someone else has
already copied a file to /projects//. Since these files are
group readable, one can easily use the file from someone else if it is

Command line parameters

Following command line parameters are supported by the analyzer:

-h [hostname]

MIDAS host to connect to when running the analyzer online. Not used during offline analysis.

-e [experiment]

MIDAS experiment to connect to. Not used during offline analysis.

-i [filename1] [filename2] ...

Input file name(s). Up to ten different file names can be specified in one -i statement. File names can contain the sequence '%d' which gets replaced by the current run number in conjunction with the -r flag. Following extensions are recognized by the analyzer: .mid (MIDAS binary), .asc (ASCII data), .mid.gz (MIDAS binary gnu-zipped) and .asc.gz (ASCII data gnu-zipped).

-o [filename]

Output file name. The file names can contain the sequence '%d' which gets replaced by the current run number in conjunction with the -r flag. Following file formats can be generated: .mid (MIDAS binary), .asc (ASCII data), .rz (HBOOK rz file), .mid.gz (MIDAS binary gnu-zipped) and .asc.gz (ASCII data gnu-zipped). For HBOOK files, CWNT are used by default. RWNT can be produced by specifying the -w flag.

-r [range]

Range of run numbers to be analyzee like "-r 120 125" to analyze runs 120 to 125 (inclusive). The "-r" flag must be used with a '%d' in the input file name.

-n [count]

Analyze only "count" events. Since the number of events for all event types is considered, one might get less than "count" trigger events if some scaler or other events are present in the data.

-n [first] [last]

Analyze only events from "first" to "last".

-n [first] [last] [n]

Analyze every n-th event from "first" to "last".

-c [filename1] [filename2] ...

Load configuration file name(s) before analyzing a run. File names may contain a '%d' to be replaced by the run number. If more than one file is specified, parameters from the first file get superseeded from the second file and so on. Parameters are stored in the ODB and can be read by the analyzer modules. They are conserved even after the analyzer has stopped. Therefore, only parameters which change between runs have to be loaded each time. To set a parameter like "/Analyzer/Parameters/Global/ADC threshold" one would load a configuratin file which contains:
ADC threshold = FLOAT : 5
Loaded parameters can be inspected with ODBEdit after the analyzer has been started.

-p [param=value]

Set individual parameters to a specific value. Overrides any setting in configuration files. Parameter names are relative to the /Analyzer/Parameters directory. To set the key "/Analyzer/Parameters/Global/ADC threshold" to a specifig value, one uses -p "global/ADC threshold"=12.5. The quotation marks are necessary since the key name contains a blank. To specify a parameter which is not under the /Analyzer/Parameters tree, one uses the full path (including the initial "/") of the parameter like -p "/Experiment/Run Parameters/Theta Swing"=63.4.


Produce row-wise N-tuples in outpur .rz file. By default, column-wise N-tuples are used.


Convert only input file to output file. Useful for format conversions. No data analysis is performed.


Debug flag when started the analyzer from a debugger. Prevents the system to kill the analyzer when the debugger stops at a breakpoint.

S. Ritt, 2 May 1997