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

Collect hits from modules and retains them in a sorted deque. More...

#include <HitManager.h>

Public Member Functions

 HitManager (uint64_t window)
 Constructor. More...
 
void addHits (std::deque< DDASReadout::ZeroCopyHit * > &newHits)
 Adds a new set of hits to the m_sortedHits deque maintaining total ordering by calibrated timestamp. More...
 
bool haveHit ()
 Returns true if there's at least one hit that can be output. More...
 
DDASReadout::ZeroCopyHitnextHit ()
 Get the next hit from the queue. More...
 

Detailed Description

Collect hits from modules and retains them in a sorted deque.

On request, provides hits that were accepted within some sliding time interval. The time interval is defined at construction time and is in units of seconds.

This module does no storage management, the receiver of all hits is expected to release any events that have been output.

Constructor & Destructor Documentation

◆ HitManager()

DDASReadout::HitManager::HitManager ( uint64_t  window)

Constructor.

Parameters
windowThe hit emission window in nanoseconds (ns).

Member Function Documentation

◆ addHits()

void DDASReadout::HitManager::addHits ( std::deque< DDASReadout::ZeroCopyHit * > &  newHits)

Adds a new set of hits to the m_sortedHits deque maintaining total ordering by calibrated timestamp.

Parameters
newHitsReferences the new hits to be added.

On return the deque will be empty.

◆ haveHit()

bool DDASReadout::HitManager::haveHit ( )

Returns true if there's at least one hit that can be output.

Returns
True if a hit can be output, false otherwise.

Returns false if < 2 hits since no window can be constructed.

◆ nextHit()

DDASReadout::ZeroCopyHit * DDASReadout::HitManager::nextHit ( )

Get the next hit from the queue.

Returns
Pointer to the oldest hit in the m_sortedHits deque.
Return values
nullptrIf there are no hits in m_sortedHits

On exit, if a hit is returned it has been popped off the deque.


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