Chapter 2. Setting up the software
cd ~/experiment/spectcl
cp /usr/opt/spectcl/current/Skel/* .
2.2.2. How to modify the skeleton to unpack events.
SpecTcl relies on a logical pipeline of event processors to unpack data from the raw event into
parameters. Each event processor has access to the raw event, and an output array-like object. This
provides each event processor with access to the raw event and any data unpacked by event processors
that are ahead of it in the pipeline.
Daniel Bazin has written an extension to SpecTcl called TreeParam. This extension superimposes
structure on top of the array-like output object which makes access to the event array much more natural.
Beginning with SpecTcl version 3.0, the TreeParam extension has become a supported part of SpecTcl.
Dr. Bazin’s TreeParam software also includes a very nice front end Graphical User Interface (GUI) for
SpecTcl that makes the creation and manipulation of spectra, gates and other SpecTcl object much more
user-friendly than raw SpecTcl. This GUI was also incorporated into the base SpecTcl program
beginning with version 3.0, it has been extensively modified for version 3.1.
In order to unpack data from our event segment, we need to write an event processor that:
• Declares the appropriate tree parameter members.
• Locates a packet with our packet id (0xff00).
• Unpacks the data in that packet into the appropriate treeparameter members.
Our event processor MyEventProcessor is defined in the file MyEventProcessor.h, and
implemented in MyEventProcessor.cpp. The header looks like this:
Example 2-3. MyEventProcessor.h - header for the event processor.
#ifndef __MYEVENTPROCESSOR_H
#define __MYEVENTPROCESSOR_H
#include <EventProcessor.h> // ➊
#include <TranslatorPointer.h> // ➋
#include <histotypes.h> // ➌
// Forward class definitions:
class CTreeParameterArray;
17
Comentários a estes Manuais