Writing a class derived from CEventProcessorSetting Up SpecTclGetting a Copy of the SpecTcl Skeleton FilesModifying the SpecTcl Skeleton Files

Modifying the SpecTcl Skeleton Files

Throughout we will build on the readout example in Setting Up Readout.

The figure below is a block diagram that shows how SpecTcl operates with your code to sort data into histograms.

SpecTcl's event processing model
 

An event source sends events to a buffer decoder. Buffer decoders know about the general structure of an event buffer and use that knowledge to make appropriate calls to an analyzer object. The analyzer object passes events one at a time to a pipeline of EventProcessor objects. These EventProcessor objects are written by you.

Each event processor in the pipeline has available to it, the raw event as well as parameters that have been decoded, calculated or otherwise generated by event processors located earlier in the pipeline. The event processors produce an array like object that SpecTcl calls an CEvent. The CEvent contains the "interesting" parameters you. The CEvents are then passed to the histogrammer which uses parameter definitions, spectrum definitions, gates and their applications to determine which histograms to increment for each event.

Our job will be to write an event processor (the bottom part of the figure SpecTcl's event processing model ) that will take our raw event structure and produce a parameter list for SpecTcl. We will be unpacking the event structure shown in the figure Sample Event Structure

To reach our goal we must:

[ ]Write a class that inherits from CEventProcessor, at a minimum, it's operator() must be defined and written.
[ ]In MySpecTclApp.cpp, create an instance of the class and register it.

Note that at least one of the event processors in the pipeline must also determine and indicate the total event size to SpecTcl.


Report documentation errors to Ron Fox (fox@nscl.msu.edu)or NSCL's Bugzilla page

Writing a class derived from CEventProcessorSetting Up SpecTclGetting a Copy of the SpecTcl Skeleton FilesModifying the SpecTcl Skeleton Files