Skip to content

DataProcessor feedback

Alex Toldaiev requested to merge otoldaie/YARR:devel_DataFeedback into devel

The FrontEnd.h defines struct FeedbackProcessingInfo with the info from the RawData processing, and adds the third clipboard in the FrontEnd class: ClipBoard<FeedbackProcessingInfo> clipProcFeedback. The Bookkeeper contains the pointers to the FEs, and therefore serves as a map from the FE ID to the feedback clipboard, like with the other clipboards. The DataProcessors connect to the corresponding clipboard in the buildRawDataProcs of the ScanHelper.

The StdDataLoop sends multiple RawDataContainers with LoopStatus::is_end_of_iteration = false in one scan iteration (default is true). When it considers the iteration has finished, it sends an empty RawDataContainer with is_end_of_iteration = true, that marks the end of the scan iteration. DataProcessors process this container as any other, create FrontEndData with the same LoopStatus and pass to HistogramAlgorithm. The HistogramAlgorithm::process_core pushes all incoming data to analysers. When it sees is_end_of_iteration = true, it calls publish, and resets analysers for new iteration.

The StdDataLoop considers the iteration has finished, when it runs out of the total time for iteration (maxIterationTime in json config, or 5s default), or it received the processing feedback for all expected triggers (keeper->getTriggerAction()->getTrigCnt() = trig_count in the config of the trigger action). For this, the Bookkeper contains a pointer to the TriggerAction Loop.

src/libYarr/include/FrontEnd.h            // struct FeedbackProcessingInfo, and ClipBoard<FeedbackProcessingInfo> clipProcFeedback in FrontEnd class
src/libYarr/include/DataProcessor.h       // the connect method for the feedback clipboard and include FrontEnd.h for the feedback struct
src/libYarr/include/HistogramAlgorithm.h  // the async multi-data-per-iteration processing, bool is_new_iteration
src/libYarr/include/LoopStatus.h          // bool is_end_of_iteration = true;
src/libYarr/include/Bookkeeper.h          // keep std::shared_ptr<StdTriggerAction> m_trigLoop for everybody
src/libYarr/include/ScanHelper.h          // just moved ScanBase.h here when resolved a loop of includes (ScanBase must be here, as a part of method interfaces)

src/libYarr/HistogramAlgorithm.cpp   // the async LoopStatuses are merged as 1 iteration
src/libYarr/StdDataGatherer.cpp      // implement the async LoopStatus-es
src/libYarr/StdDataLoop.cpp          // <-- new feedback-based read-out, which defaults to delays
src/libYarr/ScanFactory.cpp          // save the StdTriggerAction in the bookkeeper: g_bk->setTriggerAction(trigLoop);
src/libYarr/ScanHelper.cpp           // connect the feedback clipboard

src/libYarr/tests/CMakeLists.txt         // the new test_histogrammer
src/libYarr/tests/test_histogrammer.cpp

// Star implementation
src/libStar/include/StarDataProcessor.h
src/libStar/StarDataProcessor.cpp

// Rd53b implementation
src/libRd53b/include/Rd53bDataProcessor.h
src/libRd53b/Rd53bDataProcessor.cpp
src/libRd53b/include/Rd53bTriggerLoop.h
src/libRd53b/Rd53bTriggerLoop.cpp           // getExpEvents() with m_trigMultiplier
Edited by Alex Toldaiev

Merge request reports