Chapter 2. Setting up the software
#include "MyEventProcessor.h"
This makes the definition of the event processor we created known to this module.
Locate the code that creates the analysis pipeline. In the unmodified MySpecTclApp.cpp file this will
look like:
void
CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer)
{
#ifdef WITHF77UNPACKER
RegisterEventProcessor(legacyunpacker);
#endif
RegisterEventProcessor(Stage1, "Raw");
RegisterEventProcessor(Stage2, "Computed");
}
Rewrite this section of code so that it looks like this:
void
CMySpecTclApp::CreateAnalysisPipeline(CAnalyzer& rAnalyzer)
{
RegisterEventProcessor(*(new MyEventProcessor(0xff00, 10,
"mydetectors.caenv785")));
}
This creates a new event processor that will look for Id 0xff00, expect it to contain data from
geographical address 10, and unpack this data into the tree parameter array with a base name of
mydetectors.caenv785.
2.2.3. Building the tailored SpecTcl
To build our the SpecTcl we have tailored for our events, we need to modify the Makefile to make it
aware of our event processor, so that it will compile and link it into our SpecTcl.
Edit Makefile. Locate the line that reads:
OBJECTS=MySpecTclApp.o
Modify it to read as follows:
OBJECTS=MySpecTclApp.o MyEventProcessor.o
26
Kommentare zu diesen Handbüchern