|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Unpacks one HSD channel: the raw stream (stream id 0) is copied into waveform, and the fex stream (stream id 1) is parsed into peak start positions (sPos), widths (len) and data pointers (fexPtr). More...
#include <Hsd.hh>
Public Member Functions | |
| Channel (Allocator *allocator, const uint32_t *evtheader, const uint8_t *data) | |
| Allocate the four arrays from allocator, then walk the streams flagged in bits 21:20 of evtheader[0]. | |
| ~Channel () | |
| Destructor; does nothing itself (the arrays release their memory in their own destructors). | |
| unsigned | npeaks () |
| Return numFexPeaks. | |
Public Attributes | |
| unsigned | maxSize = 1000000 |
| Capacity (1000000 elements) of each array allocated by the constructor. | |
| Allocator * | m_allocator |
| Allocator passed to the constructor. | |
| unsigned | numPixels |
| Number of raw samples copied into waveform (0 if there is no raw stream). | |
| unsigned | numFexPeaks |
| Number of peaks found in the fex stream. | |
| unsigned | content |
| Not set by the constructor or by anything in Hsd.hh or Hsd.cc. | |
| uint16_t * | rawPtr |
| Not set by the constructor or by anything in Hsd.hh or Hsd.cc; the trailing comment calls it a pointer to raw data. | |
| psalg::AllocArray1D< uint16_t > | waveform |
| Raw samples of stream id 0. | |
| psalg::AllocArray1D< uint16_t > | sPos |
| Start sample of each fex peak: the skipped samples plus the widths of earlier peaks. | |
| psalg::AllocArray1D< uint16_t > | len |
| Width in samples of each fex peak. | |
| psalg::AllocArray1D< uint16_t * > | fexPtr |
| Pointer to the first data word of each fex peak inside the input buffer. | |
Unpacks one HSD channel: the raw stream (stream id 0) is copied into waveform, and the fex stream (stream id 1) is parsed into peak start positions (sPos), widths (len) and data pointers (fexPtr).
The arrays are allocated from the given Allocator with capacity maxSize each.
| Pds::HSD::Channel::Channel | ( | Allocator * | allocator, |
| const uint32_t * | evtheader, | ||
| const uint8_t * | data | ||
| ) |
Allocate the four arrays from allocator, then walk the streams flagged in bits 21:20 of evtheader[0].
Each StreamHeader at data is followed by num_samples() 16-bit words; stream id 0 is copied into waveform and stream id 1 is parsed into peaks. In the fex stream, groups of four words whose first word has bit 15 set are skips (their low 15 bits add to the sample position); other groups of four belong to a peak.
|
inline |
Destructor; does nothing itself (the arrays release their memory in their own destructors).
|
inline |
Return numFexPeaks.
| psalg::AllocArray1D<uint16_t*> Pds::HSD::Channel::fexPtr |
Pointer to the first data word of each fex peak inside the input buffer.
| psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::len |
Width in samples of each fex peak.
| unsigned Pds::HSD::Channel::maxSize = 1000000 |
Capacity (1000000 elements) of each array allocated by the constructor.
| unsigned Pds::HSD::Channel::numFexPeaks |
Number of peaks found in the fex stream.
| unsigned Pds::HSD::Channel::numPixels |
Number of raw samples copied into waveform (0 if there is no raw stream).
| uint16_t* Pds::HSD::Channel::rawPtr |
Not set by the constructor or by anything in Hsd.hh or Hsd.cc; the trailing comment calls it a pointer to raw data.
| psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::sPos |
Start sample of each fex peak: the skipped samples plus the widths of earlier peaks.
| psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::waveform |
Raw samples of stream id 0.