Using the Gen01 Analyzer Engine ONLINE

(Conveniently hidden at

The following instructions require a working analyzer setup on one of the CDAQ computers!
See the setup instructions if none is available (


The analyzer engine decodes the raw detector data that were acquired during a run, event by event, and reconstructs (or attempts to) the kinematic parameters of the corresponding physics event. In addition, hardware scalers are decoded, accumulated and output in a readable format, and histograms are filled with various detector quantities.

The input consists of the raw data file, which is either on tape, on a cache disk, or still on the buffer disk in the counting house (ONLINE replay). The output is written to the screen (mostly status and error messages) and to file, as ASCII report files, PAW histogram file, and one or more Ntuple files.

Additionally, numerous setup files define various system parameters and processing options. Many of these quantities specify the environment under which the data were taken and change over the course of the experiment, even from run to run. A database system automatically selects individual parameter values, or sets of values, based on the sequential ID number of the run being analyzed. Even entire files of parameter values can be selected based on the run number. The main database definition is contained in the file DBASE/gen01.database.

The histograms created in the output are defined in the files contained in the HIST/ directory, the main file is HIST/gen.hist. Similarly, the reports generated are based upon the definitions in the Templates/ directory. The PARAM/ and DAT/ directories contain the bulk of parameter specifications, often with multiple versions that are selected by the database rules. The MAP/ directory contains the electronis maps, which define which detector element the individual electronic signals belong to. The files in Tests/ define various cuts which are applied in the filling of the histograms and also in the report creation. The source code which makes up the replay engine is in the SRC/ directory.

The resulting output files are placed in the directories output/,   paw/,   ntup/,   hv/ and cosmics/. The resulting Ntuples and histograms can be further analyzed using the PAW KUMAC scripts in the kumac/ directory.

The file REPLAY.PARM and the shell script replayup define these locations and other fundamental runtime variables.

Analyzing a Run in ONLINE Mode

In the following, we will use the commands appropriate for work on a Sun computer, as the online replay is intended to be done on computer CDAQS3. For replay on a Linux machine, the appropriate substitutions need to be made. More details on this can be found in the instructions for replaying offline (

Prior to running the analysis engine, its runtime environment must be set up. This is easily done via the platform-independent script replayup:
source replayup
This will define the approriate environment variables and create a local link to the correct location of the wish shell for the graphical progress monitor runstats. The replay can then be started using the command engine_SunOS.exe (see below for command line parameters).
To replay a run, you need to know its number! For example, to do an online replay of run 45678, execute
engine_SunOS.exe   grun=45678
Unless an error occurs, the replay will continue until the end of the run.

Two optional switches can be used to specify the first event in the run which is to be actually analyzed or to end the replay after a certain count of events has been analyzed (NOT event number): gstart= and gstop= , respectively. Be aware that these values refere to the hardware event number and that they will be adjusted upwards to then next scaler event.
In general, any parameter that can be defined in a setup file can also be defined on the command line, thereby overriding any file definition or parameter assignment.

For your convenience, two scripts are provided, which automatically select a different version of REPLAY.PARM and set appropriate command line parameters (e.g. gstop). These are:
charge_replay to process only the scaler events, for the entire run; output is placed in the charge/ subdirectory.
hist_replay complete analysis of the first 50,000 events; intended for online monitoring.