NSCL DDAS 12.2-009
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...
 
 ~CPixieTraceUtilities ()
 Destructor. More...
 
int ReadTrace (int module, int channel)
 Read a validated ADC trace from single channel. More...
 
int ReadFastTrace (int module, int channel)
 Read an unvalidated ADC trace from single channel. More...
 
int GetTraceLength (int module, int channel)
 Get the trace length for a given module/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...
 
void SetLastErrorMessage (const char *msg)
 Set the last error message. Used by the extern "C" shims when their catch-all fires. More...
 
const char * GetLastErrorMessage ()
 Get the reason text from the most recent failed operation. 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.

◆ ~CPixieTraceUtilities()

CPixieTraceUtilities::~CPixieTraceUtilities ( )

Destructor.

Member Function Documentation

◆ GetLastErrorMessage()

const char * CPixieTraceUtilities::GetLastErrorMessage ( )
inline

Get the reason text from the most recent failed operation.

Returns
Pointer to the stored message; empty string if none.

◆ GetTraceData()

unsigned short * CPixieTraceUtilities::GetTraceData ( )
inline

Return the trace data.

Returns
Pointer to the underlying trace storage.

◆ GetTraceLength()

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

Get the trace length for a given module/channel.

Parameters
moduleModule number.
channelChannel number.
Returns
Trace length in samples.
Return values
<0 XIA error code, could not read trace length.

Boundary translation only. Get the trace length and return it as an integer. The caller assumes responsibility for making sure the module number is valid.

◆ ReadFastTrace()

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

Read an unvalidated ADC trace from single channel.

Parameters
moduleModule number.
channelChannel number on module for trace read.
Returns
int
Return values
0Success.
<0 XIA API error code.
CPIXIEERROR_TRACE_ACQUIREOther acquisition errors (trace empty, offline generator failures).

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.
<0 XIA API error code.
CPIXIEERROR_TRACE_ACQUIREOther acquisition errors (trace empty, offline generator failures).

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.

◆ SetLastErrorMessage()

void CPixieTraceUtilities::SetLastErrorMessage ( const char *  msg)
inline

Set the last error message. Used by the extern "C" shims when their catch-all fires.

Parameters
msgMessage to store.

◆ 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: