DDASToys for NSCLDAQ  6.2-000
Public Member Functions | List of all members
ddastoys::DDASFitHitUnpacker Class Reference

Unpack raw hit data from DDAS event files. More...

#include <DDASFitHitUnpacker.h>

Inheritance diagram for ddastoys::DDASFitHitUnpacker:
Inheritance graph
[legend]
Collaboration diagram for ddastoys::DDASFitHitUnpacker:
Collaboration graph
[legend]

Public Member Functions

const void * decode (const void *p, DDASFitHit &hit)
 Decode the current event and unpack it into a DDASFitHit. More...
 

Detailed Description

Unpack raw hit data from DDAS event files.

The DDASHitUnpacker is capable of unpacking raw hits from NSCLDAQ event data which include hit extension data. Hit extensions are data structures which contain additional information appended to each hit which cannot be obtained from the digitizer module, for example from post-processing traces. A typical trace analysis may involve fitting traces and performing further analysis with the fit output (event classification, measuring physics observables, etc.). This class is an extension of ddasfmt::DDASHitUnpacker and retains all the funcitonality of the base class.

Member Function Documentation

◆ decode()

const void * ddastoys::DDASFitHitUnpacker::decode ( const void *  p,
DDASFitHit hit 
)

Decode the current event and unpack it into a DDASFitHit.

Parameters
pPointer to the ring item to decode. For an event built fragment, this is normally the FragmentInfo's s_itemhdr pointer. Note the difference from DDASHitUnpacker which expects a pointer to the body.
hitHit item that we will unpack data into.
Exceptions
std::length_errorAn unexpected hit or extension size is encountered.
Returns
A pointer just after the ring item.

The decode function:

  • Determines the limits of the hit.
  • Determines where, or if, there's an extension block.
  • Unpacks the original hit using DAQ::DDAS::DDASHitUnpacker::unpack().
  • Sets the extension if there is one.

The first 32 bits of the body contain the number of 16-bit words in the hit data.

  • If this works out equivalent to bodySize - there's no extension.
  • If this is larger, to accommodate data from ringblockdealer or the editor fitting framework, we have the following cases: 1) The extra data is the size of HitExtensionLegacy - the extra data is an old-style hit extension e.g., from ringblockdealer. 2) The extra data is sizeof(uint32_t) - the extra data is a null extension from the editor fitting framework. 3) The extra data is sizeof(FitInfo) from fit_extensions.h - the extra data is a hit extension from the editor fitting framework. 4) Anything else - we don't know how to do with and fail with an error message.

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