Skip to content

Add Poisson unit tests for NonUniformMuInteractionSampler - #16167

Merged
sawenzel merged 2 commits into
AliceO2Group:devfrom
sawenzel:sampler-poisson-test
Nov 21, 2026
Merged

sawenzel merged 2 commits into
AliceO2Group:devfrom
sawenzel:sampler-poisson-test

Conversation

@sawenzel

Copy link
Copy Markdown
Collaborator

This PR adds unit tests for the non-uniform interaction sampler, as a follow-up to #16158.

The existing test needs AliEn and only compares the mean BC position, so it could not see that the sampler put several batches of collisions into the same BC. The new tests need no GRID access and check per-crossing Poisson statistics, for uniform and for alternating intensity scales. Both fail without #16158 (26 % instead of 9.7 % multi-collision crossings at mu = 0.2).

A second commit fixes setBCIntensityScales, which returned false on success and overwrote the scales before rejecting a vector of the wrong size.

Related: https://its.cern.ch/jira/browse/O2-7330

Assisted by Claude Code.

sawenzel and others added 2 commits November 21, 2026 13:03
This adds two unit tests for the non-uniform interaction sampler that need no GRID access.

- With uniform scales, the fraction of occupied crossings with two or more collisions must match Poisson.
- With alternating scales, each colliding BC must follow Poisson at its own mu.
- Both tests fail without the BC jump fix from AliceO2Group#16158, with 26 % instead of 9.7 % multi-collision crossings at mu = 0.2.

https://its.cern.ch/jira/browse/O2-7330

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This fixes NonUniformMuInteractionSampler::setBCIntensityScales and adds a unit test.

- It returned false also on success.
- On a size mismatch it overwrote the scales before reporting that it did nothing.
- It now checks the size first and returns true on success.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sawenzel
sawenzel merged commit 39b3f2e into AliceO2Group:dev Nov 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant