Unit tests for LossDataSink statistics and bookkeeping.
This test suite validates the core behavior of LossDataSink using:
- small deterministic OpalParticle samples
- direct access to internal bookkeeping where needed
- a single-rank initialized IPPL/MPI environment
Coverage
- Particle bookkeeping
- plain particles and turn/bunch particles cannot be mixed
- inconsistent turn/bunch information is rejected
- Basic statistics
- total particle count
- centroids in position and momentum
- RMS position and momentum
- total charge and total mass
- Time statistics
- mean particle time
- RMS particle time
- Spatial extent statistics
- rmin / rmax are computed correctly
- maxR uses the maximum absolute position extent
- Energy statistics
- mean kinetic energy is computed from particle momentum and mass
- kinetic-energy RMS is stable for identical particle energies
- Set splitting
- splitSets() clears stale state
- split boundaries are monotonic
- split boundaries cover all local particles
Notes
- Options::computePercentiles is disabled in the fixture so these tests focus on the core LossDataSink statistics and do not depend on percentile histogram behavior.
- The tests initialize IPPL in SetUpTestSuite(), because LossDataSink uses ippl::Comm reductions and barriers even in single-rank unit tests.
- The private/public macro is used only to test internal set-splitting state and other bookkeeping that is not exposed through the public interface.
Definition in file TestLossDataSink.cpp.