NSCL DDAS
12.1-001
Support for XIA DDAS at FRIB
|
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::ZeroCopyHit * | nextHit () |
Get the next hit from the queue. More... | |
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.
DDASReadout::HitManager::HitManager | ( | uint64_t | window | ) |
Constructor.
window | The hit emission window in nanoseconds (ns). |
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.
newHits | References the new hits to be added. |
On return the deque will be empty.
bool DDASReadout::HitManager::haveHit | ( | ) |
Returns true if there's at least one hit that can be output.
Returns false if < 2 hits since no window can be constructed.
DDASReadout::ZeroCopyHit * DDASReadout::HitManager::nextHit | ( | ) |
Get the next hit from the queue.
nullptr | If there are no hits in m_sortedHits |
On exit, if a hit is returned it has been popped off the deque.