NSCL DDAS  12.1-001
Support for XIA DDAS at FRIB
Public Member Functions | List of all members
CPixieTraceUtilities Class Reference

A class to read and fetch trace data from Pixie-16 modules. More...

#include <CPixieTraceUtilities.h>

Public Member Functions

 CPixieTraceUtilities ()
 Constructor. More...
 
int ReadTrace (int module, int channel)
 Read a validated ADC trace from single channel. More...
 
int ReadFastTrace (int module, int channel)
 Read a validated ADC trace from single channel. More...
 
unsigned short * GetTraceData ()
 Return the trace data. More...
 
void SetUseGenerator (bool mode)
 Set the flag for offline mode using the data generator. More...
 

Detailed Description

A class to read and fetch trace data from Pixie-16 modules.

This class provides a ctypes-friendly interface to acquire "validated" (traces which are likely to contain a good signal pulse) and unvalidated traces. The class also provides methods to access the trace data.

Todo:
Instead of validated traces can we process the trace using the fast filter parameters and wait for a real trigger?

Constructor & Destructor Documentation

◆ CPixieTraceUtilities()

CPixieTraceUtilities::CPixieTraceUtilities ( )

Constructor.

The CPixieTraceUtilities class has ownership of a CDataGenerator object and is responsible for managing it.

Member Function Documentation

◆ GetTraceData()

unsigned short* CPixieTraceUtilities::GetTraceData ( )
inline

Return the trace data.

Returns
Pointer to the underlying trace storage.

◆ ReadFastTrace()

int CPixieTraceUtilities::ReadFastTrace ( int  module,
int  channel 
)

Read a validated ADC trace from single channel.

Parameters
moduleModule number.
channelChannel number on module for trace read.
Returns
int
Return values
0Success.
-1XIA API call fails.

Read an ADC trace without signal validation.

◆ ReadTrace()

int CPixieTraceUtilities::ReadTrace ( int  module,
int  channel 
)

Read a validated ADC trace from single channel.

Parameters
moduleModule number.
channelChannel number on module for trace read.
Returns
int
Return values
0Success.
-1XIA API call fails.
-2Acquired trace is empty (median undefined).
-3Unhanded exception when reading trace and calculating median.

Traces are "validated" (not triggered!) if:

  1. The max/min value exceeds the median value +/- 10*SD where SD is the standard deviation estimated from the median absolute deviation.
  2. The max/min value differs from the median value by at least m_validAmplitude ADC units.
    Todo:
    (ASC 6/14/24): Improved baseline estimation for validation.

◆ SetUseGenerator()

void CPixieTraceUtilities::SetUseGenerator ( bool  mode)
inline

Set the flag for offline mode using the data generator.

Parameters
modeThe generator flag is set to this input value.

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