Singleton class performing the voxelization of the world volume and tracking of a voxel index given the three-dimensional coordinates. More...
#include <Doxymodules_medical.h>
Public Member Functions | |
~VoxelizedSensitiveDetector () | |
Destructor. | |
void | SetVoxelWidth (G4ThreeVector voxWidth) |
Method to set the voxel shape to be a box with given sides. | |
void | SetVoxelWidthX (G4double voxWidthX) |
Method to set the voxel X width. | |
void | SetVoxelWidthY (G4double voxWidthY) |
Method to set the voxel Y width. | |
void | SetVoxelWidthZ (G4double voxWidthZ) |
Method to set the voxel Z width. | |
void | UpdateVoxelizedGeometry () |
Method to update voxelized geometry. | |
void | InitializeWorldPtr (G4VPhysicalVolume *pWorld) |
Method to properly initialize the pointer to the World physical volume. | |
void | Construct () |
Method to construct all the volumes for the voxelization of the geometry. | |
void | ConstructSD () |
Method to make the proper volume sensitive to allow scoring. | |
G4ThreeVector | GetVoxelWidth () const |
Method to get the three vector containing the dimensions for the voxel. | |
G4double | GetVoxelWidthX () const |
Method to get X width of the voxel. | |
G4double | GetVoxelWidthY () const |
Method to get Y width of the voxel. | |
G4double | GetVoxelWidthZ () const |
Method to get Z width of the voxel. | |
G4double | GetVoxelVolume () const |
Method to get total voxel volume. | |
G4double | GetVoxelNumberAlongX () const |
Method to get the voxel number along X axis. | |
G4double | GetVoxelNumberAlongY () const |
Method to get the voxel number along Y axis. | |
G4double | GetVoxelNumberAlongZ () const |
Method to get the voxel number along Z axis. | |
G4int | GetTotalVoxelNumber () const |
Method to get the total voxel number. | |
G4double | GetVoxelMass () const |
Method to get the mass of a voxel. | |
G4double | GetVoxelDensity () const |
Method to get the density of a voxel. | |
G4int | GetThisVoxelNumber (G4int x, G4int j, G4int k) const |
Method to get the absolute voxel index given its indexes in the three dimensions. | |
Static Public Member Functions | |
static VoxelizedSensitiveDetector * | GetInstance () |
Static method to retrieve a pointer to the only object existing in the simulation. | |
static VoxelizedSensitiveDetector * | CreateInstance (DetectorConstruction *det, double xWidth, double yWidth, double zWidth) |
Static method to create the pointer to the only object existing in the simulation. | |
Private Member Functions | |
VoxelizedSensitiveDetector (DetectorConstruction *det, double xWidth, double yWidth, double zWidth) | |
Private constructor using a pointer to DetectorConstruction and the three dimensions for one voxel. | |
G4bool | ConstructVoxelizedDetector () |
Private method to construct the voxelized detector. | |
void | UpdateVoxelVolume () |
Private method to calculate the total volume of a voxel given the parameters saved inside the object. | |
void | CalculateVoxelNumber () |
Private method to calculate the total voxel number given the parameters saved inside the object. | |
void | ConstructXDivision () |
Private method to slice the world volume along the X axis. | |
void | ConstructYDivision () |
Private method to further slice the X slices along the Y axis, creating some "columns" of material. | |
void | ConstructZDivision () |
Private method to further slice the Y columns along the Z axis, creating some boxes of material. | |
Static Private Attributes | |
static VoxelizedSensitiveDetector * | fInstance = nullptr |
Singleton class performing the voxelization of the world volume and tracking of a voxel index given the three-dimensional coordinates.
This class is used to voxelize the world volume created in DetectorConstruction class. It works only if the world already exists: the constructor needs a pointer to DetectorConstruction.
This class does not insert a further material, but uses the same material saved in DetectorConstruction class. It is responsible for the voxelization of the space and for the tracking of voxels index.
Internally, the voxel volume, mass and density are updated every time something relevant changes in the geometry
Definition at line 148 of file Doxymodules_medical.h.
|
private |
Private constructor using a pointer to DetectorConstruction and the three dimensions for one voxel.
Definition at line 77 of file VoxelizedSensitiveDetector.cc.
RadioBio::VoxelizedSensitiveDetector::~VoxelizedSensitiveDetector | ( | ) |
Destructor.
Definition at line 88 of file VoxelizedSensitiveDetector.cc.
|
static |
Static method to retrieve a pointer to the only object existing in the simulation.
Definition at line 70 of file VoxelizedSensitiveDetector.cc.
|
static |
Static method to create the pointer to the only object existing in the simulation.
det | A pointer to the DetectorConstruction object |
xWidth | X dimension of a single voxel |
yWidth | Y dimension of a single voxel |
zWidth | Z dimension of a single voxel |
Definition at line 55 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::SetVoxelWidth | ( | G4ThreeVector | voxWidth | ) |
Method to set the voxel shape to be a box with given sides.
voxWidth | ThreeVector containing the three-dimensionals sides for the voxel |
Definition at line 104 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::SetVoxelWidthX | ( | G4double | voxWidthX | ) |
Method to set the voxel X width.
voxWidthX | X width for the voxel |
Definition at line 114 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::SetVoxelWidthY | ( | G4double | voxWidthY | ) |
Method to set the voxel Y width.
voxWidthY | Y width for the voxel |
Definition at line 123 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::SetVoxelWidthZ | ( | G4double | voxWidthZ | ) |
Method to set the voxel Z width.
voxWidthZ | Z width for the voxel |
Definition at line 132 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::UpdateVoxelizedGeometry | ( | ) |
Method to update voxelized geometry.
If voxelized geometry is not built, it returns immediately. Otherwise, geometrical parameters are re-calculated and voxelized geometry is destroyed, de-registered and built once again from scratch.
Definition at line 250 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::InitializeWorldPtr | ( | G4VPhysicalVolume * | pWorld | ) |
Method to properly initialize the pointer to the World physical volume.
It is meant to be called only by DetectorConstruction itself.
pWorld | Pointer to the world physical volume |
Definition at line 307 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::Construct | ( | ) |
Method to construct all the volumes for the voxelization of the geometry.
Definition at line 300 of file VoxelizedSensitiveDetector.cc.
void RadioBio::VoxelizedSensitiveDetector::ConstructSD | ( | ) |
Method to make the proper volume sensitive to allow scoring.
Definition at line 288 of file VoxelizedSensitiveDetector.cc.
|
inline |
Method to get the three vector containing the dimensions for the voxel.
Definition at line 161 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get X width of the voxel.
Definition at line 167 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get Y width of the voxel.
Definition at line 173 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get Z width of the voxel.
Definition at line 179 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get total voxel volume.
Definition at line 185 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the voxel number along X axis.
Definition at line 191 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the voxel number along Y axis.
Definition at line 197 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the voxel number along Z axis.
Definition at line 203 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the total voxel number.
Definition at line 209 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the mass of a voxel.
Definition at line 222 of file VoxelizedSensitiveDetector.hh.
|
inline |
Method to get the density of a voxel.
Definition at line 235 of file VoxelizedSensitiveDetector.hh.
G4int RadioBio::VoxelizedSensitiveDetector::GetThisVoxelNumber | ( | G4int | x, |
G4int | j, | ||
G4int | k | ||
) | const |
Method to get the absolute voxel index given its indexes in the three dimensions.
This helper function is heavily used throughout the simulation and is here because the voxelized detector is meant to know how many voxels there are and how they are ordered.
Definition at line 318 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to construct the voxelized detector.
Definition at line 230 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to calculate the total volume of a voxel given the parameters saved inside the object.
Definition at line 95 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to calculate the total voxel number given the parameters saved inside the object.
Definition at line 143 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to slice the world volume along the X axis.
Definition at line 171 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to further slice the X slices along the Y axis, creating some "columns" of material.
Definition at line 195 of file VoxelizedSensitiveDetector.cc.
|
private |
Private method to further slice the Y columns along the Z axis, creating some boxes of material.
This is the final step for voxelization of space.
Definition at line 211 of file VoxelizedSensitiveDetector.cc.
|
staticprivate |
Definition at line 78 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 259 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 261 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 262 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 263 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 265 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 267 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 268 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 269 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 271 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 272 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 273 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 276 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 277 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 278 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 280 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 281 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 282 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 283 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 285 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 286 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 287 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 290 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 292 of file VoxelizedSensitiveDetector.hh.
|
private |
Definition at line 327 of file VoxelizedSensitiveDetector.hh.