AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTrackerDDLDecoderEventHandler Class Reference

Callback event handler class for the AliMUONTrackerDDLDecoder. More...

#include <AliMUONTrackerDDLDecoderEventHandler.h>

Inheritance diagram for AliMUONTrackerDDLDecoderEventHandler:

Public Types

enum  ErrorCode {
  kNoError = 0, kBufferTooBig = 10, kTooManyBlocks = 11, kTooManyDSPs = 12,
  kTooManyBusPatches = 13, kNoBlockHeader = 14, kBadBlockKey = 15, kBadBlockLength = 16,
  kBadBlockTotalLength = 17, kBlockLengthMismatch = 18, kNoDSPHeader = 19, kBadDSPKey = 20,
  kBadDSPLength = 21, kBadDSPTotalLength = 22, kDSPLengthMismatch = 23, kNoBusPatchHeader = 24,
  kBadBusPatchKey = 25, kBadBusPatchLength = 26, kBadBusPatchTotalLength = 27, kBusPatchLengthMismatch = 28,
  kNoDDLTrailerWords = 29, kTooFewDDLTrailerWords = 30, kUnknownDspError = 31, kTokenLost = 32,
  kGlitchFound = 1, kBadPaddingWord = 2, kParityError = 3
}
 All the possible error codes for the parsing. More...
 

Public Member Functions

virtual ~AliMUONTrackerDDLDecoderEventHandler ()
 
void OnNewBuffer (const void *, UInt_t)
 
void OnEndOfBuffer (const void *, UInt_t)
 
void OnNewBlock (const AliMUONBlockHeaderStruct *, const void *)
 
void OnEndOfBlock (const AliMUONBlockHeaderStruct *, const void *)
 
void OnNewDSP (const AliMUONDSPHeaderStruct *, const void *)
 
void OnEndOfDSP (const AliMUONDSPHeaderStruct *, const void *)
 
void OnNewBusPatch (const AliMUONBusPatchHeaderStruct *, const void *)
 
void OnEndOfBusPatch (const AliMUONBusPatchHeaderStruct *, const void *)
 
void OnData (UInt_t, bool)
 
void OnError (ErrorCode, const void *)
 

Static Public Member Functions

static void UnpackADC (UInt_t data, UShort_t &manuId, UChar_t &channelId, UShort_t &adc)
 
static const char * ErrorCodeToString (ErrorCode code)
 
static const char * ErrorCodeToMessage (ErrorCode code)
 

Detailed Description

Callback event handler class for the AliMUONTrackerDDLDecoder.

This class is the base class defining what methods the event handler for the high performance decoder should have. This handler actually does nothing. The user of this decoder will have to derive from this class a custom event handler that actually does something within the callback methods OnNewBusPatch, OnData, OnError etc...

Author
Artur Szostak artur.nosp@m.sz@i.nosp@m.afric.nosp@m.a.co.nosp@m.m

Definition at line 95 of file AliMUONTrackerDDLDecoderEventHandler.h.

Member Enumeration Documentation

All the possible error codes for the parsing.

Enumerator
kNoError 
kBufferTooBig 

Decoding was successful.

kTooManyBlocks 

The DDL raw data is larger than indicated by the headers; extra bytes are probably just garbage.

kTooManyDSPs 

Too many block structures found.

kTooManyBusPatches 

Too many DSP structures found in the block.

kNoBlockHeader 

Too many bus patch structures found in the DSP structure.

kBadBlockKey 

Missing a block header.

kBadBlockLength 

The block header key word does not contain the correct value.

kBadBlockTotalLength 

The block length field points past the end of the raw data size.

kBlockLengthMismatch 

The total block length field points past the end of the raw data size.

kNoDSPHeader 

The block length and total length fields do not correspond. One or both of these values is incorrect.

kBadDSPKey 

Missing a DSP header.

kBadDSPLength 

The DSP header key word does not contain the correct value.

kBadDSPTotalLength 

The DSP structure length field points past the end of the block structure.

kDSPLengthMismatch 

The total DSP structure length field points past the end of the block structure.

kNoBusPatchHeader 

The DSP structure length and total length fields do not correspond. One or both of these values is incorrect.

kBadBusPatchKey 

Missing a bus patch header.

kBadBusPatchLength 

The bus patch header key word does not contain the correct value.

kBadBusPatchTotalLength 

The bus patch length field points past the end of the DSP structure.

kBusPatchLengthMismatch 

The total bus patch length field points past the end of the DSP structure.

kNoDDLTrailerWords 

The bus patch length and total length fields do not correspond. One or both of these values is incorrect.

kTooFewDDLTrailerWords 

No end of DDL markers found in the trailer words.

kUnknownDspError 

Only one end of DDL marker trailer word found but expected two.

kTokenLost 

The DSP error code is non-zero but of an unrecognised format.

kGlitchFound 

The DSP contains a token lost error code that can affect the deadtime.

kBadPaddingWord 

Found a glitch. This means a 1 byte word has been randomly inserted into the raw data by mistake.

kParityError 

The padding word does not contain the correct value.

Definition at line 104 of file AliMUONTrackerDDLDecoderEventHandler.h.

Constructor & Destructor Documentation

virtual AliMUONTrackerDDLDecoderEventHandler::~AliMUONTrackerDDLDecoderEventHandler ( )
inlinevirtual

The only reason for a virtual destructor is to make -Weffc++ shutup. This should not really be here since we do not need or use virtual methods.

Definition at line 101 of file AliMUONTrackerDDLDecoderEventHandler.h.

Member Function Documentation

const char * AliMUONTrackerDDLDecoderEventHandler::ErrorCodeToMessage ( ErrorCode  code)
inlinestatic

This is a utility method which converts an error code to user friendly descriptive message useful for printing to the screen.

Parameters
codeThe error code as received in OnError for example.
Returns
An ANSI string containing a descriptive message of the error.

This is a utility method which converts an error code to user friendly descriptive message useful for printing to the screen.

Parameters
codeThe error code as received in OnError for example.
Returns
An ANSI string containing a descriptive message of the error.

Definition at line 329 of file AliMUONTrackerDDLDecoderEventHandler.h.

Referenced by operator<<().

const char * AliMUONTrackerDDLDecoderEventHandler::ErrorCodeToString ( ErrorCode  code)
inlinestatic

This is a utility method which converts an error code to a string representation for printing purposes.

Parameters
codeThe error code as received in OnError for example.
Returns
An ANSI string containing the name of the error code symbol.

This is a utility method which converts an error code to a string representation for printing purposes.

Parameters
codeThe error code as received in OnError for example.
Returns
An ANSI string containing the name of the error code symbol.

Definition at line 288 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnData ( UInt_t  ,
bool   
)
inline

OnData is called for every raw data word found within a bus patch. Every data ward received by a call to OnData is associated to the bus patch header received in the most recent call to OnNewBusPatch. The default behaviour of this method is to do nothing.

  • param UInt_t This is the raw data word as found within the bus patch payload.
  • param bool Flag indicating if the raw data word had a parity error. This will always be set to false if fSendDataOnParityError in the AliMUONTrackerDDLDecoder class was set to false.

Definition at line 239 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnEndOfBlock ( const AliMUONBlockHeaderStruct ,
const void *   
)
inline

OnEndOfBlock is called whenever a block has been processed. Symmetric calls are made to OnEndOfBlock after each call to OnNewBlock. This happens once all DSP structures contained inside the current block have been processed. The default behaviour of this method is to do nothing.

  • param const AliMUONBlockHeaderStruct* This is a pointer to the processed block header as found in the DDL payload.
  • param const void* This is a pointer to the start of the block's contents. Note: both pointers point into the memory buffer being parsed, so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 179 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnEndOfBuffer ( const void *  ,
UInt_t   
)
inline

The OnEndOfBuffer method will be called whenever the buffer containing a DDL payload has been processed. For each OnNewBuffer method call a symmetric call to OnEndOfBuffer is made at the end of processing (after the last call to OnData) The default behaviour of this method is to do nothing.

  • param const void* The pointer to the start of the memory buffer storing the DDL payload.
  • param UInt_t The size in bytes of the memory buffer.

Definition at line 156 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnEndOfBusPatch ( const AliMUONBusPatchHeaderStruct ,
const void *   
)
inline

OnEndOfBusPatch is called whenever a bus patch has been processed. For every call to OnNewBusPatch a symmetric call to OnEndOfBusPatch is made once the bus patch is completely processed (no more OnData calls). The default behaviour of this method is to do nothing.

  • param const AliMUONBusPatchHeaderStruct* This is a pointer to the already processed bus patch header, as found in the DDL payload.
  • param const void* This is a pointer to the start of the bus patch's contents, specifically the raw data words. Note: both pointers point into the memory buffer being parsed so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 229 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnEndOfDSP ( const AliMUONDSPHeaderStruct ,
const void *   
)
inline

OnEndOfDSP is called whenever a DSP header has already been processed. For every call to OnNewDSP a symmetric call to OnEndOfDSP is made once all the bus patch structured contained in the DSP are processed. The default behaviour of this method is to do nothing.

  • param const AliMUONDSPHeaderStruct* This is a pointer to the already processed DSP header as found in the DDL payload.
  • param const void* This is a pointer to the start of the DSP's contents. Note: both pointers point into the memory buffer being parsed, so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 203 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnError ( ErrorCode  ,
const void *   
)
inline

Whenever a parsing error of the DDL payload is encountered because of corruption of the raw data (eg. bit flips) the OnError method is called immediately at the point this error is discovered. The default behaviour of this method is to do nothing.

  • param ErrorCode This is an error code indicating the kind of problem encountered with the DDL payload.
  • param const void* This is a pointer into the DDL payload memory buffer indicating the exact location where the parsing error happened or i.e. the location of the corruption. Note that a relative offset in bytes from the start of the memory buffer can be calculated by: storing the buffer pointer received in OnNewBuffer earlier in fBufferStart for example, and then the offset is given by: offset = (unsigned long)location - (unsigned long)fBufferStart;

Definition at line 254 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnNewBlock ( const AliMUONBlockHeaderStruct ,
const void *   
)
inline

OnNewBlock is called whenever a new block header is found in the payload. The default behaviour of this method is to do nothing.

  • param const AliMUONBlockHeaderStruct* This is a pointer to the block header as found in the DDL payload.
  • param const void* This is a pointer to the start of the block's contents. Note: both pointers point into the memory buffer being parsed, so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 166 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnNewBuffer ( const void *  ,
UInt_t   
)
inline

The OnNewBuffer method will be called whenever a new buffer containing a DDL payload is about to be processed. The default behaviour of this method is to do nothing.

  • param const void* The pointer to the start of the memory buffer storing the DDL payload.
  • param UInt_t The size in bytes of the memory buffer.

Definition at line 146 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnNewBusPatch ( const AliMUONBusPatchHeaderStruct ,
const void *   
)
inline

OnNewBusPatch is called whenever a new bus patch header is found in the payload. Every bus patch received by a call to OnNewBusPatch is associated to the DSP header received in the most recent call to OnNewDSP. The default behaviour of this method is to do nothing.

  • param const AliMUONBusPatchHeaderStruct* This is a pointer to the bus patch header as found in the DDL payload.
  • param const void* This is a pointer to the start of the bus patch's contents, specifically the raw data words. Note: both pointers point into the memory buffer being parsed, so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 216 of file AliMUONTrackerDDLDecoderEventHandler.h.

void AliMUONTrackerDDLDecoderEventHandler::OnNewDSP ( const AliMUONDSPHeaderStruct ,
const void *   
)
inline

OnNewDSP is called whenever a new DSP header is found in the payload. Every DSP header received by a call to OnNewDSP is associated to the block header received in the most recent call to OnNewBlock. The default behaviour of this method is to do nothing.

  • param const AliMUONDSPHeaderStruct* This is a pointer to the DSP header as found in the DDL payload.
  • param const void* This is a pointer to the start of the DSP's contents. Note: both pointers point into the memory buffer being parsed, so the contents must not be modified. On the other hand this is very efficient because no memory copying is required.

Definition at line 191 of file AliMUONTrackerDDLDecoderEventHandler.h.

static void AliMUONTrackerDDLDecoderEventHandler::UnpackADC ( UInt_t  data,
UShort_t &  manuId,
UChar_t &  channelId,
UShort_t &  adc 
)
inlinestatic

This is a utility method which will unpack the MANU ID, channel ID and ADC signal value from a raw data word. It should normally be used in OnData() to unpack these fields. [in]

Parameters
dataThis is the raw data word found in the DDL payload. [out]
manuIdThis is filled with the unpacked MANU ID. [out]
channelIdThis is filled with the unpacked MANU channel ID. [out]
adcThis is filled with the unpacked ADC signal.

Definition at line 263 of file AliMUONTrackerDDLDecoderEventHandler.h.

Referenced by AliMUONRawStreamTrackerHP::AliBusPatch::GetData(), and AliMUONRawStreamTrackerHP::Next().


The documentation for this class was generated from the following file: