diff --git a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp index 502caa9ad91..6c95f24e63e 100644 --- a/Core/include/Acts/Surfaces/TrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/TrapezoidBounds.hpp @@ -30,7 +30,6 @@ namespace Acts { /// @image html TrapezoidBounds.gif /// /// @todo can be speed optimized by calculating kappa/delta and caching it - class TrapezoidBounds : public PlanarBounds { public: enum BoundValues { diff --git a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/Smearers.hpp b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/Smearers.hpp index a365c7c7139..a4ba5600edd 100644 --- a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/Smearers.hpp +++ b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/Smearers.hpp @@ -160,7 +160,7 @@ struct Uniform { auto bin = binningData.search(value); auto lower = binningData.boundaries()[bin]; auto higher = binningData.boundaries()[bin + 1]; - std::uniform_real_distribution<> dist{0., 1.}; + std::uniform_real_distribution dist{0., 1.}; double svalue = lower + (higher - lower) * dist(rnd); return std::pair{svalue, (higher - lower) / std::sqrt(12.)}; } diff --git a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp index eef70cf64a5..8472eddbb76 100644 --- a/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp +++ b/Examples/Algorithms/Generators/ActsExamples/Generators/ParametricParticleGenerator.cpp @@ -14,6 +14,7 @@ #include "ActsFatras/EventData/Barcode.hpp" #include "ActsFatras/EventData/Particle.hpp" +#include #include #include #include @@ -37,7 +38,7 @@ ActsExamples::ParametricParticleGenerator::ParametricParticleGenerator( ActsExamples::SimParticleContainer ActsExamples::ParametricParticleGenerator::operator()(RandomEngine& rng) { - using UniformIndex = std::uniform_int_distribution; + using UniformIndex = std::uniform_int_distribution; using UniformReal = std::uniform_real_distribution; // choose between particle/anti-particle if requested diff --git a/Tests/Benchmarks/CovarianceTransportBenchmark.cpp b/Tests/Benchmarks/CovarianceTransportBenchmark.cpp index 8c68a440344..ce6152468bb 100644 --- a/Tests/Benchmarks/CovarianceTransportBenchmark.cpp +++ b/Tests/Benchmarks/CovarianceTransportBenchmark.cpp @@ -49,7 +49,7 @@ int main(int argc, char* argv[]) { VectorHelpers::theta(direction), qop, time; std::minstd_rand rng; - std::uniform_real_distribution<> uniform(0.5, 0.95); + std::uniform_real_distribution uniform(0.5, 0.95); unsigned int sillyCounter = 0; diff --git a/Tests/Benchmarks/SolenoidFieldBenchmark.cpp b/Tests/Benchmarks/SolenoidFieldBenchmark.cpp index af288e60e25..30cc4e951b8 100644 --- a/Tests/Benchmarks/SolenoidFieldBenchmark.cpp +++ b/Tests/Benchmarks/SolenoidFieldBenchmark.cpp @@ -55,9 +55,9 @@ int main(int argc, char* argv[]) { Acts::MagneticFieldContext mctx{}; std::minstd_rand rng; - std::uniform_real_distribution<> zDist(1.5 * (-L / 2.), 1.5 * L / 2.); - std::uniform_real_distribution<> rDist(0, R * 1.5); - std::uniform_real_distribution<> phiDist(-M_PI, M_PI); + std::uniform_real_distribution zDist(1.5 * (-L / 2.), 1.5 * L / 2.); + std::uniform_real_distribution rDist(0, R * 1.5); + std::uniform_real_distribution phiDist(-M_PI, M_PI); auto genPos = [&]() -> Acts::Vector3 { const double z = zDist(rng), r = rDist(rng), phi = phiDist(rng); return {r * std::cos(phi), r * std::sin(phi), z}; diff --git a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp index 9dfa17cb5fd..d9262e2c8ec 100644 --- a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp +++ b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp @@ -22,6 +22,7 @@ #include "Acts/Tests/CommonHelpers/BenchmarkTools.hpp" #include +#include namespace bdata = boost::unit_test::data; namespace tt = boost::test_tools; @@ -89,12 +90,12 @@ MicroBenchmarkResult intersectionTest(const surface_t& surface, double phi, BOOST_DATA_TEST_CASE( benchmark_surface_intersections, - bdata::random( - (bdata::seed = 21, - bdata::distribution = std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, + bdata::distribution = + std::uniform_real_distribution(-M_PI, M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 22, bdata::distribution = - std::uniform_real_distribution<>(-0.3, 0.3))) ^ + std::uniform_real_distribution(-0.3, 0.3))) ^ bdata::xrange(ntests), phi, theta, index) { (void)index; diff --git a/Tests/IntegrationTests/InterpolatedSolenoidBFieldTest.cpp b/Tests/IntegrationTests/InterpolatedSolenoidBFieldTest.cpp index d3eb5873b52..0f4d877e21d 100644 --- a/Tests/IntegrationTests/InterpolatedSolenoidBFieldTest.cpp +++ b/Tests/IntegrationTests/InterpolatedSolenoidBFieldTest.cpp @@ -98,15 +98,17 @@ StreamWrapper valid(std::ofstream("magfield_lookup.csv")); const int ntests = 10000; BOOST_DATA_TEST_CASE( solenoid_interpolated_bfield_comparison, - bdata::random((bdata::seed = 1, bdata::engine = std::mt19937(), - bdata::distribution = std::uniform_real_distribution<>( + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = std::uniform_real_distribution( 1.5 * (-L / 2.), 1.5 * L / 2.))) ^ - bdata::random((bdata::seed = 2, bdata::engine = std::mt19937(), + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, bdata::distribution = - std::uniform_real_distribution<>(0, R * 1.5))) ^ - bdata::random((bdata::seed = 3, bdata::engine = std::mt19937(), + std::uniform_real_distribution(0, + R * 1.5))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::xrange(ntests), z, r, phi, index) { (void)index; diff --git a/Tests/UnitTests/Core/Clusterization/ClusterizationTests1D.cpp b/Tests/UnitTests/Core/Clusterization/ClusterizationTests1D.cpp index fdbb78d2a0c..4dd55736ae4 100644 --- a/Tests/UnitTests/Core/Clusterization/ClusterizationTests1D.cpp +++ b/Tests/UnitTests/Core/Clusterization/ClusterizationTests1D.cpp @@ -88,8 +88,9 @@ BOOST_AUTO_TEST_CASE(Grid_1D_rand) { while (ntries-- > 0) { std::mt19937_64 rnd(startSeed++); - std::uniform_int_distribution distr_size(minsize, maxsize); - std::uniform_int_distribution distr_space(minspace, maxspace); + std::uniform_int_distribution distr_size(minsize, maxsize); + std::uniform_int_distribution distr_space(minspace, + maxspace); int col = 0; @@ -98,8 +99,8 @@ BOOST_AUTO_TEST_CASE(Grid_1D_rand) { for (std::size_t i = 0; i < nclusters; i++) { Cluster cl; col += distr_space(rnd); - std::size_t size = distr_size(rnd); - for (std::size_t j = 0; j < size; j++) { + std::uint32_t size = distr_size(rnd); + for (std::uint32_t j = 0; j < size; j++) { Cell cell(col++); cells.push_back(cell); clusterAddCell(cl, cell); diff --git a/Tests/UnitTests/Core/Clusterization/ClusterizationTests2D.cpp b/Tests/UnitTests/Core/Clusterization/ClusterizationTests2D.cpp index af64b7996b8..97aa95c07a0 100644 --- a/Tests/UnitTests/Core/Clusterization/ClusterizationTests2D.cpp +++ b/Tests/UnitTests/Core/Clusterization/ClusterizationTests2D.cpp @@ -65,8 +65,8 @@ std::vector segment(int x0, int y0, int x1, int y1, RNG& rng) { return {{x0, y0, x1, y1}}; } - int x_ = std::uniform_int_distribution(xmin, xmax)(rng); - int y_ = std::uniform_int_distribution(ymin, ymax)(rng); + int x_ = std::uniform_int_distribution(xmin, xmax)(rng); + int y_ = std::uniform_int_distribution(ymin, ymax)(rng); if (splitx && !splity) { return concat({segment(x0, y0, x_, y1, rng), segment(x_, y0, x1, y1, rng)}); @@ -188,8 +188,8 @@ Cluster2D gencluster(int x0, int y0, int x1, int y1, RNG& rng, int y0_ = y0 + 1; int y1_ = y1 - 1; - int x = std::uniform_int_distribution(x0_, x1_)(rng); - int y = std::uniform_int_distribution(y0_, y1_)(rng); + int x = std::uniform_int_distribution(x0_, x1_)(rng); + int y = std::uniform_int_distribution(y0_, y1_)(rng); std::vector cells = {Cell2D(x, y)}; genclusterw(x, y, x0_, y0_, x1_, y1_, cells, rng, startp, decayp); diff --git a/Tests/UnitTests/Core/Digitization/PlanarModuleStepperTests.cpp b/Tests/UnitTests/Core/Digitization/PlanarModuleStepperTests.cpp index 2b8ce5325b4..8e11e238161 100644 --- a/Tests/UnitTests/Core/Digitization/PlanarModuleStepperTests.cpp +++ b/Tests/UnitTests/Core/Digitization/PlanarModuleStepperTests.cpp @@ -65,19 +65,21 @@ GeometryContext tgContext = GeometryContext(); /// guaranteed to be in on the readout/counter plane BOOST_DATA_TEST_CASE( readout_counter_test, - bdata::random((bdata::seed = 0, - bdata::distribution = std::uniform_real_distribution<>( + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = std::uniform_real_distribution( -halfX + sguardX, halfX - sguardX))) ^ - bdata::random((bdata::seed = 1, - bdata::distribution = std::uniform_real_distribution<>( - -halfX + sguardX, halfX - sguardX))) ^ - bdata::random((bdata::seed = 2, + bdata::random( + (bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = std::uniform_real_distribution( + -halfX + sguardX, halfX - sguardX))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, bdata::distribution = - std::uniform_real_distribution<>(-halfY, halfY))) ^ - bdata::random((bdata::seed = 3, - bdata::distribution = std::uniform_int_distribution<>( - -static_cast(halfY), - static_cast(halfY)))) ^ + std::uniform_real_distribution(-halfY, + halfY))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(-halfY, + halfY))) ^ bdata::xrange(ntests), entryX, entryY, exitX, exitY, index) { // avoid warning with void diff --git a/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp b/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp index 13d47b18ede..fbf1e9ffb85 100644 --- a/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp +++ b/Tests/UnitTests/Core/Geometry/BVHDataTestCase.hpp @@ -24,21 +24,22 @@ auto tg = grid.trackingGeometry; BOOST_DATA_TEST_CASE( bvhnavigation_test, - bdata::random((bdata::seed = 7, bdata::engine = std::mt19937(), - bdata::distribution = std::uniform_real_distribution<>(-5, - 5))) ^ - bdata::random((bdata::seed = 2, bdata::engine = std::mt19937(), + bdata::random( + (bdata::engine = std::mt19937(), bdata::seed = 7, + bdata::distribution = std::uniform_real_distribution(-5, 5))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 3, bdata::engine = std::mt19937(), + std::uniform_real_distribution(-M_PI, + M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, bdata::distribution = - std::uniform_real_distribution<>(-100, 100))) ^ - bdata::random((bdata::seed = 4, bdata::engine = std::mt19937(), + std::uniform_real_distribution(-100, 100))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, bdata::distribution = - std::uniform_real_distribution<>(-100, 100))) ^ - bdata::random((bdata::seed = 5, bdata::engine = std::mt19937(), + std::uniform_real_distribution(-100, 100))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, bdata::distribution = - std::uniform_real_distribution<>(-100, 100))) ^ + std::uniform_real_distribution(-100, 100))) ^ bdata::xrange(NTESTS), eta, phi, x, y, z, index) { using namespace Acts::UnitLiterals; diff --git a/Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp b/Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp index b0cf80eaf8f..5aa7606847a 100644 --- a/Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp +++ b/Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp @@ -151,12 +151,30 @@ BOOST_AUTO_TEST_CASE(CylinderVolumeBoundsAccess) { } /// Unit test for testing the orientedSurfaces() function -BOOST_DATA_TEST_CASE(CylinderVolumeBoundsOrientedSurfaces, - bdata::random(-M_PI, M_PI) ^ bdata::random(-M_PI, M_PI) ^ - bdata::random(-M_PI, M_PI) ^ bdata::random(-10., 10.) ^ - bdata::random(-10., 10.) ^ bdata::random(-10., 10.) ^ - bdata::xrange(100), - alpha, beta, gamma, posX, posY, posZ, index) { +BOOST_DATA_TEST_CASE( + CylinderVolumeBoundsOrientedSurfaces, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-M_PI, M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(-M_PI, + M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(-M_PI, + M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 6, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::xrange(100), + alpha, beta, gamma, posX, posY, posZ, index) { (void)index; // Create a test context diff --git a/Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp b/Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp index e44d9b62c9e..eff2054e6b8 100644 --- a/Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp +++ b/Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp @@ -21,12 +21,28 @@ namespace Acts { namespace Test { /// Unit test for testing the wraps() function of the CylinderVolumeBuilder -BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_wraps, - bdata::random(-11., -15.) ^ bdata::random(11., 15.) ^ - bdata::random(-10., 10.) ^ bdata::random(0., 4.) ^ - bdata::random(11., 15.) ^ bdata::random(10., 15.) ^ - bdata::xrange(100), - left, right, central, inner, outer, length, index) { +BOOST_DATA_TEST_CASE( + CylinderVolumeBuilder_wraps, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-11., -15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(11., 15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(0., 4.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, + bdata::distribution = + std::uniform_real_distribution(11., 15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 6, + bdata::distribution = + std::uniform_real_distribution(10., 15.))) ^ + bdata::xrange(100), + left, right, central, inner, outer, length, index) { (void)index; // inner volume VolumeConfig innerConfig; @@ -97,12 +113,28 @@ BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_wraps, /// Unit test for testing the contains(), containsInR() and containsInZ() /// function of the CylinderVolumeBuilder -BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_containes, - bdata::random(-11., -15.) ^ bdata::random(11., 15.) ^ - bdata::random(-10., 10.) ^ bdata::random(0., 4.) ^ - bdata::random(10., 15.) ^ bdata::random(10., 15.) ^ - bdata::xrange(100), - left, right, central, inner, outer, length, index) { +BOOST_DATA_TEST_CASE( + CylinderVolumeBuilder_containes, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-11., -15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(11., 15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(0., 4.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, + bdata::distribution = + std::uniform_real_distribution(10., 15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 6, + bdata::distribution = + std::uniform_real_distribution(10., 15.))) ^ + bdata::xrange(100), + left, right, central, inner, outer, length, index) { (void)index; // inner volume VolumeConfig innerConfig; @@ -184,10 +216,16 @@ BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_containes, /// Unit test for testing the coverlapsInR() /// function of the CylinderVolumeBuilder -BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_overlapsInR, - bdata::random(0., 4.) ^ bdata::random(11., 15.) ^ - bdata::xrange(100), - inner, outer, index) { +BOOST_DATA_TEST_CASE( + CylinderVolumeBuilder_overlapsInR, + bdata::random(( + bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = std::uniform_real_distribution(0., 4.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(11., 15.))) ^ + bdata::xrange(100), + inner, outer, index) { (void)index; // reference volume VolumeConfig Config0; @@ -246,10 +284,19 @@ BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_overlapsInR, /// Unit test for testing the coverlapsInZ() /// function of the CylinderVolumeBuilder -BOOST_DATA_TEST_CASE(CylinderVolumeBuilder_overlapsInZ, - bdata::random(-11., -15.) ^ bdata::random(11., 15.) ^ - bdata::random(0., 4.) ^ bdata::xrange(100), - left, right, inner, index) { +BOOST_DATA_TEST_CASE( + CylinderVolumeBuilder_overlapsInZ, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-11., -15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(11., 15.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(0., 4.))) ^ + bdata::xrange(100), + left, right, inner, index) { (void)index; // inner volume VolumeConfig Config0; diff --git a/Tests/UnitTests/Core/MagneticField/ConstantBFieldTests.cpp b/Tests/UnitTests/Core/MagneticField/ConstantBFieldTests.cpp index c8227036f06..18c10625279 100644 --- a/Tests/UnitTests/Core/MagneticField/ConstantBFieldTests.cpp +++ b/Tests/UnitTests/Core/MagneticField/ConstantBFieldTests.cpp @@ -36,12 +36,31 @@ MagneticFieldContext mfContext = MagneticFieldContext(); /// -# ConstantBField::ConstantBField(Vector3 B) /// -# ConstantBField::getField(const double* xyz, double* B) const /// -# ConstantBField::getField(const Vector3& pos) const -BOOST_DATA_TEST_CASE(ConstantBField_components, - bdata::random(-2_T, 2_T) ^ bdata::random(-1_T, 4_T) ^ - bdata::random(0_T, 10_T) ^ bdata::random(-10_m, 10_m) ^ - bdata::random(-10_m, 10_m) ^ - bdata::random(-10_m, 10_m) ^ bdata::xrange(10), - x, y, z, bx, by, bz, index) { +BOOST_DATA_TEST_CASE( + ConstantBField_components, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-2_T, 2_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(-1_T, 4_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(0_T, 10_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 6, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::xrange(10), + x, y, z, bx, by, bz, index) { (void)index; const Vector3 Btrue(bx, by, bz); const Vector3 pos(x, y, z); @@ -63,12 +82,31 @@ BOOST_DATA_TEST_CASE(ConstantBField_components, /// -# ConstantBField::setField(const Vector3& B) /// -# ConstantBField::getField(const double* xyz, double* B) const /// -# ConstantBField::getField(const Vector3& pos) const -BOOST_DATA_TEST_CASE(ConstantBField_update, - bdata::random(-2_T, 2_T) ^ bdata::random(-1_T, 4_T) ^ - bdata::random(0_T, 10_T) ^ bdata::random(-10_m, 10_m) ^ - bdata::random(-10_m, 10_m) ^ - bdata::random(-10_m, 10_m) ^ bdata::xrange(10), - x, y, z, bx, by, bz, index) { +BOOST_DATA_TEST_CASE( + ConstantBField_update, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = + std::uniform_real_distribution(-2_T, 2_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(-1_T, 4_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(0_T, 10_T))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 5, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 6, + bdata::distribution = + std::uniform_real_distribution(-10_m, + 10_m))) ^ + bdata::xrange(10), + x, y, z, bx, by, bz, index) { (void)index; ConstantBField BField{Vector3{0, 0, 0}}; diff --git a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp index 78bff97a306..09172c58bcd 100644 --- a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp @@ -213,8 +213,8 @@ BOOST_AUTO_TEST_CASE(VolumeMaterialMapper_comparison_tests) { // Set up a random engine for sampling material std::random_device rd; std::mt19937 gen(42); - std::uniform_real_distribution<> disX(0., 3_m); - std::uniform_real_distribution<> disYZ(-0.5_m, 0.5_m); + std::uniform_real_distribution disX(0., 3_m); + std::uniform_real_distribution disYZ(-0.5_m, 0.5_m); // Sample the Material in the detector RecordedMaterialVolumePoint matRecord; diff --git a/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp b/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp index c0925fbef73..b8cb67374a2 100644 --- a/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp @@ -96,7 +96,7 @@ double oversteppingMaxStepSize = 1_mm; /// @param index is the run index from the test template void runTest(const rpropagator_t& rprop, const dpropagator_t& dprop, double pT, - double phi, double theta, int charge, double time, int index) { + double phi, double theta, int charge, int index) { double dcharge = -1 + 2 * charge; if (index < skip) { @@ -105,9 +105,8 @@ void runTest(const rpropagator_t& rprop, const dpropagator_t& dprop, double pT, // Define start parameters from ranom input double p = pT / sin(theta); - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, - dcharge / p, std::nullopt, - ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, dcharge / p, + std::nullopt, ParticleHypothesis::pion()); using EndOfWorld = EndOfWorldReached; @@ -183,25 +182,24 @@ void runTest(const rpropagator_t& rprop, const dpropagator_t& dprop, double pT, // - this tests the collection of surfaces BOOST_DATA_TEST_CASE( test_direct_navigator, - bdata::random((bdata::seed = 20, - bdata::distribution = - std::uniform_real_distribution<>(0.15_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 21, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 20, + bdata::distribution = std::uniform_real_distribution( + 0.15_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 23, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 24, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 23, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { + pT, phi, theta, charge, index) { // Run the test - runTest(rpropagator, dpropagator, pT, phi, theta, charge, time, index); + runTest(rpropagator, dpropagator, pT, phi, theta, charge, index); } } // namespace Test diff --git a/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp b/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp index c40e89755b9..367f04e1dc4 100644 --- a/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -89,23 +90,22 @@ struct PlaneSelector { // - simple extrapolation test BOOST_DATA_TEST_CASE( test_extrapolation_, - bdata::random((bdata::seed = 0, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 1, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 2, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 3, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 4, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { + pT, phi, theta, charge, index) { double p = pT / sin(theta); double q = -1 + 2 * charge; (void)index; @@ -117,8 +117,8 @@ BOOST_DATA_TEST_CASE( cov << 10_mm, 0, 0.123, 0, 0.5, 0, 0, 10_mm, 0, 0.162, 0, 0, 0.123, 0, 0.1, 0, 0, 0, 0, 0.162, 0, 0.1, 0, 0, 0.5, 0, 0, 0, 1. / (10_GeV), 0, 0, 0, 0, 0, 0, 0; - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, q / p, - cov, ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, + ParticleHypothesis::pion()); PropagatorOptions<> options(tgContext, mfContext); options.maxStepSize = 10_cm; @@ -132,23 +132,22 @@ BOOST_DATA_TEST_CASE( // - this tests the collection of surfaces BOOST_DATA_TEST_CASE( test_surface_collection_, - bdata::random((bdata::seed = 10, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 11, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 10, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 11, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 12, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 13, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 14, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 12, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 13, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { + pT, phi, theta, charge, index) { double p = pT / sin(theta); double q = -1 + 2 * charge; (void)index; @@ -160,8 +159,8 @@ BOOST_DATA_TEST_CASE( cov << 10_mm, 0, 0.123, 0, 0.5, 0, 0, 10_mm, 0, 0.162, 0, 0, 0.123, 0, 0.1, 0, 0, 0, 0, 0.162, 0, 0.1, 0, 0, 0.5, 0, 0, 0, 1. / (10_GeV), 0, 0, 0, 0, 0, 0, 0; - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, q / p, - cov, ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, + ParticleHypothesis::pion()); // A PlaneSelector for the SurfaceCollector using PlaneCollector = SurfaceCollector; @@ -198,23 +197,22 @@ BOOST_DATA_TEST_CASE( // - this tests the collection of surfaces BOOST_DATA_TEST_CASE( test_material_interactor_, - bdata::random((bdata::seed = 20, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 21, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 20, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 23, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 24, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 23, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { + pT, phi, theta, charge, index) { double p = pT / sin(theta); double q = -1 + 2 * charge; (void)index; @@ -226,8 +224,8 @@ BOOST_DATA_TEST_CASE( cov << 10_mm, 0, 0.123, 0, 0.5, 0, 0, 10_mm, 0, 0.162, 0, 0, 0.123, 0, 0.1, 0, 0, 0, 0, 0.162, 0, 0.1, 0, 0, 0.5, 0, 0, 0, 1. / (10_GeV), 0, 0, 0, 0, 0, 0, 0; - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, q / p, - cov, ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, + ParticleHypothesis::pion()); PropagatorOptions> options(tgContext, mfContext); @@ -246,23 +244,22 @@ BOOST_DATA_TEST_CASE( // - this tests the loop protection BOOST_DATA_TEST_CASE( loop_protection_test, - bdata::random((bdata::seed = 20, - bdata::distribution = - std::uniform_real_distribution<>(0.1_GeV, 0.5_GeV))) ^ - bdata::random((bdata::seed = 21, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 20, + bdata::distribution = std::uniform_real_distribution( + 0.1_GeV, 0.5_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 23, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 24, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 23, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { + pT, phi, theta, charge, index) { double p = pT / sin(theta); double q = -1 + 2 * charge; (void)index; @@ -274,8 +271,8 @@ BOOST_DATA_TEST_CASE( cov << 10_mm, 0, 0.123, 0, 0.5, 0, 0, 10_mm, 0, 0.162, 0, 0, 0.123, 0, 0.1, 0, 0, 0, 0, 0.162, 0, 0.1, 0, 0, 0.5, 0, 0, 0, 1. / (10_GeV), 0, 0, 0, 0, 0, 0, 0; - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, q / p, - cov, ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, + ParticleHypothesis::pion()); // Action list and abort list PropagatorOptions> options(tgContext, diff --git a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp index 0aa37fe9c82..a5b5bc4646d 100644 --- a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp @@ -128,12 +128,13 @@ struct PropagatorState { // - this tests the collection of surfaces BOOST_DATA_TEST_CASE( loop_aborter_test, - bdata::random( - (bdata::seed = 21, - bdata::distribution = std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, + bdata::distribution = + std::uniform_real_distribution(-M_PI, M_PI))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 22, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::xrange(1), phi, deltaPhi, index) { (void)index; @@ -168,18 +169,20 @@ const int skip = 0; // stops where expected BOOST_DATA_TEST_CASE( propagator_loop_protection_test, - bdata::random((bdata::seed = 20, - bdata::distribution = - std::uniform_real_distribution<>(0.5_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 21, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 20, + bdata::distribution = std::uniform_real_distribution( + 0.5_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 23, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 23, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), pT, phi, theta, charge, index) { if (index < skip) { diff --git a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp index 4ba2700ff65..efe26a184a5 100644 --- a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp @@ -96,7 +96,7 @@ bool debugModeBwdStep = false; /// @param index is the run index from the test template void runTest(const propagator_t& prop, double pT, double phi, double theta, - int charge, double time, int index) { + int charge, int index) { double p = pT / sin(theta); double q = -1 + 2 * charge; @@ -116,8 +116,8 @@ void runTest(const propagator_t& prop, double pT, double phi, double theta, 0.5, 0, 0, 0, 1_e / 10_GeV, 0, 0, 0, 0, 0, 0, 1_us; // clang-format on - CurvilinearTrackParameters start(Vector4(0, 0, 0, time), phi, theta, q / p, - cov, ParticleHypothesis::pion()); + CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, + ParticleHypothesis::pion()); // Action list and abort list using ActionListType = ActionList; @@ -391,25 +391,24 @@ void runTest(const propagator_t& prop, double pT, double phi, double theta, // - this tests the collection of surfaces BOOST_DATA_TEST_CASE( test_material_collector, - bdata::random((bdata::seed = 20, - bdata::distribution = - std::uniform_real_distribution<>(0.5_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 21, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 20, + bdata::distribution = std::uniform_real_distribution( + 0.5_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 21, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 22, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 23, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 24, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 23, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ bdata::xrange(ntests), - pT, phi, theta, charge, time, index) { - runTest(epropagator, pT, phi, theta, charge, time, index); - runTest(slpropagator, pT, phi, theta, charge, time, index); + pT, phi, theta, charge, index) { + runTest(epropagator, pT, phi, theta, charge, index); + runTest(slpropagator, pT, phi, theta, charge, index); } } // namespace Test diff --git a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp index bf901448856..846ac55e8b0 100644 --- a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp @@ -167,21 +167,24 @@ BOOST_AUTO_TEST_CASE(PropagatorOptions_) { BOOST_DATA_TEST_CASE( cylinder_passage_observer_, - bdata::random((bdata::seed = 0, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 1, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 2, - bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 3, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 4, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-1_ns, + 1_ns))) ^ bdata::xrange(ntests), pT, phi, theta, charge, time, index) { double dcharge = -1 + 2 * charge; @@ -226,21 +229,24 @@ BOOST_DATA_TEST_CASE( BOOST_DATA_TEST_CASE( curvilinear_additive_, - bdata::random((bdata::seed = 0, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 1, - bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 2, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ - bdata::random( - (bdata::seed = 3, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 4, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-1_ns, + 1_ns))) ^ bdata::xrange(ntests), pT, phi, theta, charge, time, index) { double dcharge = -1 + 2 * charge; @@ -303,21 +309,24 @@ BOOST_DATA_TEST_CASE( BOOST_DATA_TEST_CASE( cylinder_additive_, - bdata::random((bdata::seed = 0, - bdata::distribution = - std::uniform_real_distribution<>(0.4_GeV, 10_GeV))) ^ - bdata::random((bdata::seed = 1, - bdata::distribution = - std::uniform_real_distribution<>(-M_PI, M_PI))) ^ - bdata::random((bdata::seed = 2, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = std::uniform_real_distribution( + 0.4_GeV, 10_GeV))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 1, bdata::distribution = - std::uniform_real_distribution<>(1.0, M_PI - 1.0))) ^ + std::uniform_real_distribution(-M_PI, + M_PI))) ^ bdata::random( - (bdata::seed = 3, - bdata::distribution = std::uniform_int_distribution<>(0, 1))) ^ - bdata::random( - (bdata::seed = 4, - bdata::distribution = std::uniform_int_distribution<>(0, 100))) ^ + (bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(1.0, M_PI - 1.0))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_int_distribution(0, 1))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(-1_ns, + 1_ns))) ^ bdata::xrange(ntests), pT, phi, theta, charge, time, index) { double dcharge = -1 + 2 * charge; diff --git a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp index f41b42395b6..c425b76a6ce 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -181,12 +181,12 @@ BOOST_AUTO_TEST_CASE(TrapezoidBoundsProperties) { BOOST_DATA_TEST_CASE( TrapezoidInsideCheck, - bdata::random((bdata::seed = 1, - bdata::distribution = std::uniform_real_distribution<>(-7, - 7))) ^ - bdata::random( - (bdata::seed = 2, - bdata::distribution = std::uniform_real_distribution<>(-3, 3))) ^ + bdata::random( + (bdata::engine = std::mt19937(), bdata::seed = 21, + bdata::distribution = std::uniform_real_distribution(-7, 7))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 22, + bdata::distribution = + std::uniform_real_distribution(-3, 3))) ^ bdata::xrange(1000) * bdata::make({0.0, 0.1, 0.2, 0.3}), x, y, index, tol) { (void)index; diff --git a/Tests/UnitTests/Core/Utilities/BFieldMapUtilsTests.cpp b/Tests/UnitTests/Core/Utilities/BFieldMapUtilsTests.cpp index 273380c7931..5551becdfe4 100644 --- a/Tests/UnitTests/Core/Utilities/BFieldMapUtilsTests.cpp +++ b/Tests/UnitTests/Core/Utilities/BFieldMapUtilsTests.cpp @@ -248,15 +248,15 @@ BOOST_AUTO_TEST_CASE(bfield_symmetry) { /// Unit test for symmetric data BOOST_DATA_TEST_CASE( bfield_symmetry_random, - bdata::random( - (bdata::seed = 0, - bdata::distribution = std::uniform_real_distribution<>(-10., 10.))) ^ - bdata::random((bdata::seed = 0, + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, + bdata::distribution = + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, bdata::distribution = - std::uniform_real_distribution<>(-10., 10.))) ^ - bdata::random((bdata::seed = 0, + std::uniform_real_distribution(-10., 10.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 0, bdata::distribution = - std::uniform_real_distribution<>(-20., 20.))) ^ + std::uniform_real_distribution(-20., 20.))) ^ bdata::xrange(10), x, y, z, index) { (void)index; diff --git a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp index bf1867027dd..a6a01858ba2 100644 --- a/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/AdaptiveMultiVertexFitterTests.cpp @@ -67,29 +67,27 @@ GeometryContext geoContext = GeometryContext(); MagneticFieldContext magFieldContext = MagneticFieldContext(); // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(1._GeV, 30._GeV); +std::uniform_real_distribution pTDist(1._GeV, 30._GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100._um); +std::uniform_real_distribution resIPDist(0., 100._um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(-0.1, 0.1); -// Number of tracks distritbution -std::uniform_int_distribution<> nTracksDist(3, 10); +std::uniform_real_distribution resQoPDist(-0.1, 0.1); /// @brief Unit test for AdaptiveMultiVertexFitter /// diff --git a/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp b/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp index 2cb83803e9e..3a9c7ae4488 100644 --- a/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/FullBilloirVertexFitterTests.cpp @@ -59,40 +59,40 @@ MagneticFieldContext magFieldContext = MagneticFieldContext(); // 4D vertex distributions // x-/y-position -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // z-position -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // time -std::uniform_real_distribution<> vTDist(-1_ns, 1_ns); +std::uniform_real_distribution vTDist(-1_ns, 1_ns); // Track parameter distributions // d0 -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // z0 -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // pT -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // phi -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // theta -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // charge helper -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // time -std::uniform_real_distribution<> tDist(-0.002_ns, 0.002_ns); +std::uniform_real_distribution tDist(-0.002_ns, 0.002_ns); // Track parameter resolution distributions // impact parameters -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // angles -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // q/p -std::uniform_real_distribution<> resQoPDist(-0.1, 0.1); +std::uniform_real_distribution resQoPDist(-0.1, 0.1); // Track time resolution distribution -std::uniform_real_distribution<> resTDist(0.1_ns, 0.2_ns); +std::uniform_real_distribution resTDist(0.1_ns, 0.2_ns); // Number of tracks distritbution -std::uniform_int_distribution<> nTracksDist(3, 10); +std::uniform_int_distribution nTracksDist(3, 10); // Dummy user-defined InputTrack type struct InputTrack { @@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(billoir_vertex_fitter_defaulttrack_test) { const int nEvents = 100; for (int eventIdx = 0; eventIdx < nEvents; ++eventIdx) { // Number of tracks - unsigned int nTracks = nTracksDist(gen); + std::uint32_t nTracks = nTracksDist(gen); // Create position of vertex and perigee surface double x = vXYDist(gen); @@ -214,7 +214,7 @@ BOOST_AUTO_TEST_CASE(billoir_vertex_fitter_defaulttrack_test) { std::vector customTracks; // Calculate random track emerging from vicinity of vertex position - for (unsigned int iTrack = 0; iTrack < nTracks; iTrack++) { + for (std::uint32_t iTrack = 0; iTrack < nTracks; iTrack++) { // Charge double q = qDist(gen) < 0 ? -1. : 1.; diff --git a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp index 94bc6aa0f2a..4020d767a5e 100644 --- a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp @@ -127,9 +127,9 @@ Acts::SquareMatrix4 makeVertexCovariance() { } // random value between 0 and 1 -std::uniform_real_distribution<> uniformDist(0.0, 1.0); +std::uniform_real_distribution uniformDist(0.0, 1.0); // random sign -std::uniform_real_distribution<> signDist(-1, 1); +std::uniform_real_distribution signDist(-1, 1); } // namespace BOOST_AUTO_TEST_SUITE(VertexingImpactPointEstimator) diff --git a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp index 3fb399d1d80..33d587e2c08 100644 --- a/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/IterativeVertexFinderTests.cpp @@ -73,31 +73,31 @@ MagneticFieldContext magFieldContext = MagneticFieldContext(); const std::string toolString = "IVF"; // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(-0.01, 0.01); +std::uniform_real_distribution resQoPDist(-0.01, 0.01); // Number of vertices per test event distribution -std::uniform_int_distribution<> nVertexDist(1, 6); +std::uniform_int_distribution nVertexDist(1, 6); // Number of tracks per vertex distribution -std::uniform_int_distribution<> nTracksDist(5, 15); +std::uniform_int_distribution nTracksDist(5, 15); // Dummy user-defined InputTrack type struct InputTrack { @@ -184,10 +184,10 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test) { std::vector> trueVertices; // start creating event with nVertices vertices - unsigned int nVertices = nVertexDist(gen); - for (unsigned int iVertex = 0; iVertex < nVertices; ++iVertex) { + std::uint32_t nVertices = nVertexDist(gen); + for (std::uint32_t iVertex = 0; iVertex < nVertices; ++iVertex) { // Number of tracks - unsigned int nTracks = nTracksDist(gen); + std::uint32_t nTracks = nTracksDist(gen); if (debug) { std::cout << "Event " << iEvent << ", Vertex " << iVertex << "/" @@ -399,10 +399,10 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_user_track_type) { std::vector> trueVertices; // start creating event with nVertices vertices - unsigned int nVertices = nVertexDist(gen); - for (unsigned int iVertex = 0; iVertex < nVertices; ++iVertex) { + std::uint32_t nVertices = nVertexDist(gen); + for (std::uint32_t iVertex = 0; iVertex < nVertices; ++iVertex) { // Number of tracks - unsigned int nTracks = nTracksDist(gen); + std::uint32_t nTracks = nTracksDist(gen); if (debug) { std::cout << "Event " << iEvent << ", Vertex " << iVertex << "/" @@ -428,7 +428,7 @@ BOOST_AUTO_TEST_CASE(iterative_finder_test_user_track_type) { // Construct random track emerging from vicinity of vertex position // Vector to store track objects used for vertex fit - for (unsigned int iTrack = 0; iTrack < nTracks; iTrack++) { + for (std::uint32_t iTrack = 0; iTrack < nTracks; iTrack++) { // Construct positive or negative charge randomly double q = qDist(gen) < 0 ? -1. : 1.; diff --git a/Tests/UnitTests/Core/Vertexing/KalmanVertexTrackUpdaterTests.cpp b/Tests/UnitTests/Core/Vertexing/KalmanVertexTrackUpdaterTests.cpp index 141196193d0..6cb097ad86f 100644 --- a/Tests/UnitTests/Core/Vertexing/KalmanVertexTrackUpdaterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/KalmanVertexTrackUpdaterTests.cpp @@ -58,27 +58,27 @@ GeometryContext geoContext = GeometryContext(); MagneticFieldContext magFieldContext = MagneticFieldContext(); // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(-0.01, 0.01); +std::uniform_real_distribution resQoPDist(-0.01, 0.01); /// /// @brief Unit test for KalmanVertexTrackUpdater diff --git a/Tests/UnitTests/Core/Vertexing/KalmanVertexUpdaterTests.cpp b/Tests/UnitTests/Core/Vertexing/KalmanVertexUpdaterTests.cpp index 6f3aa39b4fd..7629ec8e5d4 100644 --- a/Tests/UnitTests/Core/Vertexing/KalmanVertexUpdaterTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/KalmanVertexUpdaterTests.cpp @@ -58,27 +58,27 @@ GeometryContext geoContext = GeometryContext(); MagneticFieldContext magFieldContext = MagneticFieldContext(); // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(-0.01, 0.01); +std::uniform_real_distribution resQoPDist(-0.01, 0.01); // Number of vertices per test event distribution /// diff --git a/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp b/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp index f908d05d63f..e8cd7e89475 100644 --- a/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/LinearizedTrackFactoryTests.cpp @@ -62,33 +62,33 @@ GeometryContext geoContext = GeometryContext(); MagneticFieldContext magFieldContext = MagneticFieldContext(); // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Vertex time distribution -std::uniform_real_distribution<> vTDist(-1_ns, 1_ns); +std::uniform_real_distribution vTDist(-1_ns, 1_ns); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track time distribution -std::uniform_real_distribution<> tDist(-0.002_ns, 0.002_ns); +std::uniform_real_distribution tDist(-0.002_ns, 0.002_ns); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(0.0, 0.1); +std::uniform_real_distribution resQoPDist(0.0, 0.1); // Track time resolution distribution -std::uniform_real_distribution<> resTDist(0.1_ns, 0.2_ns); +std::uniform_real_distribution resTDist(0.1_ns, 0.2_ns); /// /// @brief Test HelicalTrackLinearizer by comparing it to NumericalTrackLinearizer. diff --git a/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp b/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp index 802e4b7cc34..c328153bc50 100644 --- a/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ZScanVertexFinderTests.cpp @@ -62,27 +62,27 @@ GeometryContext geoContext = GeometryContext(); MagneticFieldContext magFieldContext = MagneticFieldContext(); // Vertex x/y position distribution -std::uniform_real_distribution<> vXYDist(-0.1_mm, 0.1_mm); +std::uniform_real_distribution vXYDist(-0.1_mm, 0.1_mm); // Vertex z position distribution -std::uniform_real_distribution<> vZDist(-20_mm, 20_mm); +std::uniform_real_distribution vZDist(-20_mm, 20_mm); // Track d0 distribution -std::uniform_real_distribution<> d0Dist(-0.01_mm, 0.01_mm); +std::uniform_real_distribution d0Dist(-0.01_mm, 0.01_mm); // Track z0 distribution -std::uniform_real_distribution<> z0Dist(-0.2_mm, 0.2_mm); +std::uniform_real_distribution z0Dist(-0.2_mm, 0.2_mm); // Track pT distribution -std::uniform_real_distribution<> pTDist(0.4_GeV, 10_GeV); +std::uniform_real_distribution pTDist(0.4_GeV, 10_GeV); // Track phi distribution -std::uniform_real_distribution<> phiDist(-M_PI, M_PI); +std::uniform_real_distribution phiDist(-M_PI, M_PI); // Track theta distribution -std::uniform_real_distribution<> thetaDist(1.0, M_PI - 1.0); +std::uniform_real_distribution thetaDist(1.0, M_PI - 1.0); // Track charge helper distribution -std::uniform_real_distribution<> qDist(-1, 1); +std::uniform_real_distribution qDist(-1, 1); // Track IP resolution distribution -std::uniform_real_distribution<> resIPDist(0., 100_um); +std::uniform_real_distribution resIPDist(0., 100_um); // Track angular distribution -std::uniform_real_distribution<> resAngDist(0., 0.1); +std::uniform_real_distribution resAngDist(0., 0.1); // Track q/p resolution distribution -std::uniform_real_distribution<> resQoPDist(-0.01, 0.01); +std::uniform_real_distribution resQoPDist(-0.01, 0.01); /// /// @brief Unit test for ZScanVertexFinder diff --git a/Tests/UnitTests/Examples/Io/Csv/MeasurementReaderWriterTests.cpp b/Tests/UnitTests/Examples/Io/Csv/MeasurementReaderWriterTests.cpp index a895e61b64c..c1caf95118c 100644 --- a/Tests/UnitTests/Examples/Io/Csv/MeasurementReaderWriterTests.cpp +++ b/Tests/UnitTests/Examples/Io/Csv/MeasurementReaderWriterTests.cpp @@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(CsvMeasurementRoundTrip) { Acts::GeometryIdentifier someGeoId{298453}; std::mt19937 gen(23); - std::uniform_int_distribution disti(1, 10); + std::uniform_int_distribution disti(1, 10); std::uniform_real_distribution distf(0.0, 1.0); for (auto i = 0ul; i < nMeasurements; ++i) { diff --git a/Tests/UnitTests/Examples/Io/Root/SimhitReaderWriterTests.cpp b/Tests/UnitTests/Examples/Io/Root/SimhitReaderWriterTests.cpp index 7fad87311cb..1037c6fc3fc 100644 --- a/Tests/UnitTests/Examples/Io/Root/SimhitReaderWriterTests.cpp +++ b/Tests/UnitTests/Examples/Io/Root/SimhitReaderWriterTests.cpp @@ -25,9 +25,9 @@ using namespace Acts::Test; std::mt19937 gen(23); auto makeTestSimhits(std::size_t nSimHits) { - std::uniform_int_distribution distIds( + std::uniform_int_distribution distIds( 1, std::numeric_limits::max()); - std::uniform_int_distribution distIndex(1, 20); + std::uniform_int_distribution distIndex(1, 20); SimHitContainer simhits; for (auto i = 0ul; i < nSimHits; ++i) { diff --git a/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceMaskTests.cpp b/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceMaskTests.cpp index ac10be6ba50..bbf5d4bf72b 100644 --- a/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceMaskTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceMaskTests.cpp @@ -131,11 +131,22 @@ std::vector> segmentOutput; int ntests = 100; /// Unit test for testing the Surface mask -BOOST_DATA_TEST_CASE(RandomPlanarSurfaceMask, - bdata::random(0., 1.) ^ bdata::random(0., 1.) ^ - bdata::random(0., 1.) ^ bdata::random(0., 1.) ^ - bdata::xrange(ntests), - startR0, startR1, endR0, endR1, index) { +BOOST_DATA_TEST_CASE( + RandomPlanarSurfaceMask, + bdata::random(( + bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::xrange(ntests), + startR0, startR1, endR0, endR1, index) { Acts::GeometryContext geoCtx; ActsFatras::PlanarSurfaceMask psm; diff --git a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp index eea29e59bc3..8bca761f28e 100644 --- a/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp @@ -119,11 +119,22 @@ BOOST_AUTO_TEST_CASE(SegmentizerPolarRadial) { } /// Unit test for testing the Segmentizer -BOOST_DATA_TEST_CASE(RandomSegmentizerTest, - bdata::random(0., 1.) ^ bdata::random(0., 1.) ^ - bdata::random(0., 1.) ^ bdata::random(0., 1.) ^ - bdata::xrange(25), - startR0, startR1, endR0, endR1, index) { +BOOST_DATA_TEST_CASE( + RandomSegmentizerTest, + bdata::random(( + bdata::engine = std::mt19937(), bdata::seed = 1, + bdata::distribution = std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 3, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::random((bdata::engine = std::mt19937(), bdata::seed = 4, + bdata::distribution = + std::uniform_real_distribution(0., 1.))) ^ + bdata::xrange(25), + startR0, startR1, endR0, endR1, index) { Acts::GeometryContext geoCtx; Segmentizer cl; diff --git a/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp b/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp index 7bfc6654ff4..6412ad73062 100644 --- a/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp +++ b/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp @@ -224,8 +224,8 @@ BOOST_AUTO_TEST_CASE(RoundTripTests) { std::normal_distribution gauss(0., 1.); std::uniform_real_distribution f(-1, 1); std::uniform_real_distribution r(0, 1); - std::uniform_int_distribution nTracks(2, 20); - std::uniform_int_distribution nTs(1, 20); + std::uniform_int_distribution nTracks(2, 20); + std::uniform_int_distribution nTs(1, 20); std::uniform_real_distribution phiDist(-M_PI, M_PI); std::uniform_real_distribution etaDist(-4, 4); std::uniform_real_distribution ptDist(1_MeV, 10_GeV); @@ -251,8 +251,8 @@ BOOST_AUTO_TEST_CASE(RoundTripTests) { return {par, cov}; }; - std::size_t numT = nTracks(rng); - for (std::size_t t = 0; t < numT; t++) { + std::uint32_t numT = nTracks(rng); + for (std::uint32_t t = 0; t < numT; t++) { auto track = tracks.getTrack(tracks.addTrack()); { auto [par, cov] = genParams(); @@ -262,8 +262,8 @@ BOOST_AUTO_TEST_CASE(RoundTripTests) { track.setReferenceSurface( Acts::Surface::makeShared(Vector3{0, 0, 0})); - std::size_t numTs = nTs(rng); - for (std::size_t i = 0; i < numTs; i++) { + std::uint32_t numTs = nTs(rng); + for (std::uint32_t i = 0; i < numTs; i++) { auto ts = track.appendTrackState(TrackStatePropMask::Smoothed); double crit = r(rng); if (crit < 0.1) {