Testbeam Extensions to SCTDAQ |
Contents |
Introduction |
During 1999 the systemtest and module-testing elements from the RAID sctdaq were ported to a PC system, and have now evolved into the core of the SCTDAQ environment. This SCTDAQ uses much faster, commodity processers, a modern language and compiler (MS Visual C++), a modern analysis and macro package (ROOT), and perhaps most importantly provides site-independence. The RD13 package is heavily linked to commercial licenses and specific database servers making its use outside CERN extrememly difficult. For these reasons, we decided to expand the SCTDAQ to include the full set of testbeam hardware readout and a simplified testbeam acquisition algorithm and buffer management system. This work was started in late 1999 and first used at the December 1999 testbeam at KEK.
User Online Instructions |
To start a session, first start ROOT, eg, from a desktop icon. Then execute the following functions from the main ROOT command-line window or menubars:
.X ST.cpp [Loads and executes the basic SCTDAQ environment Creates the main sctdaq object "e" All SCTDAQ public variables and functions are now available, including calibration *** Do an "ExecuteConfigs" from the main SCTDAQ menubar to initialise the SCT hardware .L TB.cpp [Loads the testbeam macro TB.cpp] TBStart() [Initialises the hardware, books histograms etc., and creates the main testbeam object "t"] *** Do any further configuration here TBRun() [Starts a run]Note that TBRun() automatically increments the run number, and prompts the user for some descriptive information. However, TBRun() does not change any conditions; the run conditions must be established by executing explicit commands between runs.
Also note that at present a run cannot be interrupted except by using Control-C to kill the ROOT session. This is harmless, but does mean that the full initialisation must be repeated to re-start data-taking.
All of the SCTDAQ standard variables and functions are available from the usual buttons or by invoking member functions of the object "e". As well, some testbeam variables may be modified between runs by invoking member functions of the object "t" including:
t->SetTriggerDelay(int new_delay); t->SetEventsRequested(int new_req); t->SetScanDescription(int new_typ, float new_val);An alternative to TBRun() is TBScan(type,start,stop,step) which performs a series of runs while scanning any one of the SCTDAQ variable types (eg, 1 for threshold) from the [start] to [stop] in steps of [step]. This is intended for quick surveys of module performance.
Monitoring Plots and Information. |
Histograms are presented in various canvases including:
Configuration |
Configuration of the testbeam extensions is done primarily by editing the run macros in the file TB.cpp, or by explicitly executing the member functions such as those listed above.
Software Installation |
These files and directories may be obtained from the atlas.wgs in the same place as the basic SCTDAQ files, although at present they are not available under CVS.
Each of the libraries should be built in turn, first the IRAM, V262 and TDC, then tblib, then tbdll. The settings for MS Visual C++ etc. are much the same as for the main SCTDAQ.
Importantly, since installations of ROOT may vary, the source files tbdll\tbdll_cint.cpp and tbdll_cint.h should be regenerated by executing the batch file maketbdict,bat located in the tbdll directory.
On occasion it may be necessary to re-specify the ROOT static libraries. These should be located in the root/lib directory, e.g., C:\root\lib. First open the tbdll workspace file tbdll\tbdll.dsw in MS Visual C++. In the "FileView", left-click on "Library files". Delete all files with names commencing "Root_". Then right-click on "Library files", and open "Add Files to Folder". In the resulting dialog box, select all the root static library files, e.g., from C:\root\lib (you have to change the file extension type to ".lib"), and restore them to the project workspace file.
The run macro TB.cpp should also be copied from tbdll into a directory
in the ROOT search path, e.g., sctdaq\stdll.
Offline Version |
To run the online monitor analysis code on events read from a data file, first initialise the system by executing at the ROOT prompt:
TBStart()then call
TBOffline(NNN, num_events)This will read and analyse [num_events] events from the data file for run NNN, tbrunNNN.dat where NNN is the integer run number, which should be in the default data directory, e.g., D:\sctvar\data.
Testbeam Hardware |
A number of NIM and VME modules in addition to those standard in the SCTDAQ package have been used in the testbeam version. These include:
Another key set of hardware items is the CAEN V262 I/O unit coupled with a standard NIM dual-timing unit, e.g., a CAEN N93, with its output pulse length set to "Infinite" (i.e., stays active until it receives a Reset pulse). The V262 provides an interface between the software and the "real" world. It has several NIM input levels (used for monitoring various system states), several NIM output levels (used for controlling various system states), and several NIM output pulses ("SHP", shapes).
The controls used in SCTDAQ are:
Note that the software is also polling the other inputs and can take appropriate action. The HARDWARE BUSY is a logical OR (made by a NIM logic fan-in) of the hardware busy outputs of all the readout modules. The accelerator SPILL is the state of the beam cycle; it is used as another busy, so that triggers are prevented out-of-spill. Once the software has detected the end of a spill, it drains all readout modules of unread events, and then performs all the necessary event formatting, recording of data to disk, monitoring analysis and update of histogram displays. All of this activity is deferred until the spill has ended so as to minimise deadtime during the spill.
Logical Schematic |
VME Addresses |
At present it is assumed that the four windows are mapped for CLOAC (512k A24), SLOG and Mustard (A32), SCTLV (A24, fixed location) and IRAM (A16). BiLED is not yet supported in tblib. The IRAM units require both A16 and A32 space, the A32 space being sited within the generic SLOG A32 window.
Module Name | Space | Range |
CLOAC (A24) | A24 | 0x880000 - 0x8fffff |
TDC | A24 | 0x8a0000 - 0x8affff |
V262 | A24 | 0x8b0000 - 0x8bffff |
SLOG0 (A32) | A32 | 0x1800000 - 0x181ffff |
MUSTARD0 | A32 | 0x1900000 - 0x19fffff |
IRAM-A32 | A32 | 0x1d00000 - 0x1efffff |
IRAM-A16 | A16 | 0x4000 - 0x8fff |
SCTLV | A24 | 0xff0000 - 0xffffff |