Chapter 2. Setting up the software
return (high << 16) | low;
}
MyEventProcessor::MyEventProcessor(int ourId,
int ourSlot,
const char* baseParameterName) :
m_rawData(*(new CTreeParameterArray(string(baseParameterName),
4096, 0.0, 4095.0, string("channels"),
32, 0))), // ➏
m_nId(ourId),
m_nSlot(ourSlot)
{
}
MyEventProcessor::~MyEventProcessor()
{
delete &m_rawData; // ➐
}
Bool_t
MyEventProcessor::operator()(const Address_t pEvent,
CEvent& rEvent,
CAnalyzer& rAnalyzer,
CBufferDecoder& rDecoder)
{
TranslatorPointer<UShort_t> p(*(rDecoder.getBufferTranslator()),
pEvent);
UShort_t nWords = *p++; // ➑
CTclAnalyzer& rAna((CTclAnalyzer&)rAnalyzer);
rAna.SetEventSize(nWords*sizeof(UShort_t));
nWords--; // Remaining words after word count.
while (nWords) {
UShort_t nPacketWords = *p; // ➒
UShort_t nId = p[1];
if (nId == m_nId) { // (10)
try { // (11)
unpackPacket(p); // (12)
}
catch(string msg) {
cerr << "Error Unpacking packet " << hex << nId << dec
<< " " << msg << endl;
return kfFALSE; // (13)
}
catch(...) {
cerr << "Some sort of exception caught unpacking packet " << hex << nId
<< dec << endl;
return kfFALSE;
}
}
p += nPacketWords; // (14)
21
Kommentare zu diesen Handbüchern