Recovering Scaler Data in SpecTcl. |
SpecTcl Home General Information User Guide Programmer's Guide Obtaining and Installing
This page describes how to make scaler data available to your SpecTcl data analysis software. The software described on this page assumes that your event data is in NSCL data buffer format.
The remainder of this page describes:
The scaler event processer is highly compatible with the scaler display sclclient feed program. It maintains the following variables and arrays:
Variable | Type | Initialized to | Contains |
---|---|---|---|
Scaler_Totals | Array of floats | zeroes | Scaler totals for the run so far |
Scaler_Increments | Array of ints | zeroes | Increments from the last scaler read |
ScalerDeltaTime | Integer | zero | The number of seconds of run time covered by the most recent event scaler read interval. |
ElapsedRunTime | Integer | Zero | The elapsed active time in the run in seconds |
RunNumber | Integer | -1 | The run number of the active or most recently ended run |
ScalerRunState | Text | The current run state. Note that the name of this variable is different than the corresponding variable in the scaler display subsystem (RunState). This is because standard SpecTcl uses the the variable RunState in an incompatble manner. | |
RunTitle | Text | The title of the active or most recently ended run. |
In addition to maintaining these variables, the scaler event processor will invoke Tcl procedures at significant times if they have been defined. The Tcl procedures should be defined to take no parameters and are defined in the table below:
Procedure | When invoked |
---|---|
Update | Data has been updated. If you maintain computed data based on tde raw data produced by the event processor you should update the computed data at this time. |
BeginRun | A begin run buffer has been received and processed. |
EndRun | An end run buffer has been received and processed. |
PauseRun | A pause run buffer has been received and processed. |
ResumeRun | A resume run buffer has been received and processed |
This section provides a step by step recipe for adding scaler data processing to your tailored SpecTcl. The Scaler data processing is implemented as an event processor. To enable it you must therefore:
This discussion assumes you already know how to run make to rebuild your SpecTcl.
The Scaler event processor is defined in the header ScalerProcessor.h. The fragment of MySpecTclApp.cpp shown below shows this header incorporated into that module:
#include <config.h> #include "MySpecTclApp.h" #include "EventProcessor.h" #include "TCLAnalyzer.h" #include <Event.h> #include <ScalerProcessor.h> //-- this line added.
static CFixedEventUnpacker Stage1; static CAddFirst2 Stage2; static CScalerProcessor ScalerStage; //-- this line added.
void CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer) { #ifdef WITHF77UNPACKER RegisterEventProcessor(legacyunpacker); #endif RegisterEventProcessor(Stage1); RegisterEventProcessor(Stage2); RegisterEventProcessor(ScalerStage); //--- This line added. }Top
Last modified: Fri Feb 18 14:04:52 EST 2005 by:
fox@nscl.msu.edu
© Copyright NSCL 1999, All rights reserved