|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
Regression tests for CAIN-validated linear-Compton energy and angle spectra. More...
#include "LinearComptonSpectrumCommon.h"#include "Utilities/Options.h"#include "gtest/gtest.h"#include <cstdlib>#include <filesystem>#include <sstream>#include <stdexcept>#include <string>
Go to the source code of this file.
Functions | |
| TEST (TestLinearComptonSpectrum, WeakFieldSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, WeakFieldSampledSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, WeakFieldAngularSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, WeakFieldSampledAngularSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, WeakFieldJointSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, WeakFieldSampledJointSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamAngularSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamJointSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamEnergySpreadSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamEnergySpreadAngularSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamEnergySpreadJointSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamOverlapSpectrumMatchesCainReference) | |
| TEST (TestLinearComptonSpectrum, FiniteBeamOverlapAngularSpectrumMatchesCainReference) | |
Regression tests for CAIN-validated linear-Compton energy and angle spectra.
This file mixes two validation styles:
LinearComptonSpectrumBenchmark, followed by comparison against stored CAIN references.The histogram checks use area, mean, and L1-distance tolerances instead of pointwise equality. That keeps the tests stable across small Monte Carlo and quadrature differences while still detecting shape regressions in the photon spectra.
Definition in file TestLinearComptonSpectrum.cpp.
| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamAngularSpectrumMatchesCainReference | |||
| ) |
Definition at line 298 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::angleHistogramArea(), LinearComptonBenchmark::angleHistogramL1Distance(), LinearComptonBenchmark::angleHistogramMeanRad(), and LinearComptonBenchmark::readAngleCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamEnergySpreadAngularSpectrumMatchesCainReference | |||
| ) |
Definition at line 368 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::angleHistogramArea(), LinearComptonBenchmark::angleHistogramL1Distance(), LinearComptonBenchmark::angleHistogramMeanRad(), and LinearComptonBenchmark::readAngleCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamEnergySpreadJointSpectrumMatchesCainReference | |||
| ) |
Definition at line 389 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::jointHistogramArea(), LinearComptonBenchmark::jointHistogramL1Distance(), LinearComptonBenchmark::jointHistogramMeanEnergyGeV(), LinearComptonBenchmark::jointHistogramMeanThetaRad(), and LinearComptonBenchmark::readJointCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamEnergySpreadSpectrumMatchesCainReference | |||
| ) |
This variant adds a small relative energy spread to the same finite-emittance beam. The tolerance is kept at the same scale as the zero-spread finite-beam case because the stored CAIN reference has high enough statistics to keep the broadened distributions stable.
Definition at line 347 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::histogramArea(), LinearComptonBenchmark::histogramL1Distance(), LinearComptonBenchmark::histogramMeanEnergyGeV(), and LinearComptonBenchmark::readSpectrumCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamJointSpectrumMatchesCainReference | |||
| ) |
Definition at line 318 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::jointHistogramArea(), LinearComptonBenchmark::jointHistogramL1Distance(), LinearComptonBenchmark::jointHistogramMeanEnergyGeV(), LinearComptonBenchmark::jointHistogramMeanThetaRad(), and LinearComptonBenchmark::readJointCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamOverlapAngularSpectrumMatchesCainReference | |||
| ) |
Definition at line 431 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::angleHistogramArea(), LinearComptonBenchmark::angleHistogramL1Distance(), LinearComptonBenchmark::angleHistogramMeanRad(), and LinearComptonBenchmark::readAngleCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamOverlapSpectrumMatchesCainReference | |||
| ) |
Definition at line 413 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::histogramArea(), LinearComptonBenchmark::histogramL1Distance(), LinearComptonBenchmark::histogramMeanEnergyGeV(), and LinearComptonBenchmark::readSpectrumCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| FiniteBeamSpectrumMatchesCainReference | |||
| ) |
The finite-beam regressions allow a small normalization and shape tolerance because they combine Gaussian beam sampling with stochastic Compton event generation. The mean and L1 checks are the primary regression guards.
Definition at line 278 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::histogramArea(), LinearComptonBenchmark::histogramL1Distance(), LinearComptonBenchmark::histogramMeanEnergyGeV(), and LinearComptonBenchmark::readSpectrumCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldAngularSpectrumMatchesCainReference | |||
| ) |
Definition at line 181 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::angleHistogramArea(), LinearComptonBenchmark::angleHistogramL1Distance(), LinearComptonBenchmark::angleHistogramMeanRad(), LinearComptonBenchmark::integrateLabAngularSpectrum(), and LinearComptonBenchmark::readAngleCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldJointSpectrumMatchesCainReference | |||
| ) |
Definition at line 221 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::integrateLabJointSpectrum(), LinearComptonBenchmark::jointHistogramArea(), LinearComptonBenchmark::jointHistogramL1Distance(), LinearComptonBenchmark::jointHistogramMeanEnergyGeV(), LinearComptonBenchmark::jointHistogramMeanThetaRad(), and LinearComptonBenchmark::readJointCSV().

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldSampledAngularSpectrumMatchesCainReference | |||
| ) |
Definition at line 199 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::angleHistogramArea(), LinearComptonBenchmark::angleHistogramL1Distance(), LinearComptonBenchmark::angleHistogramMeanRad(), LinearComptonBenchmark::readAngleCSV(), LinearComptonBenchmark::sampleLabAngularSpectrum(), and Options::seed.

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldSampledJointSpectrumMatchesCainReference | |||
| ) |
Definition at line 245 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::jointHistogramArea(), LinearComptonBenchmark::jointHistogramL1Distance(), LinearComptonBenchmark::jointHistogramMeanEnergyGeV(), LinearComptonBenchmark::jointHistogramMeanThetaRad(), LinearComptonBenchmark::readJointCSV(), LinearComptonBenchmark::sampleLabJointSpectrum(), and Options::seed.

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldSampledSpectrumMatchesCainReference | |||
| ) |
Definition at line 159 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::histogramArea(), LinearComptonBenchmark::histogramL1Distance(), LinearComptonBenchmark::histogramMeanEnergyGeV(), LinearComptonBenchmark::readSpectrumCSV(), LinearComptonBenchmark::sampleLabSpectrum(), and Options::seed.

| TEST | ( | TestLinearComptonSpectrum | , |
| WeakFieldSpectrumMatchesCainReference | |||
| ) |
Definition at line 141 of file TestLinearComptonSpectrum.cpp.
References LinearComptonBenchmark::histogramArea(), LinearComptonBenchmark::histogramL1Distance(), LinearComptonBenchmark::histogramMeanEnergyGeV(), LinearComptonBenchmark::integrateLabSpectrum(), and LinearComptonBenchmark::readSpectrumCSV().
