Skip to content

Commit d12c745

Browse files
authored
Merge pull request #152 from zhaozhiwen/fix/105-run-normalize-once
Normalize run data once, not once per run streamer
2 parents 4bc0191 + 288a580 commit d12c745

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gemc/actions/run/gRunAction.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,17 @@ void GRunAction::publish_run_data(const std::shared_ptr<GRunDataCollection> &run
256256
" no run streamer map available - run data will not be published.");
257257
}
258258

259+
// Normalize once, before publishing: normalize_run_data() mutates run_data_collaction
260+
// in place and is NOT idempotent, so running it per streamer would divide the run
261+
// observables by events_processed once for every configured run streamer.
262+
normalize_run_data(run_data_collaction);
263+
259264
for (const auto &[name, gstreamer]: *gstreamer_run_map) {
260265
if (gstreamer == nullptr) {
261266
log->error(ERR_STREAMERMAP_NOT_EXISTING, FUNCTION_NAME,
262267
" null gstreamer instance for run streamer ", name);
263268
}
264269

265-
266-
normalize_run_data(run_data_collaction);
267-
268270
gstreamer->publishRunData(run_data_collaction);
269271
}
270272
}

0 commit comments

Comments
 (0)