Skip to content

Combine McCode runs as one run of all their rays, weighted by Ncount - #400

Merged
g5t merged 2 commits into
mainfrom
combine-runs-weighted
Oct 20, 2026
Merged

g5t merged 2 commits into
mainfrom
combine-runs-weighted

Conversation

@g5t

@g5t g5t commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

McCode normalises each run's intensities to its own ray count, but combining two .dat files added them, so restage's merge of a primary's passes -- its only caller -- gave histograms too intense by about the number of passes, with unweighted errors. The intensity is now the Ncount-weighted mean, its error the weighted errors in quadrature over the total, and counts still add. The header's values, signal and statistics were the first file's and are now recomputed from the combined histogram; recomputed for a single McStas file they reproduce the ones McStas wrote. A file without Ncount is refused rather than weighted equally.

g5t added 2 commits October 20, 2026 13:49
McCode normalises each run's intensities to its own ray count, but combining
two .dat files added them, so restage's merge of a primary's passes -- its only
caller -- gave histograms too intense by about the number of passes, with
unweighted errors. The intensity is now the Ncount-weighted mean, its error the
weighted errors in quadrature over the total, and counts still add. The header's
values, signal and statistics were the first file's and are now recomputed from
the combined histogram; recomputed for a single McStas file they reproduce the
ones McStas wrote. A file without Ncount is refused rather than weighted equally.
@g5t
g5t merged commit 3bed330 into main Oct 20, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant