From 28df904bee552b61009acfc9b75bc385ac278d06 Mon Sep 17 00:00:00 2001 From: Dominik Smith <smith@th.physik.uni-frankfurt.de> Date: Mon, 14 Feb 2022 16:20:28 +0100 Subject: [PATCH] CbmDeviceBuildRawEvents: Switched from root serializer to boost serializer. --- MQ/mcbm/CbmDeviceEventBuilder.cxx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/MQ/mcbm/CbmDeviceEventBuilder.cxx b/MQ/mcbm/CbmDeviceEventBuilder.cxx index fca6fae708..0ab84e439a 100644 --- a/MQ/mcbm/CbmDeviceEventBuilder.cxx +++ b/MQ/mcbm/CbmDeviceEventBuilder.cxx @@ -323,6 +323,7 @@ std::vector<double> CbmDeviceEventBuilder::GetTriggerTimes(const CbmDigiTimeslic } default: LOG(fatal) << "CbmDeviceEventBuilder::GetTriggerTimes(): Reading digis from unknown detector type!"; } + LOG(debug) << "CbmDeviceEventBuilder::GetTriggerTimes(): Building triggers from " << vDigiTimes.size() << " digis."; return fTriggerAlgo(vDigiTimes, fTriggerWindow, fMinNumDigis, fDeadTime); } @@ -330,28 +331,19 @@ bool CbmDeviceEventBuilder::SendEvents(FairMQParts& partsIn, const std::vector<C { LOG(debug) << "Vector size: " << vEvents.size(); - /// Serialize the array of events into a single MQ message - /// FIXME: Find out if possible to use only the boost serializer - FairMQMessagePtr message(NewMessage()); - Serialize<RootSerializer>(*message, &(vEvents)); - /* std::stringstream ossEvt; boost::archive::binary_oarchive oaEvt(ossEvt); - oaEvt << vOutEvents; + oaEvt << vEvents; std::string* strMsgEvt = new std::string(ossEvt.str()); -*/ - /// Add it at the end of the input composed message - /// FIXME: Find out if possible to use only the boost serializer FairMQParts partsOut(std::move(partsIn)); - partsOut.AddPart(std::move(message)); - /* + partsOut.AddPart(NewMessage( const_cast<char*>(strMsgEvt->c_str()), // data strMsgEvt->length(), // size [](void*, void* object) { delete static_cast<std::string*>(object); }, strMsgEvt)); // object that manages the data -*/ + if (Send(partsOut, fsChannelNameDataOutput) < 0) { LOG(error) << "Problem sending data to " << fsChannelNameDataOutput; return false; @@ -359,7 +351,6 @@ bool CbmDeviceEventBuilder::SendEvents(FairMQParts& partsIn, const std::vector<C return true; } - CbmDeviceEventBuilder::~CbmDeviceEventBuilder() { /// Clear metadata -- GitLab