NSCL DDAS
1.0
Support for XIA DDAS at the NSCL
|
Raw data unpacker for unbuilt data. More...
#include <DDASUnpacker.h>
Public Member Functions | |
CDDASUnpacker (CParameterMapper &rParameterMapper) | |
Constructor. More... | |
~CDDASUnpacker () | |
void | setParameterMapper (CParameterMapper &pParameterMapper) |
Pass in a different parameter mapper. More... | |
CParameterMapper & | getParameterMapper () const |
virtual Bool_t | operator() (const Address_t pEvent, CEvent &rEvent, CAnalyzer &rAnalyzer, CBufferDecoder &rDecoder) |
Process the raw data and call user's mapper. More... | |
Protected Member Functions | |
void | setEventSize (const Address_t pEvent, CBufferDecoder &rDecoder, CAnalyzer &rAnalyzer) |
Raw data unpacker for unbuilt data.
The user should use this to process data upstream of or in the absence of the event builder. This processes raw data and generates one DDASHit object per event. The user is expected to derive a class from the ParameterMapper base class and pass that object to this unpacker to call at the end of parsing each event. In that way, this class will deal with the raw data and allow the user to interact with it at a much higher level. This class will take ownership of the user's mapper and will attempt to delete it at the time of destruction. For that reason, it is important that the user dynamically allocates their mapper on the heap. A proper way to do this is:
This unpacker does not support byte-swapping. Don't worry, it is not likely to be an issue in the future unless you try to analyze your system on a computer with a strange architecture.
DAQ::DDAS::CDDASUnpacker::CDDASUnpacker | ( | CParameterMapper & | rParameterMapper | ) |
Constructor.
rParameterMapper | user's mapper (must be dynamically allocated, ownership transfers to class) |
DAQ::DDAS::CDDASUnpacker::~CDDASUnpacker | ( | ) |
Destructor
CParameterMapper & DAQ::DDAS::CDDASUnpacker::getParameterMapper | ( | ) | const |
Retrieve the active parameter
|
virtual |
Process the raw data and call user's mapper.
This is designed to process data from the DDAS readout program. See the documentation in readout to understand the structure.
This sets the event size in the CEvent.
pEvent | address in buffer to begin parsing at |
rEvent | current SpecTcl event |
rAnalyzer | the analyzer |
rDecoder | current buffer decoder |
void DAQ::DDAS::CDDASUnpacker::setParameterMapper | ( | CParameterMapper & | pParameterMapper | ) |
Pass in a different parameter mapper.
The user must allocate the parameter dynamically before passing it in. For example:
Ownership of the mapper is transferred into this object.
rParameterMapper | the user's parameter mapper |