This provides the simplest and preferred way to incorporate the event builder into your experiment. The callback bundle works with the ReadoutGUI's state machine and thus makes the most sense to use in the context of the ReadoutGUI. In this context, you should rely on the RingSourceMgr to manage your ringFragmentSources rather than explicitly calling procs like startRingSource. Together, the event builder and RingSourceMgr callback bundles provide robust error recovery in a way that requires no extra effort from the user. i
While the 3evb manpage provides reference information, a short example is provided below for using this mechanism with an event builder for which building is enabled, with a correlation window 10 clock ticks wide, and output ring named fox and Two ring data sources from rings fox1 and fox2.
Example 62-1. Using the EVBC state manager callback bundle
OnStartproc is called from the ReadoutGUI when it makes a transition to the Halted state from NotReady.
EVBC::registerRingSourceto start a ring data source. This ring data source is provided a timestamp extractor library to deal with data that is not already labeled with timestamps. The fifth and sixth positional parameters dictate that data may arrive without timestamps and that the ring source should exit after it has observed a symmetric number of begin and end run items.
EVBC::registerRingSource. The ring data source is passed an empty string for the timestamp extractor argument because all of the ring items are expected to already be labeled with timestamps. The fifth and sixth positional parameters dictate that data must arrive with timestamps and that the ring source should exit after it has observed a symmetric number of begin and end run items.