@@ -184,7 +184,7 @@ std::unique_ptr<MessagesPerRoute> SubTimeFrameFileReader::read(FairMQDevice* dev
184184 auto & msgMap = *messagesPerRoute.get ();
185185 assert (device);
186186 std::unordered_map<o2::header::DataHeader, std::pair<std::string, bool >> channelsMap;
187- auto findOutputChannel = [&outputRoutes, &rawChannel, &channelsMap](const o2::header::DataHeader* h) -> const std::string& {
187+ auto findOutputChannel = [&outputRoutes, &rawChannel, &channelsMap](const o2::header::DataHeader* h, size_t tslice ) -> const std::string& {
188188 if (!rawChannel.empty ()) {
189189 return rawChannel;
190190 }
@@ -193,7 +193,7 @@ std::unique_ptr<MessagesPerRoute> SubTimeFrameFileReader::read(FairMQDevice* dev
193193 chFromMap.second = true ; // flag that it was already checked
194194 for (auto & oroute : outputRoutes) {
195195 LOG (debug) << " comparing with matcher to route " << oroute.matcher << " TSlice:" << oroute.timeslice ;
196- if (o2f::DataSpecUtils::match (oroute.matcher , h->dataOrigin , h->dataDescription , h->subSpecification ) && ((h-> tfCounter % oroute.maxTimeslices ) == oroute.timeslice )) {
196+ if (o2f::DataSpecUtils::match (oroute.matcher , h->dataOrigin , h->dataDescription , h->subSpecification ) && ((tslice % oroute.maxTimeslices ) == oroute.timeslice )) {
197197 LOG (debug) << " picking the route:" << o2f::DataSpecUtils::describe (oroute.matcher ) << " channel " << oroute.channel ;
198198 chFromMap.first = oroute.channel ;
199199 break ;
@@ -338,7 +338,7 @@ std::unique_ptr<MessagesPerRoute> SubTimeFrameFileReader::read(FairMQDevice* dev
338338#ifdef _RUN_TIMING_MEASUREMENT_
339339 findChanSW.Start (false );
340340#endif
341- const auto & fmqChannel = findOutputChannel (lDataHeader);
341+ const auto & fmqChannel = findOutputChannel (lDataHeader, tfID );
342342#ifdef _RUN_TIMING_MEASUREMENT_
343343 findChanSW.Stop ();
344344#endif
@@ -400,7 +400,7 @@ std::unique_ptr<MessagesPerRoute> SubTimeFrameFileReader::read(FairMQDevice* dev
400400 stfDistDataHeader.runNumber = stfHeader.runNumber ;
401401 stfDistDataHeader.tfCounter = stfHeader.id ;
402402 stfHeader.id = tfID;
403- const auto fmqChannel = findOutputChannel (&stfDistDataHeader);
403+ const auto fmqChannel = findOutputChannel (&stfDistDataHeader, tfID );
404404 if (!fmqChannel.empty ()) { // no output channel
405405 auto fmqFactory = device->GetChannel (fmqChannel, 0 ).Transport ();
406406 o2::header::Stack headerStackSTF{stfDistDataHeader, o2f::DataProcessingHeader{tfID, 1 , lStfFileMeta.mWriteTimeMs }};
0 commit comments