Skip to content

Commit 3b294af

Browse files
committed
Fix DPH.startTime assignment in the raw readers
1 parent 7e5391a commit 3b294af

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Detectors/Raw/TFReaderDD/src/SubTimeFrameFileReader.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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}};

Detectors/Raw/TFReaderDD/src/TFReaderSpec.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ void TFReaderSpec::run(o2f::ProcessingContext& ctx)
134134
}
135135
};
136136

137-
auto findOutputChannel = [&ctx, this](o2h::DataHeader& h) {
137+
auto findOutputChannel = [&ctx, this](o2h::DataHeader& h, size_t tslice) {
138138
if (!this->mInput.rawChannelConfig.empty()) {
139139
return std::string{this->mInput.rawChannelConfig};
140140
} else {
141141
auto& outputRoutes = ctx.services().get<o2f::RawDeviceService>().spec().outputs;
142142
for (auto& oroute : outputRoutes) {
143143
LOG(debug) << "comparing with matcher to route " << oroute.matcher << " TSlice:" << oroute.timeslice;
144-
if (o2f::DataSpecUtils::match(oroute.matcher, h.dataOrigin, h.dataDescription, h.subSpecification) && ((h.tfCounter % oroute.maxTimeslices) == oroute.timeslice)) {
144+
if (o2f::DataSpecUtils::match(oroute.matcher, h.dataOrigin, h.dataDescription, h.subSpecification) && ((tslice % oroute.maxTimeslices) == oroute.timeslice)) {
145145
LOG(debug) << "picking the route:" << o2f::DataSpecUtils::describe(oroute.matcher) << " channel " << oroute.channel;
146146
return std::string{oroute.channel};
147147
}
@@ -181,7 +181,7 @@ void TFReaderSpec::run(o2f::ProcessingContext& ctx)
181181
outHeader.firstTForbit = hd0->firstTForbit;
182182
outHeader.tfCounter = hd0->tfCounter;
183183
outHeader.runNumber = hd0->runNumber;
184-
const auto fmqChannel = findOutputChannel(outHeader);
184+
const auto fmqChannel = findOutputChannel(outHeader, dph->startTime);
185185
if (fmqChannel.empty()) { // no output channel
186186
continue;
187187
}

Detectors/Raw/src/RawFileReaderWorkflow.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void RawReaderSpecs::run(o2f::ProcessingContext& ctx)
172172
auto outputRoutes = ctx.services().get<o2f::RawDeviceService>().spec().outputs;
173173
for (auto& oroute : outputRoutes) {
174174
LOG(debug) << "comparing with matcher to route " << oroute.matcher << " TSlice:" << oroute.timeslice;
175-
if (o2f::DataSpecUtils::match(oroute.matcher, h.dataOrigin, h.dataDescription, h.subSpecification) && ((h.tfCounter % oroute.maxTimeslices) == oroute.timeslice)) {
175+
if (o2f::DataSpecUtils::match(oroute.matcher, h.dataOrigin, h.dataDescription, h.subSpecification) && ((mTFCounter % oroute.maxTimeslices) == oroute.timeslice)) {
176176
LOG(debug) << "picking the route:" << o2f::DataSpecUtils::describe(oroute.matcher) << " channel " << oroute.channel;
177177
return std::string{oroute.channel};
178178
}

0 commit comments

Comments
 (0)