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

Trigger class for DDAS. More...

#include <CMyTrigger.h>

Inheritance diagram for CMyTrigger:
Inheritance graph
[legend]
Collaboration diagram for CMyTrigger:
Collaboration graph
[legend]

Public Member Functions

 CMyTrigger ()
 Default constructor. More...
 
 ~CMyTrigger ()
 Destructor. More...
 
virtual void setup ()
 Start the trigger timeout. More...
 
virtual void teardown ()
 Called as data taking ends. More...
 
virtual bool operator() ()
 operator() More...
 
virtual void Initialize (int nummod)
 Setup the trigger and FIFO words array. More...
 
void Reset ()
 Control for determing if trigger should poll modules or pass control back to CEventSegment for processing the previous block of data. More...
 
unsigned int * getWordsInModules () const
 Get the number of words in each module. More...
 

Detailed Description

Trigger class for DDAS.

A trigger for DDAS systems intended to run inside a polling loop that asks the trigger if it has enough data to read out. The trigger logic is defined in the call operator which triggers a read for a crate of Pixie modules if any module in the crate exceeds its trigger threshold (FIFO threshold value).

Constructor & Destructor Documentation

◆ CMyTrigger()

CMyTrigger::CMyTrigger ( )

Default constructor.

If FIFO_THRESHOLD is defined and is a positive integer, it replaces the default value of m_fifoThreshold. The FIFO threshold is the number of 32-bit words that must be in the FIFO for the trigger to fire.

◆ ~CMyTrigger()

CMyTrigger::~CMyTrigger ( )

Destructor.

We need to deallocate memory used to store the FIFO words in each module.

Member Function Documentation

◆ getWordsInModules()

unsigned int* CMyTrigger::getWordsInModules ( ) const
inline

Get the number of words in each module.

Returns
Pointer to the array containing the number of words each module has.

◆ Initialize()

void CMyTrigger::Initialize ( int  nummod)
virtual

Setup the trigger and FIFO words array.

Parameters
nummodThe number of installed modules in the Pixie setup. Received from the event segment class.

Delete and recreate the FIFO words array based on the number of modules.

◆ operator()()

bool CMyTrigger::operator() ( )
virtual

operator()

Returns
bool
Return values
trueGood trigger, pass control back to the event segment.
falseNot enough data to trigger.

Defines the trigger logic. Trigger a read if the number of words in the external FIFO of any Pixie-16 module in a crate exceeds a defined threshold.

  • If the module is in the middle of processing a data buffer in the event segment, continue processing the data buffer. Return a true trigger to pass control back the event segment.
  • If there are no buffers currently being processed in the event segment look at the Pixie hardware to see if data currently needs to be read out. Do so if the FIFO threshold is exceeded.
  • If the trigger has timed out, trigger anyways.

◆ Reset()

void CMyTrigger::Reset ( )

Control for determing if trigger should poll modules or pass control back to CEventSegment for processing the previous block of data.

Retrigger: always false.

◆ setup()

void CMyTrigger::setup ( )
virtual

Start the trigger timeout.

◆ teardown()

void CMyTrigger::teardown ( )
virtual

Called as data taking ends.

DDAS does not need any further signal as data taking end since this function is also called on a pause of data taking on't even think about desyncing modules here.


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