diff --git a/MQ/mcbm/CbmDeviceDigiEventSink.cxx b/MQ/mcbm/CbmDeviceDigiEventSink.cxx index 7ba0c8533bfa3e6238a36a3199a95b56510de2f5..16f14e3beff2fccc7ef67a9f004d9e44a0b117aa 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 3d3ac06f1980effd7e1cf91f998c8effebede5d7..c39a632be9d2b2aa9e2aed071b213bad67ee83ed 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 7f875f027f592d1d5db0932f2a903d09983dfe96..2f75778476e34e8b0bde11b7ac735eb2b1197629 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");