From 0a94abf708780cbf72f7f38c60216ec3d3dc8b00 Mon Sep 17 00:00:00 2001 From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de> Date: Wed, 22 Jun 2022 14:23:20 +0200 Subject: [PATCH] [MQ] in DigiEventSink, add flag to control Missing TS empty writing if consecutive check is ON, false by default --- MQ/mcbm/CbmDeviceDigiEventSink.cxx | 15 ++++++++------- MQ/mcbm/CbmDeviceDigiEventSink.h | 1 + MQ/mcbm/runDigiEventSink.cxx | 4 ++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/MQ/mcbm/CbmDeviceDigiEventSink.cxx b/MQ/mcbm/CbmDeviceDigiEventSink.cxx index 7ba0c8533b..16f14e3bef 100644 --- a/MQ/mcbm/CbmDeviceDigiEventSink.cxx +++ b/MQ/mcbm/CbmDeviceDigiEventSink.cxx @@ -70,6 +70,7 @@ try { fsAllowedChannels[0] = fsChannelNameDataInput; fbBypassConsecutiveTs = fConfig->GetValue<bool>("BypassConsecutiveTs"); + fbWriteMissingTs = fConfig->GetValue<bool>("WriteMissingTs"); fbFillHistos = fConfig->GetValue<bool>("FillHistos"); fuPublishFreqTs = fConfig->GetValue<uint32_t>("PubFreqTs"); @@ -345,8 +346,6 @@ bool CbmDeviceDigiEventSink::HandleData(FairMQParts& parts, int /*index*/) << " full ones and " << fulMissedTsCounter << " missed/empty ones)"; LOG(debug) << "Buffers are " << fmFullTsStorage.size() << " full TS and " << fvulMissedTsIndices.size() << " missed/empty ones)"; - LOG(debug) << "Buffers are " << fmFullTsStorage.size() << " full TS and " << fvulMissedTsIndices.size() - << " missed/empty ones)"; return true; } @@ -445,12 +444,14 @@ void CbmDeviceDigiEventSink::CheckTsQueues() && ((0 == fuPrevTsIndex && fuPrevTsIndex == (*itMissTs)) || ((0 < fulTsCounter || 0 < fulMissedTsCounter) && fuPrevTsIndex + 1 == (*itMissTs)))) { - /// Prepare entry with only dummy TS metadata and empty storage variables - new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()]) - TimesliceMetaData(0, 0, 0, (*itMissTs)); + if (fbWriteMissingTs) { + /// Prepare entry with only dummy TS metadata and empty storage variables + new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()]) + TimesliceMetaData(0, 0, 0, (*itMissTs)); - /// Trigger FairRoot manager to dump Tree entry - DumpTreeEntry(); + /// Trigger FairRoot manager to dump Tree entry + DumpTreeEntry(); + } /// Update counters fuPrevTsIndex = (*itMissTs); diff --git a/MQ/mcbm/CbmDeviceDigiEventSink.h b/MQ/mcbm/CbmDeviceDigiEventSink.h index 3d3ac06f19..c39a632be9 100644 --- a/MQ/mcbm/CbmDeviceDigiEventSink.h +++ b/MQ/mcbm/CbmDeviceDigiEventSink.h @@ -84,6 +84,7 @@ private: /// Control flags bool fbStoreFullTs = false; //! If true, store digis vectors with full TS in addition to selected events bool fbBypassConsecutiveTs = false; //! Switch ON/OFF the bypass of the consecutive TS buffer before writing to file + bool fbWriteMissingTs = false; //! Switch ON/OFF writing of empty TS to file for the missing ones (if no bypass) bool fbFillHistos = false; //! Switch ON/OFF filling of histograms bool fbInitDone = false; //! Keep track of whether the Init was already fully completed bool fbFinishDone = false; //! Keep track of whether the Finish was already called diff --git a/MQ/mcbm/runDigiEventSink.cxx b/MQ/mcbm/runDigiEventSink.cxx index 7f875f027f..2f75778476 100644 --- a/MQ/mcbm/runDigiEventSink.cxx +++ b/MQ/mcbm/runDigiEventSink.cxx @@ -20,8 +20,12 @@ void addCustomOptions(bpo::options_description& options) "Name (full or relative path) of the output .root file "); options.add_options()("EvtNameIn", bpo::value<std::string>()->default_value("events"), "MQ channel name for built events"); + options.add_options()("BypassConsecutiveTs", bpo::value<bool>()->default_value(false), "Do not wait for having consecutive TS in buffer before writing to file if true"); + options.add_options()("WriteMissingTs", bpo::value<bool>()->default_value(false), + "Write empty TS to file for the missing ones if true (irrelevant if bypass ON)"); + options.add_options()("FillHistos", bpo::value<bool>()->default_value(false), "Fill histograms and send them to histo server if true"); -- GitLab