Project
Loading...
Searching...
No Matches
O2SolidHarness.h File Reference

Validation and timing harness for TGeoShape navigation, typed on plain TGeoShape*. More...

#include "TGeoShape.h"
#include <array>
#include <chrono>
#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  o2::cad::harness::Ray
 
struct  o2::cad::harness::SampleConfig
 Parameters of generateSamples; the counts are targets, and a category may come back short. More...
 
struct  o2::cad::harness::SampleSet
 
struct  o2::cad::harness::Offender
 
struct  o2::cad::harness::ValidationResult
 
struct  o2::cad::harness::ValidationOptions
 
struct  o2::cad::harness::TimingResult
 

Namespaces

namespace  o2
 a couple of static helper functions to create timestamp values for CCDB queries or override obsolete objects
 
namespace  o2::cad
 
namespace  o2::cad::harness
 
namespace  o2::cad::harness::detail
 

Typedefs

using o2::cad::harness::Point3D = std::array< double, 3 >
 

Functions

SampleSet o2::cad::harness::generateSamples (const TGeoShape *reference, const Point3D &bboxMin, const Point3D &bboxMax, const SampleConfig &cfg={})
 A deterministic sample set from cfg.seed and the bbox; reference, the trusted mesh, classifies the points.
 
ValidationResult o2::cad::harness::validateContains (const TGeoShape *candidate, const TGeoShape *reference, const std::vector< Point3D > &points, const ValidationOptions &opt={})
 
ValidationResult o2::cad::harness::validateDistFromOutside (const TGeoShape *candidate, const TGeoShape *reference, const std::vector< Ray > &rays, const ValidationOptions &opt={})
 
ValidationResult o2::cad::harness::validateDistFromInside (const TGeoShape *candidate, const TGeoShape *reference, const std::vector< Ray > &rays, const ValidationOptions &opt={})
 
ValidationResult o2::cad::harness::validateSafety (const TGeoShape *shape, const std::vector< Point3D > &points, const ValidationOptions &opt={})
 Check one shape's Safety() lower-bound contract against its own DistFrom* along six probe directions; never compares two shapes.
 
ValidationResult o2::cad::harness::validateContainsAgainstOracle (const TGeoShape *candidate, const std::vector< Point3D > &points, const std::vector< int > &oracleState, const std::vector< double > &oracleBoundaryDistance, const ValidationOptions &opt={})
 oracleState: 1 inside, 0 outside, -1 declined; oracleBoundaryDistance may cover only a prefix of points.
 
ValidationResult o2::cad::harness::validateDistanceAgainstOracle (const TGeoShape *candidate, const std::vector< Ray > &rays, const std::vector< double > &oracleDistance, bool wantInside, const ValidationOptions &opt={}, const std::vector< int > &oracleOriginState={})
 
ValidationResult o2::cad::harness::validateSafetyAgainstOracle (const TGeoShape *candidate, const std::vector< Point3D > &points, const std::vector< double > &oracleBoundaryDistance, const ValidationOptions &opt={})
 Safety's contract against the oracle's exact distance: 0 <= safety <= trueDistance.
 
uint64_t o2::cad::harness::detail::mixDouble (uint64_t acc, double value)
 
template<typename RayKernel >
TimingResult o2::cad::harness::timeRayKernel (const std::vector< Ray > &rays, int warmupRepeats, int timedRepeats, RayKernel &&kernel)
 Time a per-ray kernel kernel(origin, dir) exactly like the timeDistFrom* functions, e.g. a _Loop twin.
 
TimingResult o2::cad::harness::timeContains (const TGeoShape *shape, const std::vector< Point3D > &points, int warmupRepeats, int timedRepeats)
 
TimingResult o2::cad::harness::timeDistFromOutside (const TGeoShape *shape, const std::vector< Ray > &rays, int warmupRepeats, int timedRepeats, double stepmax=TGeoShape::Big())
 
TimingResult o2::cad::harness::timeDistFromInside (const TGeoShape *shape, const std::vector< Ray > &rays, int warmupRepeats, int timedRepeats)
 
TimingResult o2::cad::harness::timeSafety (const TGeoShape *shape, const std::vector< Point3D > &points, int warmupRepeats, int timedRepeats)
 
TGeoShape * o2::cad::harness::loadShapeFromRootFile (const std::string &path, std::string *error=nullptr)
 Read the single TGeoShape of a shape_<part>.root sidecar; nullptr on failure, with the reason in *error. The caller owns it.
 
TGeoHMatrix * o2::cad::harness::loadShapePlacementFromRootFile (const std::string &path)
 Read the shape's placement, or nullptr when there is none, meaning the identity. The caller owns it.
 
bool o2::cad::harness::saveShapeToRootFile (const std::string &path, const TGeoShape &shape, std::string *error=nullptr)
 Write a shape sidecar, with placement under "placement" unless it is null or the identity.
 
bool o2::cad::harness::saveShapeToRootFile (const std::string &path, const TGeoShape &shape, const TGeoMatrix *placement, std::string *error)
 

Detailed Description

Validation and timing harness for TGeoShape navigation, typed on plain TGeoShape*.

Author
Sandro Wenzel sandr.nosp@m.o.we.nosp@m.nzel@.nosp@m.cern.nosp@m..ch
Since
2026-07

Definition in file O2SolidHarness.h.