Hopefully by now you've gotten the impression that scripting SpecTcl is just writing a Tcl script except that SpecTcl provides additional variables, which we described in the previous section, and addition commands, which we will describe in the SpecTcl Command Reference chapter. This section will give a list of the SpecTcl commands broken down by functional categories. The online version of this work will have links from each command to its reference page.
In some cases, commands will appear in more than one category. This is done because you may wind up thinking about command categories differently than I do. Hopefully this will be helpful rather than confusing.
Spectrum Display.
In SpecTcl 3.2, spectra can be viewed via the Xamine displayer.
Daniel Bazin has written an alternative to Xamine called
SpecTck.
If you want to use this displayer you should contact
<bazin@nscl.msu.edu> for more information.
Xamine shared spectra with SpecTcl via a fixed sized shared memory
region. The size of this memory region is set by the
value of the DisplayMegabytes Tcl variable, which
can be set in SpecTclRC.tcl. The commands in the
table below can affect the Xamine display.
Table 8-3. Spectrum Display commands
| Command | Description |
|---|---|
| fit | Computes and displays a fit on a spectrum. If the Spectrum is bound to the Xamine displayer, the fit is displayed on the spectrum. |
| gate | Crates gates. While gates are created on parameters (primitive gates), and other gates (compound gates), where a spectrum is defined on the parameter(s) that make up a primitive gate, if possible, that gate will be displayed on the spectrum in Xamine. |
| sbind | Makes spectra available for display in Xamine. Until this is done, spectra remain internal to SpecTcl. |
| unbind | Removes a spectrum from Xamine and makes it private to SpecTcl. |
Event Source Control. SpecTcl analyzes data from an event source. Event sources are files or UNIX® pipes [1]. The commands listed in the table below select and control the event source.
Table 8-4. Event Source Commands
| Command | Description |
|---|---|
| attach | Selects the current eventy source for SpecTcl |
| start | Starts analyzing data from the current event source. |
| stop | Stops analyzing data from the current event source. |
Parameter commands. SpecTcl's abstraction of an event is that each event consists of a set of parameters. Each parameter has a name and an index. The concept is very much like the n-tuples of Paw and ROOT. Histograms and primitive gates are then defined on parameters. The table below lists the commands that operate directly on parameters.
Table 8-5. Parameter Commands
| Command | Description |
|---|---|
| parameter | Creates parameters, that is creates a correspondence
between an english parameter name and a slot in the
CEvent objects that hold parameters
unpacked or calculated from an event.
|
| pseudo | Creates or maniupluates a parameter that is calculated by executing a Tcl proc for each event. |
| treeparameter | Manipulates tree parameters. Tree parameters provide structure on top
of the CEvent array.
Introduction to
Treeparam described tree parameters.
|
Spectrum manipulation commands. Spectra are the usual Tcl products of analysis. Spectra are defined on a set of parameters. Spectra also have a gate applied to them which must be true for events to increment the spectrum.
Table 8-6. Spectrum Commands
| Command | Description |
|---|---|
| apply | Applies a gate to a spectrum. Once the gate is applied, the spectrum is only incremented for events that make this gate true |
| chan | Gets or sets channels of a spectrum. |
| clear | Clears the counts in one or all spectra. |
| integrate | Integrates a region of interest in a spectrum. |
| fit | Creates a fit on a spectrum. If the Spectrum is displayed in Xamine, the fit line is displayed. |
| project | Creates a new spectrum that is the projection of an existing 2-d spectrum. |
| spectrum | Creates spectra |
| sread | Reads a spectrum from file. Depending on how this is done, the contents of an existing spectrum may be ovewritten or a new spectrum generated. |
| swrite | Writes the contents of a spectrum to file, so that sread can read them back in to recreate the spectrum. |
Gate commands. Gates are SpecTcl conditional objects that have a value of true or false for each event. If a spectrum has a gate applied to it, the spectrum will only increment for events that make its gate true. The table below lists the commands that operate on gates.
Table 8-7. Spectrum Commands
| Command | Description |
|---|---|
| apply | Applies an existing gate to a spectrum. Once applied, the spectrum will only be incremented for events that make the event true. |
| fold | Uses a gamma gate to fold a gamma spectrum. |
| integrate | Integrates a region of interest in a spectrum. |
| gate | Creates a gate. Note that primitive gates can be created via Xamine. |
| project | Creates a new spectrum that is the projection of an existing 2-d spectrum. |
| ungate | Ungates a spectrum. That is removes any prior gate application. |
Saving and restoring stuff. The commands in the table below save and restore things. Analysis state save/restore is usually provided by procs defined by the GUI.
Table 8-8. Save/Restore Commands
| Command | Description |
|---|---|
| sread | Reads a spectrum that was written with swrite |
| swrite | Writes the contents of one or more spectra. The spectra can be recovered with the sread command. |
Miscellaneous commands. The table below lists commands that don't fit into nice categories (not that that has stopped me from listing some of them in the previous set of tables):
Table 8-9. Miscellaneous Commands
| Command | Description |
|---|---|
| filter | Creates filters which allow the creation of pre-sorted output event data. |
| fit | Creates fits on spectra. |
| treeparameter | Manipulates tree parameters |
| treevariable | Manipulates tree variables. |
| [1] | Older versions of SpecTcl supported analyzing data from Pre coupled cyclotron ANSI Labeled tapes. This feature has not been used and was therefore removed for quality control reasons. If you do need to do this, you can use the ltf facility to read your tapes to disk and then treat them as file event sources. |