Testbeam Extensions to SCTDAQ |
Contents |
Introduction |
User Online Instructions |
Before starting a session, execute "RESMAN", the VME interface resource manager. Yo ushould do this anyway even if it doesn't appear to be necessary since the testbeam uses more than VME crate. To start a session, first start ROOT, eg, from a desktop icon. On the testbeam DAQ PC (pcatsct01) there is a ROOT icon labelled "TB" which starts the system. Otherwise, start ROOT, then start the sctdaq system:
.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, Answer the "database" question with your 3-letter initials, and accept with the "1". *** Do an "ExecuteConfigs" from the main SCTDAQ menubar to initialise the SCT hardware. Do "TriggerBurst" to check that all modules are responding, and "DCS->Log" to check temperatures and currents. Do "HVRampUp" even if the HV is already ramped from a previous session. THis is give sctdaq the current settings. .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] or TBBiasPoint(150,350) [Sets detector biases to 150 (unirradiated) or 350 (irradiated), and does a threshold scan.] or TBSetBias(150,350) [Sets biases) TBSpecialSelect(10000) [Restarts an interuppted threshold scan for 10000 events per point, prompting the user for the setting to start from.]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);In addition to TBRun(), a number of scan macros have been developed which allow scans of multiple runs with programmed changes in scan variables. These include TBScan(type,start,stop,step) which performs a generic scan over any of the available SCTDAQ variable types (eg, 1 for threshold) from the [start] to [stop] in steps of [step]. TBSpecial() is another macro which implements a standard threshold scan with a tailored list of thresholds and numbers of events. These scan macros have significantly improved data taking efficiency since very little time is lost between runs
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 |
Each of the libraries should be built in turn, first the IRAM, V262, V550 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 before each new build 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.
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 |