3.3. Playing back filter data

A SpecTcl filter is a mechanism that allows you to transform a raw data set into a decoded subset of the data. By decoded subset we mean that:

Since the structure of the raw event is lost, and since any parameter can be written to the output file, the event processing pipeline used to analyze data from a raw event file is not useful in analyzing filter files:

When analyzing filter files you must therefore:

In this section, we're going to look at how to set up the first element of an analysis pipeline that can analyze filter data. In the next section, we'll look at an extension to SpecTcl that allows you to dynamically switch SpecTcl between the analysis of raw data and filtered data.

SpecTcl provides an event processor that can decode any filter file. The parameters in the filter file are decoded into parameters of the name they had when they were written.. If a parameter is found in the filter file, but is not defined in SpecTcl when the filter is read back, it is ignored without reporting an error.

The filter event processor element must be registered as the first element of the SpecTcl event processing pipeline. To use it we must:

Note that it does no harm to leave our raw event processors linked in with SpecTcl. Towards the top of MySpecTclApp.cpp:

#include <config.h>
#include "MySpecTclApp.h"
#include "EventProcessor.h"
#include "TCLAnalyzer.h"
#include <Event.h>
#include <TreeParameter.h>
#include "MyEventProcessor.h"                // <- this line can stay in
#include <ilterEventProcessor.h>       // <- add this line

Make CreateAnalysisPipeline look like this:

Example 3-12. Event analysis pipeline for filters.

CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer)
  RegisterEventProcessor(*(new CFilterEventProcessor), "Filter-unpacker");


Recompiling this SpecTcl (via make) will result in a SpecTcl instance that can analyze filter files.