ADC 400F Manual Página 25

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 74
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 24
Chapter 2. Setting up the software
classes derived from CEventProcessor is expected to process the raw event, and already unpacked
data producing new unpacked data. The event processor should return a kfTRUE if it succeeded well
enough that the event pipeline can continue to run or kfFALSE if SpecTcl should abort the event
pipeline and not histogram the event.
(12) When we implement the operator() function, we will have it hunt through the body of the raw
event for a packet that matches the id stored in m_nId member variable. When we find that packet,
we’ll want to unpack it into our m_rawData tree parameter array. To make the code simpler to
understand, we plan to break off the actual unpacking of the packet into a utility function called
unpackPacket.
The next step is to actually implement the class. The implementation of this class is shown in the next
listing.
Example 2-4. Implementation of the MyEventProcessor class
#include <config.h>
#include "MyEventProcessor.h" //
#include <TreeParameter.h>
#include <Analyzer.h> //
#include <BufferDecoder.h>
#include <Event.h>
#include <iostream>
#include <TCLAnalyzer.h> //
#ifdef HAVE_STD_NAMESPACE
using namespace std;
#endif
static const ULong_t CAEN_DATUM_TYPE(0x07000000);
static const ULong_t CAEN_HEADER(0x02000000);
static const ULong_t CAEN_DATA(0);
static const ULong_t CAEN_TRAILER(0x04000000);
static const ULong_t CAEN_INVALID(0x06000000);
static const ULong_t CAEN_GEOMASK(0xf8000000);
static const ULong_t CAEN_GEOSHIFT(27);
static const ULong_t CAEN_COUNTMASK(0x3f00); //
static const ULong_t CAEN_COUNTSHIFT(8);
static const ULong_t CAEN_CHANNELMASK(0x3f0000);
static const ULong_t CAEN_CHANNELSHIFT(16);
static const ULong_t CAEN_DATAMASK(0xfff);
static inline ULong_t getLong(TranslatorPointer<UShort_t>& p) //
{
ULong_t high = p[0];
ULong_t low = p[1];
20
Vista de página 24
1 2 ... 20 21 22 23 24 25 26 27 28 29 30 ... 73 74

Comentários a estes Manuais

Sem comentários