Project
Loading...
Searching...
No Matches
o2::cad::O2BVHAssembly Class Reference

#include <O2BVHAssembly.h>

Inherits TGeoShapeAssembly.

Public Member Functions

 O2BVHAssembly ()
 
 O2BVHAssembly (TGeoVolumeAssembly *volume)
 Build over the daughters volume has now; later daughters trigger a lazy rebuild.
 
 ~O2BVHAssembly () override
 
 O2BVHAssembly (const O2BVHAssembly &)=delete
 
O2BVHAssemblyoperator= (const O2BVHAssembly &)=delete
 
void BuildBVH ()
 (Re)build the acceleration structure from the volume's current daughter list.
 
int GetNbuilt () const
 Number of daughter placements the current BVH covers, -1 if it was never built.
 
size_t GetBVHMemory () const
 Bytes held by the BVH nodes and the primitive-index permutation.
 
Bool_t Contains (const Double_t *point) const override
 Contains.
 
Double_t DistFromOutside (const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
 DistFromOutside – daughters are queried with the fixed query bound, so the answer is visit-order independent.
 
Double_t Safety (const Double_t *point, Bool_t in=kTRUE) const override
 Safety – from inside as ROOT; from outside a nearest-daughter descent of the BVH.
 
Bool_t Contains_Loop (const Double_t *point) const
 
Double_t DistFromOutside_Loop (const Double_t *point, const Double_t *dir, Double_t step=TGeoShape::Big()) const
 
Double_t Safety_Loop (const Double_t *point, Bool_t in=kTRUE) const
 

Static Public Member Functions

static O2BVHAssemblyMakeBVHAssembly (TGeoVolumeAssembly *volume)
 Replace volume's shape by an O2BVHAssembly and return it.
 

Detailed Description

A BVH-accelerated drop-in for ROOT's TGeoShapeAssembly: a BVH over the daughter boxes answers Contains, DistFromOutside and Safety. Install it with MakeBVHAssembly(volume) after TGeoManager::CloseGeometry(), or construct it on the volume and call SetShape. Each query has a _Loop twin over all daughters in index order; the lowest-indexed daughter wins ties, as in ROOT. Unlike ROOT, DistFromOutside also answers from outside the bounding box of a voxelized assembly.

Definition at line 30 of file O2BVHAssembly.h.

Constructor & Destructor Documentation

◆ O2BVHAssembly() [1/3]

O2BVHAssembly::O2BVHAssembly ( )

Definition at line 113 of file O2BVHAssembly.cxx.

◆ O2BVHAssembly() [2/3]

O2BVHAssembly::O2BVHAssembly ( TGeoVolumeAssembly *  volume)
explicit

Build over the daughters volume has now; later daughters trigger a lazy rebuild.

Definition at line 115 of file O2BVHAssembly.cxx.

◆ ~O2BVHAssembly()

O2BVHAssembly::~O2BVHAssembly ( )
override

Definition at line 122 of file O2BVHAssembly.cxx.

◆ O2BVHAssembly() [3/3]

o2::cad::O2BVHAssembly::O2BVHAssembly ( const O2BVHAssembly )
delete

Member Function Documentation

◆ BuildBVH()

void O2BVHAssembly::BuildBVH ( )

(Re)build the acceleration structure from the volume's current daughter list.

BuildBVH – one primitive per daughter: its box in the assembly frame, widened and rounded outward in float.

Definition at line 140 of file O2BVHAssembly.cxx.

◆ Contains()

Bool_t O2BVHAssembly::Contains ( const Double_t *  point) const
override

Contains.

Definition at line 227 of file O2BVHAssembly.cxx.

◆ Contains_Loop()

Bool_t O2BVHAssembly::Contains_Loop ( const Double_t *  point) const

Definition at line 286 of file O2BVHAssembly.cxx.

◆ DistFromOutside()

Double_t O2BVHAssembly::DistFromOutside ( const Double_t *  point,
const Double_t *  dir,
Int_t  iact = 1,
Double_t  step = TGeoShape::Big(),
Double_t *  safe = nullptr 
) const
override

DistFromOutside – daughters are queried with the fixed query bound, so the answer is visit-order independent.

Definition at line 311 of file O2BVHAssembly.cxx.

◆ DistFromOutside_Loop()

Double_t O2BVHAssembly::DistFromOutside_Loop ( const Double_t *  point,
const Double_t *  dir,
Double_t  step = TGeoShape::Big() 
) const

Definition at line 373 of file O2BVHAssembly.cxx.

◆ GetBVHMemory()

size_t O2BVHAssembly::GetBVHMemory ( ) const

Bytes held by the BVH nodes and the primitive-index permutation.

Definition at line 128 of file O2BVHAssembly.cxx.

◆ GetNbuilt()

int o2::cad::O2BVHAssembly::GetNbuilt ( ) const
inline

Number of daughter placements the current BVH covers, -1 if it was never built.

Definition at line 44 of file O2BVHAssembly.h.

◆ MakeBVHAssembly()

O2BVHAssembly * O2BVHAssembly::MakeBVHAssembly ( TGeoVolumeAssembly *  volume)
static

Replace volume's shape by an O2BVHAssembly and return it.

MakeBVHAssembly.

Definition at line 481 of file O2BVHAssembly.cxx.

◆ operator=()

O2BVHAssembly & o2::cad::O2BVHAssembly::operator= ( const O2BVHAssembly )
delete

◆ Safety()

Double_t O2BVHAssembly::Safety ( const Double_t *  point,
Bool_t  in = kTRUE 
) const
override

Safety – from inside as ROOT; from outside a nearest-daughter descent of the BVH.

Definition at line 403 of file O2BVHAssembly.cxx.

◆ Safety_Loop()

Double_t O2BVHAssembly::Safety_Loop ( const Double_t *  point,
Bool_t  in = kTRUE 
) const

Definition at line 461 of file O2BVHAssembly.cxx.


The documentation for this class was generated from the following files: