NSCL DDAS 12.2-009
Support for XIA DDAS at FRIB
HitManager.h
Go to the documentation of this file.
1/*
2 This software is Copyright by the Board of Trustees of Michigan
3 State University (c) Copyright 2017.
4
5 You may use this software under the terms of the GNU public license
6 (GPL). The terms of this license are described at:
7
8 http://www.gnu.org/licenses/gpl.txt
9
10 Authors:
11 Ron Fox
12 Giordano Cerriza
13 NSCL
14 Michigan State University
15 East Lansing, MI 48824-1321
16*/
17
24#ifndef HITMANAGER_H
25#define HITMANAGER_H
26
27#include <cstdint>
28#include <deque>
29
31namespace DDASReadout {
32class ZeroCopyHit;
33
47private:
49 std::deque<DDASReadout::ZeroCopyHit *> m_sortedHits;
50 uint64_t m_nWindow;
51
52public:
57 HitManager(uint64_t window);
63 void addHits(std::deque<DDASReadout::ZeroCopyHit *> &newHits);
68 bool haveHit();
69
76
77private:
83 void sortHits(std::deque<DDASReadout::ZeroCopyHit *> &newHits);
89 void mergeHits(std::deque<DDASReadout::ZeroCopyHit *> &newHits);
90};
91
92} // namespace DDASReadout
93
94#endif
Collect hits from modules and retains them in a sorted deque.
Definition: HitManager.h:46
void addHits(std::deque< DDASReadout::ZeroCopyHit * > &newHits)
Adds a new set of hits to the m_sortedHits deque maintaining total ordering by calibrated timestamp.
Definition: HitManager.cpp:39
bool haveHit()
Returns true if there's at least one hit that can be output.
Definition: HitManager.cpp:48
HitManager(uint64_t window)
Constructor.
Definition: HitManager.cpp:33
DDASReadout::ZeroCopyHit * nextHit()
Get the next hit from the queue.
Definition: HitManager.cpp:62
This class extends RawChannel to produce a raw channel that is zero-copied from a reference counted b...
Definition: ZeroCopyHit.h:54
Definition: BufferArena.cpp:29