lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::HSD::Channel Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Channel()

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.

◆ ~Channel()

Pds::HSD::Channel::~Channel ( )
inline

Destructor; does nothing itself (the arrays release their memory in their own destructors).

Member Function Documentation

◆ npeaks()

unsigned Pds::HSD::Channel::npeaks ( )
inline

Return numFexPeaks.

Member Data Documentation

◆ content

unsigned Pds::HSD::Channel::content

Not set by the constructor or by anything in Hsd.hh or Hsd.cc.

◆ fexPtr

psalg::AllocArray1D<uint16_t*> Pds::HSD::Channel::fexPtr

Pointer to the first data word of each fex peak inside the input buffer.

◆ len

psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::len

Width in samples of each fex peak.

◆ m_allocator

Allocator* Pds::HSD::Channel::m_allocator

Allocator passed to the constructor.

◆ maxSize

unsigned Pds::HSD::Channel::maxSize = 1000000

Capacity (1000000 elements) of each array allocated by the constructor.

◆ numFexPeaks

unsigned Pds::HSD::Channel::numFexPeaks

Number of peaks found in the fex stream.

◆ numPixels

unsigned Pds::HSD::Channel::numPixels

Number of raw samples copied into waveform (0 if there is no raw stream).

◆ rawPtr

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.

◆ sPos

psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::sPos

Start sample of each fex peak: the skipped samples plus the widths of earlier peaks.

◆ waveform

psalg::AllocArray1D<uint16_t> Pds::HSD::Channel::waveform

Raw samples of stream id 0.


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