This chapter describes what NSCL SpecTcl is and, just as important, what it is not. In this chapter you will learn the minimum you need to get started with SpecTcl.
The material we will cover includes:
A description of what SpecTcl is and is not
The minimum you need to know to customize SpecTcl to analyze your data.
How to create and view spectra, and conditions and how to apply these conditions to spectra, as well as how to save spectra to file and read them back in.
An introduction to the treeparameter package. This package was originally written by Daniel Bazin as an add on package. It is now part of the supported SpecTcl software base. Tree parameter allows you to impose a hierarchical structure on your unpacked parameters and steering variables
NSCL SpecTcl is a Histogramming application framework. By adding code to the framework in well defined gluepoints, you extend SpecTcl to do your first stage data analysis. SpecTcl is also an extension of the Tcl/Tk scripting language. Because SpecTcl is based on Tcl/Tk you can easily create custom graphical user interfaces for SpecTcl that provide an appropriate application specific functionality. While SpecTcl is closely associated with the NSCL data acqusition system, it is, in fact a separate product and has been used to analyze data from other data acquisition systems. SpecTcl uses the Xamine viewer to view spectra you have created.
SpecTcl is not a stand-alone program like Root or Paw. It is not intended for late stage data analysis (yet). We feel that there are already perfectly good tools 'on the market' for that. What SpecTcl does allow you to do is to use a minimum of programming to get spectra out of your data.
NSCL SpecTcl is an application framework. Application frameworks turn the main-program/library programming model upside down and inside out. In the main-program/library programming model, you write program and call library functions as needed to get your work done. While the library functions may perform significant functionality, the flow of control through your program is something you are responsible for.
For simple programs, getting the flow of control to be correct is not a major problem. As the control flow gets more complex, however, this becomes harder and harder. A program like SpecTcl must be able to respond to several different types of external stimulii from several sources. The application framework programming model seeks to relieve you of this pressure. Application frameworks include the main program and provide the control flow. Application programs have glue points at which you can extend the framework.
Extensions attached to glue points of the framework get called at specific, well defined times in the control flow of the framework. Thus you can think of an application framework as a program in search of libraries.
SpecTcl is a command driven application framework. This may seem odd in today's world where a graphical user interface is considered essential part of any program. SpecTcl's command language, howeve is a powerful scripting language called Tcl/Tk. Tcl/Tk is a scripting language that is built to be extended. SpecTcl extends this language to provide commands that manipulate the objects that a typical histogramming engine must keep track of, parameters, spectra, conditions, gates and much much more.
The Tk component of Tcl/Tk provides a simple way to script user interfaces. This capability allows you to create your own user interfaces, or to extend the one that SpecTcl provides by default [1].
SpecTcl itself does not provide a mechanism to view and interact with the spectra it creates. A Motif application called Xamine provides visualization and interaction support for its clients.
| [1] | Well actually, SpecTcl provides two graphical user interfaces. One descended from the tree parameter GUI originally written by Daniel Bazin, the other a direct manipulation GUI available since version 3.1 |