CSV streamer: always terminate a hit row with a newline#150
Merged
Conversation
The row newline was emitted only in the else branch of the double-observables loop, so a hit whose detector schema has no double observables (empty dmap) never entered the loop body and produced no newline — concatenating that row with the next one. Move the newline to after the loop, written exactly once per hit, matching the header row's existing logic. Applies to event/publishDigitized.cc, event/publishTrueInfo.cc, and run/publishDigitized.cc. Verified: the normal (doubles-present) path is unchanged — the gstreamer CSV example still produces rows with consistent column counts and newline termination. Fixes gemc#129 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The per-hit row newline was emitted only in the
elsebranch of the double-observables loop. A hit whose detector schema has no double observables (emptydmap) never entered the loop body, so its row got no newline and merged with the next row (plus a stray trailing separator).Move the newline to after the loop, written exactly once per hit — mirroring the header row's existing logic. Applied to all three affected files:
event/publishDigitized.cc,event/publishTrueInfo.cc,run/publishDigitized.cc.Validation: ran the gstreamer CSV example in the Geant4 11.4.1 dev container. The normal (doubles-present) path is unchanged: every row has a consistent column count and newline termination (231 digitized rows, 5 commas each; 231 true-info rows, 22 commas each). The empty-
dmappath now emits exactly one newline where it previously emitted none.Fixes #129