SpecTcl Programming Guide.

Ron Fox


Table of Contents
1. Introduction
2. The SpecTcl processing model.
3. The SpecTcl event processing pipeline.
3.1. Event Processors
3.2. Setting up an event analysis pipeline (the simple version)
3.3. Playing back filter data
4. The SpecTcl API
4.1. The API and the parameter dictionary
4.2. The API and the spectrum dictionary
4.3. The API and the gates dictionary
4.4. The API and the event processing pipeline
4.5. The API and the event sink pipeline
4.6. The API and SpecTcl Objects.
5. The SpecTcl event sink pipeline.
6. libTcl++ and adding commands to SpecTcl
7. Extending SpecTcl spectrum file formats
7.1. SpecTcl's spectrum file format infrastructure
7.2. Adding a file format to SpecTcl
7.3. Adding a CSV file format to spectrum read/write
8. Extending SpecTcl's filter file formats
8.1. Filter formatting objects.
8.2. Example filter formatter.
9. Extending the set of SpecTcl fit types.
9.1. Classes and objects of the fitting subsystem.
9.2. Adding a new fit type
10. Interfacing SpecTcl with data from other data acquisition systems.
10.1. The classes involved in getting data from source to analyzer
10.2. Step by step recipe for adding support for a new data format
10.3. Worked example for supporting a new data format
11. SpecTcl plugins
11.1. Writing and publishing compiled Tcl packages
11.2. Distributing the SomeDaqBufferDecoder as a plugin
List of Figures
2-1. SpecTcl processing model
10-1. SpecTcl event decode process
List of Examples
3-1. CEventProcessor definition
3-2. Our event processor header.
3-3. Constructor for MyEventProcessor
3-4. OnAttach
3-5. OnInitialize - Set up the tree parameters.
3-6. State transition processing
3-7. Event processor operator() method.
3-8. Event processor OnOther
3-9. OnEventSourceOpen and OnEventSourceEOF
3-10. SpecTcl Makefile modifications
3-11. Creating a static event processing pipeline
3-12. Event analysis pipeline for filters.
4-1. Using the API to access parameter definitions
4-2. The projection class header
4-3. Header for an event processor that fills in a spectrum.
4-4. FillImage event processor constructor
4-5. FillImage::operator() implementation
4-6. GateProcessor header.
4-7. GateProcessor constructor implementation
4-8. GateProcessor::OnInitialize implementation
4-9. GateProcessor::operator() implementation
4-10. Class to switch event analysis pipelines
4-11. EVPSwitcher constructor and destrutor
4-12. EVPSwitcher::save implementation
4-13. EVPSwitcher::restore implementation
4-14. EVPSwitcher::useFilterProcessor implementation
4-15. Listing the event sink pipeline elements
5-1. Event sink processor header
5-2. EventCounter constructor implementation
5-3. EventCounter::operator() implemntation
6-1. Definition file for event processor switcher.
6-2. EVPSwitchCommand constructor implementation
6-3. Implementation of EVPSwitchCommand::operator()
6-4. Implementation of subcommand processors
7-1. CSVSpectrumFormatter header
7-2. Implementation of writeScanline method.
7-3. CSVSpectrumFormatter::Write implementation
7-4. CSVSpectrumFormatter::Read implementation
8-1. CFilterOutputStage class definition
8-2. CFilterOutputStageCreator specification
8-3. CFilterOutputStageFactory definition
8-4. Definition of CSVFilterOutputStage
8-5. Implementation of open and close for CSVFilterOutputStage
8-6. Implementing CSVFilterOutputStage::DescribeEvent
8-7. Implementing CSVFilterOutputStage::operator()
8-8. Implmenting CSVFilterOutputStage::type
8-9. Definition of CSVFilterOutputStageCreator
8-10. Implementation of CSVFilterOutputStage
9-1. CFit class definition
9-2. CFitFactory class definition
9-3. CFitCreator class definition
10-1. CFile class definition
10-2. CAnalyzer base class definition
10-3. The CBufferDecoder abstract base class
10-4. BufferTranslator.h important bits:
10-5. CCreator definition
10-6. Structure of data from SomeDaqSystem
10-7. SomeDaqBufferDecoder header.
10-8. SomeDaqBufferDecoder::operator() implementation
10-9. Implementation of SomeDaqBufferDecoder::stateChange
10-10. Implementation of SomeDaqBufferDecoder::scaler
10-11. Implementation of SomeDaqBufferDecoder::event
10-12. Implementation of SomeDaqBufferDecoder::other
10-13. Implementation of SomeDaqBufferDecoder::translateItemType
10-14. Trivial getter implementations
10-15. Not as trivial getters:
10-16. Header for SomeDaqDecoderCreator
10-17. Implementation of SomeDaqDecoderCreator
11-1. Plugin initialization for the sample daq decoder plugin
11-2. Makefile that can produce the plugin