NSCL DDAS
12.1-001
Support for XIA DDAS at FRIB
|
CMyEventSegment::read()
function. This call can happen for two reasons:DDASReadout::HitManager::nextHit()
method to emit the earliest hit it is able to. If there are more hits to emit, the read process will tell the experiment that it has more events it can output without waiting for a new trigger.reject()
method which results in the event not producing a ring item.std::deque<DDASReadout::ZeroCopyHit*>
object. A single ring item merged into this deque consists of hits from one module only. Data from each module separated to improve the performance of the sort.DDASReadout::HitManager::addHits()
method. Here's the sequence of operations:std::sort()
algorithm used by the hit manager) run on order \(O(n \log n)\) performance for sorting \(n\) elements ( \(\log\) here means the binary logarithm \(\log_2\)). Suppose we have 5 modules each with \(n\) hits. Sorting them all at once gives performance \(O(5n \log 5n) = O(5n \log n + \log 5)\). Sorting them individually gives performance \(O(5n \log n)\), where that extra term is no longer present. Since we do a lot of sorting and merging it's worth it.std::inplace_merge().
std::deque
vs std::list
. Both of these containers have suitable access patterns, however the implementation of std::deque
results in fewer dynamic memory allocations. A std::list
is a doubly linked list of nodes. Each node has a payload containing the data at that point in the list. Each list element, therefore requires that the node be allocated and each list element removal requires that node be deleted.std::deque
is implemented as a set of fixed length arrays and a pointer array to the beginning and end of each array. Each array contains several deque nodes. Therefore memory allocation/free is substantially less granular. Memory for a deque is only freed when the deque is destroyed and only allocated when pushing a new item on the front or back overflows the array of nodes at the front or back of the deque. Therefore, in general, deques are used rather than lists for the 'lists' of hits.