LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Representation of a region of space diced into voxels. More...
#include "PhotonVoxels.h"
Classes | |
struct | NeiInfo |
Public Member Functions | |
PhotonVoxelDef ()=default | |
PhotonVoxelDef (double xMin, double xMax, int xN, double yMin, double yMax, int yN, double zMin, double zMax, int zN) | |
template<typename Point = DefaultPoint> | |
decltype(auto) | GetRegionLowerCorner () const |
Returns the volume vertex (type Point ) with the lowest coordinates. More... | |
template<typename Point = DefaultPoint> | |
decltype(auto) | GetRegionUpperCorner () const |
Returns the volume vertex (type Point ) with the highest coordinates. More... | |
std::array< unsigned int, 3U > | GetSteps () const |
Returns the number of voxels along each of the three dimensions. More... | |
template<typename Vector = DefaultVector> | |
Vector | GetVoxelSize () const |
Returns a vector describing the span of a single voxel in x, y an z [cm]. More... | |
template<typename Vector = DefaultVector, typename Point = DefaultPoint> | |
Vector | GetVolumeSize () const |
Returns a vector describing the full span in x, y an z [cm]. More... | |
unsigned int | GetNVoxels () const |
Returns the total number of voxels in the volume. More... | |
template<typename Point > | |
int | GetVoxelID (Point const &p) const |
Returns the ID of the voxel containing p , or -1 if none. More... | |
int | GetVoxelID (double const *) const |
bool | IsLegalVoxelID (int) const |
template<typename Point > | |
std::optional< std::array< NeiInfo, 8U > > | GetNeighboringVoxelIDs (Point const &v) const |
Returns IDs of the eight neighboring voxels around v . More... | |
PhotonVoxel | GetPhotonVoxel (int ID) const |
std::array< int, 3U > | GetVoxelCoords (int ID) const |
bool | isInside (geo::Point_t const &p) const |
Returns whether point p is inside the region (upper border excluded). More... | |
bool | operator== (const PhotonVoxelDef &rhs) const |
bool | operator!= (const PhotonVoxelDef &rhs) const |
template<typename Point > | |
std::optional< std::array< sim::PhotonVoxelDef::NeiInfo, 8U > > | GetNeighboringVoxelIDs (Point const &v) const |
Private Types | |
using | DefaultPoint = geo::Point_t |
using | DefaultVector = geo::Vector_t |
Private Member Functions | |
int | GetVoxelIDImpl (geo::Point_t const &p) const |
std::optional< std::array< NeiInfo, 8U > > | GetNeighboringVoxelIDsImpl (geo::Point_t const &v) const |
std::array< double, 3U > | GetVoxelStepCoordsUnchecked (geo::Point_t const &p) const |
Returns the coordinates of the cvoxel containing p in step units. More... | |
bool | isInsideImpl (geo::Point_t const &point) const |
Returns whether the specified point is within the volume. More... | |
Static Private Member Functions | |
static bool | isInsideVolume (geo::Point_t const &point, geo::Point_t const &lower, geo::Point_t const &upper) |
static bool | isInsideRange (double value, double lower, double upper) |
Private Attributes | |
geo::Point_t | fLowerCorner |
geo::Point_t | fUpperCorner |
unsigned int | fxSteps = 1U |
unsigned int | fySteps = 1U |
unsigned int | fzSteps = 1U |
Representation of a region of space diced into voxels.
Definition at line 58 of file PhotonVoxels.h.
|
private |
Definition at line 59 of file PhotonVoxels.h.
|
private |
Definition at line 60 of file PhotonVoxels.h.
|
default |
sim::PhotonVoxelDef::PhotonVoxelDef | ( | double | xMin, |
double | xMax, | ||
int | xN, | ||
double | yMin, | ||
double | yMax, | ||
int | yN, | ||
double | zMin, | ||
double | zMax, | ||
int | zN | ||
) |
Definition at line 22 of file PhotonVoxels.cxx.
std::optional<std::array<NeiInfo, 8U> > sim::PhotonVoxelDef::GetNeighboringVoxelIDs | ( | Point const & | v | ) | const |
Returns IDs of the eight neighboring voxels around v
.
v | location within the mapped volume |
If v
is not inside the mapped volume, no list is returned (the optional return value evaluates to false
). Otherwise, each of the eight voxels with the center closest to v
are returned, each with a weight proportional to the distance of v
from that center.
Referenced by phot::PhotonVisibilityService::doGetVisibilityOfOpLib().
std::optional<std::array<sim::PhotonVoxelDef::NeiInfo, 8U> > sim::PhotonVoxelDef::GetNeighboringVoxelIDs | ( | Point const & | v | ) | const |
Definition at line 225 of file PhotonVoxels.h.
References geo::vect::toPoint().
|
private |
Definition at line 68 of file PhotonVoxels.cxx.
References util::abs(), d, e, fxSteps, fySteps, GetSteps(), GetVoxelStepCoordsUnchecked(), isInside(), n, util::to_string(), and w.
unsigned int sim::PhotonVoxelDef::GetNVoxels | ( | ) | const |
Returns the total number of voxels in the volume.
Definition at line 55 of file PhotonVoxels.cxx.
References fxSteps, fySteps, and fzSteps.
Referenced by phot::PhotonLibraryAnalyzer::beginJob(), phot::CreateHybridLibrary::CreateHybridLibrary(), IsLegalVoxelID(), evgen::LightSource::LightSource(), phot::PhotonVisibilityService::LoadLibrary(), phot::PhotonLibraryHybrid::NVoxels(), sim::operator<<(), and phot::PhotonVisibilityService::reconfigure().
PhotonVoxel sim::PhotonVoxelDef::GetPhotonVoxel | ( | int | ID | ) | const |
Definition at line 134 of file PhotonVoxels.cxx.
References fLowerCorner, fxSteps, fySteps, and fzSteps.
Referenced by phot::CreateHybridLibrary::CreateHybridLibrary(), phot::PhotonLibraryHybrid::GetCount(), evgen::LightSource::produce(), and phot::PhotonVisibilityService::reconfigure().
decltype(auto) sim::PhotonVoxelDef::GetRegionLowerCorner | ( | ) | const |
Returns the volume vertex (type Point
) with the lowest coordinates.
Referenced by phot::PhotonLibraryAnalyzer::beginJob(), sim::PhotonVoxel::GetCenter(), sim::operator<<(), operator==(), and phot::PhotonLibrary::StoreMetadata().
decltype(auto) sim::PhotonVoxelDef::GetRegionUpperCorner | ( | ) | const |
Returns the volume vertex (type Point
) with the highest coordinates.
Referenced by phot::PhotonLibraryAnalyzer::beginJob(), sim::PhotonVoxel::GetCenter(), sim::operator<<(), operator==(), and phot::PhotonLibrary::StoreMetadata().
std::array< unsigned int, 3U > sim::PhotonVoxelDef::GetSteps | ( | ) | const |
Returns the number of voxels along each of the three dimensions.
Definition at line 39 of file PhotonVoxels.cxx.
References fxSteps, fySteps, and fzSteps.
Referenced by phot::PhotonLibraryAnalyzer::beginJob(), GetNeighboringVoxelIDsImpl(), sim::operator<<(), operator==(), and phot::PhotonLibrary::StoreMetadata().
|
inline |
Returns a vector describing the full span in x, y an z [cm].
Definition at line 97 of file PhotonVoxels.h.
Referenced by sim::operator<<().
std::array< int, 3U > sim::PhotonVoxelDef::GetVoxelCoords | ( | int | ID | ) | const |
Definition at line 161 of file PhotonVoxels.cxx.
References fxSteps, fySteps, and fzSteps.
Referenced by phot::PhotonLibraryAnalyzer::beginJob().
int sim::PhotonVoxelDef::GetVoxelID | ( | Point const & | p | ) | const |
Returns the ID of the voxel containing p
, or -1
if none.
Definition at line 217 of file PhotonVoxels.h.
References geo::vect::toPoint().
Referenced by phot::PhotonVisibilityService::VoxelAt().
int sim::PhotonVoxelDef::GetVoxelID | ( | double const * | Position | ) | const |
Definition at line 61 of file PhotonVoxels.cxx.
References GetVoxelIDImpl().
|
private |
Definition at line 186 of file PhotonVoxels.cxx.
References fxSteps, fySteps, GetVoxelStepCoordsUnchecked(), and isInside().
Referenced by GetVoxelID().
Vector sim::PhotonVoxelDef::GetVoxelSize | ( | ) | const |
Returns a vector describing the span of a single voxel in x, y an z [cm].
Definition at line 208 of file PhotonVoxels.h.
Referenced by evgen::LightSource::LightSource(), sim::operator<<(), and phot::PhotonLibrary::StoreMetadata().
|
private |
Returns the coordinates of the cvoxel containing p
in step units.
Definition at line 172 of file PhotonVoxels.cxx.
References fLowerCorner, fUpperCorner, fxSteps, fySteps, fzSteps, and util::span().
Referenced by GetNeighboringVoxelIDsImpl(), and GetVoxelIDImpl().
|
inline |
Returns whether point p
is inside the region (upper border excluded).
Definition at line 137 of file PhotonVoxels.h.
References util::details::operator==().
Referenced by GetNeighboringVoxelIDsImpl(), and GetVoxelIDImpl().
|
inlineprivate |
Returns whether the specified point is within the volume.
Definition at line 151 of file PhotonVoxels.h.
References sim::PhotonVoxel::fVoxelMax, sim::PhotonVoxel::fVoxelMin, sim::PhotonVoxel::GetLowerCorner(), sim::PhotonVoxel::GetUpperCorner(), sim::operator<<(), and value.
|
staticprivate |
|
staticprivate |
Definition at line 203 of file PhotonVoxels.cxx.
References isInsideRange().
bool sim::PhotonVoxelDef::IsLegalVoxelID | ( | int | ID | ) | const |
Definition at line 156 of file PhotonVoxels.cxx.
References GetNVoxels().
|
inline |
Definition at line 140 of file PhotonVoxels.h.
bool sim::PhotonVoxelDef::operator== | ( | const PhotonVoxelDef & | rhs | ) | const |
Definition at line 47 of file PhotonVoxels.cxx.
References GetRegionLowerCorner(), GetRegionUpperCorner(), and GetSteps().
|
private |
Definition at line 62 of file PhotonVoxels.h.
Referenced by GetPhotonVoxel(), and GetVoxelStepCoordsUnchecked().
|
private |
Definition at line 63 of file PhotonVoxels.h.
Referenced by GetVoxelStepCoordsUnchecked().
|
private |
Definition at line 64 of file PhotonVoxels.h.
Referenced by GetNeighboringVoxelIDsImpl(), GetNVoxels(), GetPhotonVoxel(), GetSteps(), GetVoxelCoords(), GetVoxelIDImpl(), and GetVoxelStepCoordsUnchecked().
|
private |
Definition at line 65 of file PhotonVoxels.h.
Referenced by GetNeighboringVoxelIDsImpl(), GetNVoxels(), GetPhotonVoxel(), GetSteps(), GetVoxelCoords(), GetVoxelIDImpl(), and GetVoxelStepCoordsUnchecked().
|
private |
Definition at line 66 of file PhotonVoxels.h.
Referenced by GetNVoxels(), GetPhotonVoxel(), GetSteps(), GetVoxelCoords(), and GetVoxelStepCoordsUnchecked().