NSCL DDAS  12.1-001
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 <stdint.h>
28 
29 #include <deque>
30 
32 namespace DDASReadout {
33  class ZeroCopyHit;
34 
35 
48  class HitManager
49  {
50  private:
52  std::deque<DDASReadout::ZeroCopyHit*> m_sortedHits;
53  uint64_t m_nWindow;
54 
55  public:
60  HitManager(uint64_t window);
66  void addHits(std::deque<DDASReadout::ZeroCopyHit*>& newHits);
71  bool haveHit();
72 
79 
80  private:
86  void sortHits(std::deque<DDASReadout::ZeroCopyHit*>& newHits);
92  void mergeHits(std::deque<DDASReadout::ZeroCopyHit*>& newHits);
93  };
94 
95 } // Namespace.
96 
97 
98 #endif
Collect hits from modules and retains them in a sorted deque.
Definition: HitManager.h:49
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:40
bool haveHit()
Returns true if there's at least one hit that can be output.
Definition: HitManager.cpp:51
HitManager(uint64_t window)
Constructor.
Definition: HitManager.cpp:32
DDASReadout::ZeroCopyHit * nextHit()
Get the next hit from the queue.
Definition: HitManager.cpp:67
This class extends RawChannel to produce a raw channel that is zero-copied from a reference counted b...
Definition: ZeroCopyHit.h:55
Definition: BufferArena.cpp:29