Project
Loading...
Searching...
No Matches
o2::cad::bench Namespace Reference

Namespaces

namespace  detail
 

Classes

class  BallastShape
 
struct  BooleanTreeStats
 
struct  MemorySnapshot
 
struct  QuerySamples
 
struct  StructuralMemory
 
struct  TimingStat
 

Enumerations

enum class  LadderShape { Chain , Balanced }
 

Functions

template<typename Pass >
TimingStat timePasses (long long callsPerPass, int warmupPasses, int passes, Pass &&pass)
 
MemorySnapshot readMemory ()
 
MemorySnapshot operator- (const MemorySnapshot &a, const MemorySnapshot &b)
 
long long fileBytes (const std::string &path)
 
QuerySamples buildQuerySamples (const TGeoShape *reference, const std::string &referenceName, const Point3D &bboxMin, const Point3D &bboxMax, int nPoints, int nRays, uint64_t seed=20260802ULL, double inflate=0.12)
 
TimingStat timeContainsPass (const TGeoShape *shape, const QuerySamples &s, int warmup, int passes)
 
TimingStat timeSafetyPass (const TGeoShape *shape, const QuerySamples &s, int warmup, int passes)
 
TimingStat timeDistOutPass (const TGeoShape *shape, const QuerySamples &s, int warmup, int passes)
 
TimingStat timeDistInPass (const TGeoShape *shape, const QuerySamples &s, int warmup, int passes)
 
TGeoShape * buildBooleanLadder (int leaves, LadderShape shape, const std::string &tag)
 
BooleanTreeStats booleanTreeStats (const TGeoShape *shape)
 

Enumeration Type Documentation

◆ LadderShape

enum class o2::cad::bench::LadderShape
strong
Enumerator
Chain 
Balanced 

Definition at line 426 of file RepresentationBench.h.

Function Documentation

◆ booleanTreeStats()

BooleanTreeStats o2::cad::bench::booleanTreeStats ( const TGeoShape *  shape)
inline

Definition at line 505 of file RepresentationBench.h.

◆ buildBooleanLadder()

TGeoShape * o2::cad::bench::buildBooleanLadder ( int  leaves,
LadderShape  shape,
const std::string &  tag 
)
inline

One rung of the ladder: leaves overlapping tubes on a line, unioned in the requested shape.

Overlapping rather than disjoint, deliberately: the corpus's booleans are two COAXIAL tubes with shared interior, and a union of disjoint bodies is an easier question (a point is inside at most one leaf, so a short-circuiting evaluator stops early on every interior query). The pitch of 0.8 against a radius of 0.5 gives every leaf a genuine overlap with its neighbour.

Returns a shape owned by the current gGeoManager, like every other TGeoShape.

Definition at line 437 of file RepresentationBench.h.

◆ buildQuerySamples()

QuerySamples o2::cad::bench::buildQuerySamples ( const TGeoShape *  reference,
const std::string &  referenceName,
const Point3D &  bboxMin,
const Point3D &  bboxMax,
int  nPoints,
int  nRays,
uint64_t  seed = 20260802ULL,
double  inflate = 0.12 
)
inline

Build the shared sample sets from reference's own classification.

nPoints points are drawn uniformly over the bounding box inflated by inflate, so the set contains both interior and exterior points in whatever ratio the part's own fill factor gives – which is the realistic mixture a navigator sees, and is a per-part property that is reported rather than forced. Rays are drawn until the requested counts are met or the attempt budget runs out; outside rays are AIMED at a random point of the bounding box, because an isotropically-directed ray from outside misses a thin part almost always and would time the miss path exclusively.

Definition at line 266 of file RepresentationBench.h.

◆ fileBytes()

long long o2::cad::bench::fileBytes ( const std::string &  path)
inline

Bytes a .bin/.root sidecar occupies on disk. Exact, and the one memory number that needs no assumption about anybody's allocator.

Definition at line 218 of file RepresentationBench.h.

◆ operator-()

MemorySnapshot o2::cad::bench::operator- ( const MemorySnapshot a,
const MemorySnapshot b 
)
inline

Definition at line 199 of file RepresentationBench.h.

◆ readMemory()

MemorySnapshot o2::cad::bench::readMemory ( )
inline

Definition at line 180 of file RepresentationBench.h.

◆ timeContainsPass()

TimingStat o2::cad::bench::timeContainsPass ( const TGeoShape *  shape,
const QuerySamples s,
int  warmup,
int  passes 
)
inline

Definition at line 346 of file RepresentationBench.h.

◆ timeDistInPass()

TimingStat o2::cad::bench::timeDistInPass ( const TGeoShape *  shape,
const QuerySamples s,
int  warmup,
int  passes 
)
inline

Definition at line 391 of file RepresentationBench.h.

◆ timeDistOutPass()

TimingStat o2::cad::bench::timeDistOutPass ( const TGeoShape *  shape,
const QuerySamples s,
int  warmup,
int  passes 
)
inline

Definition at line 373 of file RepresentationBench.h.

◆ timePasses()

template<typename Pass >
TimingStat o2::cad::bench::timePasses ( long long  callsPerPass,
int  warmupPasses,
int  passes,
Pass &&  pass 
)

Time pass() – one complete sweep over the sample set, returning a checksum – over warmupPasses untimed and passes timed repetitions, and report the median ns/call.

The warmup is not decoration: the first pass over a freshly loaded shape pays for the page faults of its own data and for the branch predictor's ignorance, and on the mesh representation that alone was measured at more than 2x the steady-state cost. Every number this function returns is therefore a WARM-CACHE number, and the caller is expected to say so.

Definition at line 126 of file RepresentationBench.h.

◆ timeSafetyPass()

TimingStat o2::cad::bench::timeSafetyPass ( const TGeoShape *  shape,
const QuerySamples s,
int  warmup,
int  passes 
)
inline

Safety is asked with the FIXED label from the reference partition, not with each shape's own Contains(). Two reasons, and the second is the one that matters: Safety(p, in) takes different branches for in/out on every implementation here, so a shape that disagreed about a point would be timed on a different branch; and asking each shape's own Contains() first would price two kernels and call it one.

Definition at line 362 of file RepresentationBench.h.