SpecTcl creates several global variables. These variables may be useful when writing scripts for SpecTcl. This section describes the variable SpecTcl creates.
The SpecTcl global variables fall into two groups.
Variables that describe SpecTcl and its processing and performance limitations
Variables that describe SpecTcl's state and performance.
SpecTcl processing/limit variables. The table below describes the SpecTcl processing/limit variables. If the variable must be defined in SpecTclInit.tcl this is also indicated:
Table 8-1. SpecTcl processing and limit variables
| Variable | Description |
|---|---|
| DisplayMegabytes | Determines the size of the spectrum shared memory region. This determines the number of megabytes worth of spectra that can be added to Xamine memory via the sbind command. This variable can only be set in SpecTclInit.tcl |
| EventListSize |
SpecTcl histograms groups of events by
sending event lists
to its histogramming engine. The
Regardless of the value of |
| ParameterCount |
SpecTcl event objects are dynamically resized
as needed to supply enough slots to hold
all parameters.
|
| SpecTclHome | This variable should be treated as read-only. SpecTcl initializes it on startup to the top level directory of the SpecTcl installation directory. You can use this to locate other files in the SpecTcl directory. e.g. the Script directory of SpecTcl is:
set scriptDir [file join $SpecTclHome Script]
|
| SpecTclIODwellMax |
Determines how many milliseconds, SpecTcl
will wait for data from a data source before
returning to the Tcl event loop. If the user
interface is sluggish, this can be decreased.
|
| splashImage | This file is the name of an image file that contains the SpecTcl splash image. If you would like to substitute your own splash image for the SpecTcl splash, modify this in SpecTclInit.tcl. |
Performance variables. Several variables are maintained by SpecTcl so that you can get performance information. These variables should all be treated as read-only. The table below describes these variables:
Table 8-2. SpecTcl performance/statistics variables.
| Variable | Description |
|---|---|
| BuffersAnalyzed |
This variable should be treated as a
readonly variable. At the beginning of
run it is zeroed. Each time an event
buffer is accepted, it is incremented.
Along with |
| LastSequence | Buffers from the NSCL data acquisition system include a sequence number. The sequence number is reset at the beginning of the run and increments for each event buffer. When attached to an online data source, SpecTcl usually will only sample the set of buffers it can keep up with. The fraction of events analyzed during an online session can be estimated as: $BuffersAnalyzed/$LastSequence. Custom GUI's often periodically calculate and display this figure |
| RunNumber |
Each NSCL event file or online run has a
unique run number. The
|
| RunState | Reflects the state of analysis. This is boolean true if analysis is active or boolean fals if not. Note that this is not the same as whether or not the run is active in an online data source. The only way to know that is by keeping track of the set of begin and end buffers seen by SpecTcl. |
| RunTitle |
NSCL event files contain a text string
that provides a title to the run.
|
| Statistics | This is an array that is not completely implemented. The array elements contains counters of various sorts. The array indices, available via array name Statistics are pretty self descriptive. With SpecTcl 3.2, however, you will have to play a bit with this to see which counters are actually maintained at this time. Future releases of SpecTcl will implement all counters. |
Tree Variables. In The C++ part of TreeParam, we introduced Tree Variables. Recall that a Tree Variable is a Tcl variable that is bound to an object that behaves like a float that has units attached to it. Each Tree Variable is therefore a Tcl variable. We will see in the SpecTcl Command Reference that the treevariable command can dynamically create new tree variables as well.