Project
Loading...
Searching...
No Matches
testBVHAssembly.cxx File Reference
#include <boost/test/unit_test.hpp>
#include "CADSupport/O2BVHAssembly.h"
#include "TFile.h"
#include "TGeoBBox.h"
#include "TGeoManager.h"
#include "TGeoMaterial.h"
#include "TGeoMatrix.h"
#include "TGeoMedium.h"
#include "TGeoNode.h"
#include "TGeoShapeAssembly.h"
#include "TGeoVolume.h"
#include <cmath>
#include <cstdio>
#include <filesystem>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   Test O2BVHAssembly class
 
#define BOOST_TEST_MAIN
 
#define BOOST_TEST_DYN_LINK
 

Functions

 BOOST_AUTO_TEST_CASE (BuildsOnePrimitivePerDaughter)
 
 BOOST_AUTO_TEST_CASE (BoundingBoxMatchesRoot)
 
 BOOST_AUTO_TEST_CASE (EmptyAssemblyAnswersNothing)
 
 BOOST_AUTO_TEST_CASE (ContainsMatchesLoopOnAGrid)
 
 BOOST_AUTO_TEST_CASE (DistFromOutsideMatchesLoopOnAGrid)
 
 BOOST_AUTO_TEST_CASE (DistFromOutsideRespectsTheStepBound)
 
 BOOST_AUTO_TEST_CASE (SafetyMatchesLoopOnAGrid)
 
 BOOST_AUTO_TEST_CASE (ContainsAgreesWithRootOnAClosedGeometry)
 
 BOOST_AUTO_TEST_CASE (SafetyIsNeverLargerThanRoot)
 
 BOOST_AUTO_TEST_CASE (DistFromOutsideIsNeverWorseThanRoot)
 
 BOOST_AUTO_TEST_CASE (OverlappingDaughtersResolveToTheLowestIndex)
 
 BOOST_AUTO_TEST_CASE (NestedAssembliesAgreeWithTheLoop)
 
 BOOST_AUTO_TEST_CASE (RotatedDaughtersAgreeWithTheLoop)
 
 BOOST_AUTO_TEST_CASE (PointsOnSharedFacesAgreeWithTheLoop)
 
 BOOST_AUTO_TEST_CASE (RaysAlongASeamAgreeWithTheLoop)
 
 BOOST_AUTO_TEST_CASE (RaysAlongTheCoordinateAxesAgreeWithTheLoop)
 
 BOOST_AUTO_TEST_CASE (AddingADaughterRebuildsLazily)
 
 BOOST_AUTO_TEST_CASE (MakeBVHAssemblySwapsTheShapeAndKeepsTheVoxels)
 
 BOOST_AUTO_TEST_CASE (NavigationFindsTheSameLeafBeforeAndAfterTheSwap)
 
 BOOST_AUTO_TEST_CASE (TransportCrossesTheSameLeavesAsRoot)
 
 BOOST_AUTO_TEST_CASE (SurvivesAGeometryRoundTrip)
 

Macro Definition Documentation

◆ BOOST_TEST_DYN_LINK

#define BOOST_TEST_DYN_LINK

Definition at line 16 of file testBVHAssembly.cxx.

◆ BOOST_TEST_MAIN

#define BOOST_TEST_MAIN

Definition at line 15 of file testBVHAssembly.cxx.

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Test O2BVHAssembly class
Author
Sandro Wenzel sandr.nosp@m.o.we.nosp@m.nzel@.nosp@m.cern.nosp@m..ch
Since
2026-08

Definition at line 14 of file testBVHAssembly.cxx.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/21]

BOOST_AUTO_TEST_CASE ( AddingADaughterRebuildsLazily  )

Definition at line 560 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [2/21]

BOOST_AUTO_TEST_CASE ( BoundingBoxMatchesRoot  )

Definition at line 143 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [3/21]

BOOST_AUTO_TEST_CASE ( BuildsOnePrimitivePerDaughter  )

Definition at line 134 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [4/21]

BOOST_AUTO_TEST_CASE ( ContainsAgreesWithRootOnAClosedGeometry  )

Definition at line 272 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [5/21]

BOOST_AUTO_TEST_CASE ( ContainsMatchesLoopOnAGrid  )

Definition at line 180 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [6/21]

BOOST_AUTO_TEST_CASE ( DistFromOutsideIsNeverWorseThanRoot  )

ROOT's DistFromOutside gives up on a point outside the assembly bounding box when the volume is voxelized. This pins the direction of the disagreement: ROOT is allowed to be right or to return Big(), never to return a different finite answer. It keeps passing if ROOT is fixed upstream.

Definition at line 322 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [7/21]

BOOST_AUTO_TEST_CASE ( DistFromOutsideMatchesLoopOnAGrid  )

Definition at line 204 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [8/21]

BOOST_AUTO_TEST_CASE ( DistFromOutsideRespectsTheStepBound  )

Definition at line 237 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [9/21]

BOOST_AUTO_TEST_CASE ( EmptyAssemblyAnswersNothing  )

Definition at line 159 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [10/21]

BOOST_AUTO_TEST_CASE ( MakeBVHAssemblySwapsTheShapeAndKeepsTheVoxels  )

Definition at line 584 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [11/21]

BOOST_AUTO_TEST_CASE ( NavigationFindsTheSameLeafBeforeAndAfterTheSwap  )

Definition at line 601 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [12/21]

BOOST_AUTO_TEST_CASE ( NestedAssembliesAgreeWithTheLoop  )

Definition at line 402 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [13/21]

BOOST_AUTO_TEST_CASE ( OverlappingDaughtersResolveToTheLowestIndex  )

Definition at line 363 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [14/21]

BOOST_AUTO_TEST_CASE ( PointsOnSharedFacesAgreeWithTheLoop  )

Definition at line 482 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [15/21]

BOOST_AUTO_TEST_CASE ( RaysAlongASeamAgreeWithTheLoop  )

Definition at line 509 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [16/21]

BOOST_AUTO_TEST_CASE ( RaysAlongTheCoordinateAxesAgreeWithTheLoop  )

Definition at line 536 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [17/21]

BOOST_AUTO_TEST_CASE ( RotatedDaughtersAgreeWithTheLoop  )

Definition at line 450 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [18/21]

BOOST_AUTO_TEST_CASE ( SafetyIsNeverLargerThanRoot  )

ROOT's TGeoShapeAssembly::Safety prunes daughters on the Euclidean gap to their bounding boxes while TGeoBBox::Safety answers the axis-max gap, which is smaller – so ROOT discards daughters that would have answered less and returns more than the minimum over its own daughters. This class prunes on the axis-max gap and returns the minimum. The requirement is therefore one-sided: never more than ROOT, and always exactly the loop.

Definition at line 298 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [19/21]

BOOST_AUTO_TEST_CASE ( SafetyMatchesLoopOnAGrid  )

Definition at line 251 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [20/21]

BOOST_AUTO_TEST_CASE ( SurvivesAGeometryRoundTrip  )

Definition at line 673 of file testBVHAssembly.cxx.

◆ BOOST_AUTO_TEST_CASE() [21/21]

BOOST_AUTO_TEST_CASE ( TransportCrossesTheSameLeavesAsRoot  )

Definition at line 625 of file testBVHAssembly.cxx.