Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Nov 18, 2023
1 parent 176d4da commit 503a055
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 48 deletions.
28 changes: 22 additions & 6 deletions Tests/UnitTests/Core/Geometry/CylinderVolumeBoundsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,28 @@ 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
Expand Down
87 changes: 67 additions & 20 deletions Tests/UnitTests/Core/Geometry/CylinderVolumeBuilderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2,
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 = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10., 10.))) ^
bdata::random(
(bdata::engine = std::mt19937(), bdata::seed = 2,
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::random((
bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution = std::uniform_real_distribution<>(10., 15.))) ^
bdata::xrange(100),
left, right, central, inner, outer, length, index) {
(void)index;
// inner volume
VolumeConfig innerConfig;
Expand Down Expand Up @@ -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 = 2,
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 = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10., 10.))) ^
bdata::random(
(bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution = std::uniform_real_distribution<>(0., 4.))) ^
bdata::random((
bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution = std::uniform_real_distribution<>(10., 15.))) ^
bdata::random((
bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution = std::uniform_real_distribution<>(10., 15.))) ^
bdata::xrange(100),
left, right, central, inner, outer, length, index) {
(void)index;
// inner volume
VolumeConfig innerConfig;
Expand Down Expand Up @@ -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 = 2,
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;
Expand Down Expand Up @@ -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 = 2,
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 = 2,
bdata::distribution = std::uniform_real_distribution<>(0., 4.))) ^
bdata::xrange(100),
left, right, inner, index) {
(void)index;
// inner volume
VolumeConfig Config0;
Expand Down
56 changes: 44 additions & 12 deletions Tests/UnitTests/Core/MagneticField/ConstantBFieldTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,28 @@ 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 = 2,
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 = 2,
bdata::distribution =
std::uniform_real_distribution<>(0_T, 10_T))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10_m, 10_m))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10_m, 10_m))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
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);
Expand All @@ -63,12 +79,28 @@ 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 = 2,
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 = 2,
bdata::distribution =
std::uniform_real_distribution<>(0_T, 10_T))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10_m, 10_m))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
bdata::distribution =
std::uniform_real_distribution<>(-10_m, 10_m))) ^
bdata::random((bdata::engine = std::mt19937(), bdata::seed = 2,
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}};
Expand Down
21 changes: 16 additions & 5 deletions Tests/UnitTests/Fatras/Digitization/PlanarSurfaceMaskTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,22 @@ std::vector<std::array<std::ofstream, 3>> 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 = 2,
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 = 2,
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::xrange(ntests),
startR0, startR1, endR0, endR1, index) {
Acts::GeometryContext geoCtx;

ActsFatras::PlanarSurfaceMask psm;
Expand Down
21 changes: 16 additions & 5 deletions Tests/UnitTests/Fatras/Digitization/SegmentizerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 2,
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 = 2,
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::xrange(25),
startR0, startR1, endR0, endR1, index) {
Acts::GeometryContext geoCtx;
Segmentizer cl;

Expand Down

0 comments on commit 503a055

Please sign in to comment.