HerdSoftware
0.4.0
|
Data structure for the Calo geometry parameters. More...
#include <dataobjects/CaloGeoParams.h>
Classes | |
struct | CooIndexRange |
Helper struct to hold a CooIndex range. More... | |
struct | EllipsoidalEnvelope |
Parameters of the ellipsoidal CALO envelope. More... | |
class | PrismaticEnvelope |
Parameters of the prismatic CALO envelope. More... | |
Public Types | |
using | Indexes = CooArray< unsigned char > |
Public Member Functions | |
CaloGeoParams () | |
Default constructor More... | |
virtual | ~CaloGeoParams ()=default |
Virtual destructor More... | |
const Point & | Position (unsigned int volID) const |
Return the position of the center of the cube. More... | |
const Point | LPDPosition (unsigned int volID) const |
Return the position of the center of the LPD. More... | |
const Point | SPDPosition (unsigned int volID) const |
Return the position of the center of the SPD. More... | |
const Indexes & | CooIndexes (unsigned int volID) const |
Return the cube indexes. More... | |
CooIndexRange | CooIndexesRange (RefFrame::Axis axis, unsigned char index1, unsigned char index2) |
Return the CooIndex range for a given row of crystals. More... | |
bool | IsEmpty (unsigned int volID) const |
Return true if the cube is masked. More... | |
const float & | CubeSize () const |
Return the cube size, i.e the side length [cm]. More... | |
const AxesArray< float > | LPDSize () const |
Return the LPD size, i.e the side length [cm]. More... | |
const AxesArray< float > | SPDSize () const |
Return the SPD size, i.e the side length [cm]. More... | |
float | LYSODensity () const |
Return the LYSO density (g/cm3). More... | |
float | LYSORadiationLength () const |
Return the radiation length of the LYSO material constituting the cube (cm). More... | |
float | LYSONuclearInteractionLength () const |
Return the nuclear interaction length of the LYSO material constituting the cube (cm). More... | |
const float & | CubeSlotSize () const |
Return the size of the tray slot accommodating a single LYSO cube [cm]. More... | |
unsigned int | NCubes () const |
Return the total number of cubes. More... | |
std::optional< unsigned int > | VolumeID (const Indexes &cooIndex) const |
Return the volume ID starting from the indexes. More... | |
std::optional< unsigned int > | VolumeID (const Point &point) const |
Returns the ID of the cube containing the given point. More... | |
std::optional< std::pair< Point, Point > > | CubeIntersections (const Line &track, const unsigned int volID, const Herd::RefFrame::Coo sort_by_coo=Herd::RefFrame::Coo::NONE) const |
Return the two intersection points between a line and a given cube. More... | |
float | SphericalRadius () const |
Gets the radius of the spherical CALO. More... | |
const EllipsoidalEnvelope & | SphericalCaloEnvelope () const |
Set the cube indexes. More... | |
std::string | FillerMaterial () const |
Return the filler material name. More... | |
const PrismaticEnvelope & | PrismaticCaloEnvelope () const |
Returns the parameters of the prismatic envelope of the standard CALO. More... | |
const AxesArray< float > & | Gaps () const |
Gets the gaps sizes. More... | |
const AxesArray< float > & | Wells () const |
Gets the wells sizes. More... | |
void | SetCubes (std::vector< Point > positions, std::vector< Indexes > indexes, float cubeSize, float cubeSlotSize=defaultValue< float >, std::vector< bool > mask={}) |
Set the cubes. More... | |
void | SetPDs (Vec3D lpdOffset, Vec3D spdOffset, Herd::AxesArray< float > lpdSize, Herd::AxesArray< float > spdSize) |
Set the photodiodes. More... | |
void | SetLYSODensity (float density) |
Set the LYSO density. More... | |
void | SetSphericalRadius (float radius) |
Sets the radius of the spherical CALO. More... | |
void | SetLPDSize (Herd::AxesArray< float > lpdSize) |
Set the SPD size, i.e the side length [cm]. More... | |
void | SetSPDSize (Herd::AxesArray< float > spdSize) |
Set the SPD size, i.e the side length [cm]. More... | |
void | SetFillerMaterial (std::string fillerMaterial) |
Set the filler material name. More... | |
Private Member Functions | |
void | FillCooId2VolIDMatrix () |
Fill the private lookup table which converts indexes into volume ID. More... | |
Private Attributes | |
std::vector< Point > | _positions |
The positions of each cube. More... | |
std::vector< Indexes > | _indexes |
The indexes of each cube. More... | |
std::vector< bool > | _mask |
The mask flag of each cube. More... | |
Vec3D | _lpdOffset |
The relative position of the LPD on each cube. More... | |
Vec3D | _spdOffset |
The relative position of the SPD on each cube. More... | |
float | _cubeSize |
The size of the cube, i.e. the side length (cm). More... | |
float | _cubeSlotSize |
The size of the cube slot (cm). More... | |
float | _lysoDensity |
The density the cube (g/cm3). More... | |
AxesArray< float > | _gaps |
The gaps between the cubes (cm). More... | |
AxesArray< float > | _wells |
The sizes of the wells (cm). More... | |
float | _sphericalRadius |
The radius of the spherical CALO expressed in cube ID units. More... | |
EllipsoidalEnvelope | _ellipsoidalEnvelopeParams |
Parameters of the ellipsoidal envelope of the spherical CALO. More... | |
PrismaticEnvelope | _prismaticEnvelopeParams |
Parameters of the prismatic envelope of the standard CALO. More... | |
AxesArray< float > | _lpdSize |
The size of the LPD (cm). More... | |
AxesArray< float > | _spdSize |
The size of the SPD (cm). More... | |
std::vector< std::vector< std::vector< unsigned short > > > | _cooId2VolIDMatrix |
! Matrix which contains the cooIndexes -> volumeID conversion More... | |
unsigned int | _nMaxCubesPerSide |
! Maximum number of cubes along each direction. More... | |
std::string | _fillerMaterial |
Data structure for the Calo geometry parameters.
using Herd::CaloGeoParams::Indexes = CooArray<unsigned char> |
Herd::CaloGeoParams::CaloGeoParams | ( | ) |
Default constructor
|
virtualdefault |
Virtual destructor
|
inline |
Return the cube indexes.
volID | Volume identifier. |
CaloGeoParams::CooIndexRange Herd::CaloGeoParams::CooIndexesRange | ( | RefFrame::Axis | axis, |
unsigned char | index1, | ||
unsigned char | index2 | ||
) |
Return the CooIndex range for a given row of crystals.
This method computes the IDs of the first and last cubes in a given row. The row direction is specified by an axis, which identifies an orthogonal view: in this view the coordinates of a cube are given, and this routine identifies the first and last cubes along the axis on the row identified by the given coordinates. For example:
CooIndexRange(RefFrame::Axis::X, 5, 2)
will return the first and last cubes on the cube row along X identified by the cube with ID_Y=5 and ID_Z=2 on YZ (since the view orthogonal to X is YZ, with Y abscissa and Z ordinate).
axis | The axis along which the crystals are aligned |
index1 | The CooIndex in the abscissa of the view ortoghonal to the specified axis |
index2 | The CooIndex in the ordinate of the view ortoghonal to the specified axis |
std::optional< std::pair< Point, Point > > Herd::CaloGeoParams::CubeIntersections | ( | const Line & | track, |
const unsigned int | volID, | ||
const Herd::RefFrame::Coo | sort_by_coo = Herd::RefFrame::Coo::NONE |
||
) | const |
Return the two intersection points between a line and a given cube.
track | The line. |
volID | The cube ID. |
sort_by_coo | if specified, determines the order in which points are stored in the output based on increasing coordinate |
|
inline |
Return the cube size, i.e the side length [cm].
|
inline |
Return the size of the tray slot accommodating a single LYSO cube [cm].
|
private |
Fill the private lookup table which converts indexes into volume ID.
|
inline |
Return the filler material name.
|
inline |
Gets the gaps sizes.
This method returns the gaps between each cube slot. These corresponds to the thickness of the tray wall along the axes parallel to the tray.
|
inline |
Return true if the cube is masked.
A masked cube is a cube that is present in the original geometry but has been removed from the actual CALO.
volID | Volume identifier. |
|
inline |
Return the position of the center of the LPD.
volID | Volume identifier. |
|
inline |
Return the LPD size, i.e the side length [cm].
|
inline |
Return the LYSO density (g/cm3).
|
inline |
Return the nuclear interaction length of the LYSO material constituting the cube (cm).
The returned radiation length is computed by scaling 20.589 cm, i.e. the n. i. length of a LYSO cube of density 7.4 g/cm3 as given by Geant4, by the ratio of the reference 7.4 g/cm3 density and the the actual LYSO density.
|
inline |
Return the radiation length of the LYSO material constituting the cube (cm).
The returned radiation length is computed by scaling 1.172 cm, i.e. the radiation length of a LYSO cube of density 7.4 g/cm3 as given by Geant4, by the ratio of the reference 7.4 g/cm3 density and the the actual LYSO density.
|
inline |
Return the total number of cubes.
|
inline |
Return the position of the center of the cube.
volID | Volume identifier. |
const CaloGeoParams::PrismaticEnvelope & Herd::CaloGeoParams::PrismaticCaloEnvelope | ( | ) | const |
Returns the parameters of the prismatic envelope of the standard CALO.
This method can be called only for standard CALO geometries.
Herd::Exception | if the CALO is not standard. |
void Herd::CaloGeoParams::SetCubes | ( | std::vector< Point > | positions, |
std::vector< Indexes > | indexes, | ||
float | cubeSize, | ||
float | cubeSlotSize = defaultValue<float> , |
||
std::vector< bool > | mask = {} |
||
) |
Set the cubes.
This method sets the positions, indexes and size of each cube; optionally also the slot size and the cubes mask can be specified. The element ID in the vector arguments corresponds to the cube ID. The positions and indexes vectors must have the same number of elements, corresponding to the total number of cubes. The mask vector can be either empty (in this case no mask is applied) or have the same number of elements as the other arguments. The slot size must be greater or equal to the cube size; if the default value is used then it is automatically set equal to the cube size.
This method also computes the sizes of the gaps between the cube slots and of the wells, by computing the distance between two consecutive cubes along the axes for which the indexes differ by 1 (this defines two neighboring cubes along that axis). No more than two values (i.e. for gap and for well) for each axis are expected; if more than one is found then an exception is thrown. If two values are found then the smallest one is assigned to the gap and the other one to the well. If just one value is found it is assigned to both gap and well; if no value is found (e.g. for the transverse axis of a single-layer CALO) then 0 is assigned to both gap and well.
Calling this function resets the CALO type and the PDs, so SetPDs and eventually also SetSphericalRadius if the geometry is spherical must be called after this method.
positions | The positions of the cubes (cm). |
indexes | The indexes of the cubes. |
cubeSize | The size of the cube (cm). |
cubeSlotSize | The size of the cube slot (cm). |
mask | The cubes mask (true: masked, false: not masked). |
Herd::Exception | if the sizes of the argument vectors do not exactly match (but mask size can be zero), if the cube size is less or equal than 0 or if the slot size is less than the cube size, or if more than two values of cube-to-cube distance are found along an axis. |
|
inline |
Set the filler material name.
|
inline |
Set the SPD size, i.e the side length [cm].
lpdSize | the LPD size [cm]. |
|
inline |
Set the LYSO density.
density | the LYSO density (g/cm3). |
void Herd::CaloGeoParams::SetPDs | ( | Vec3D | lpdOffset, |
Vec3D | spdOffset, | ||
Herd::AxesArray< float > | lpdSize, | ||
Herd::AxesArray< float > | spdSize | ||
) |
Set the photodiodes.
This method sets the relative position of the photodiodes w.r.t. the center of the cube they are placed on and the size of the two photodiodes along the three axes.
This method must be called after SetCubes, otherwise an exception is thrown.
lpdOffset | The position offset of the large photodiode w.r.t. the center of the cube (cm). |
spdOffset | The position offset of the small photodiode w.r.t. the center of the cube (cm). |
lpdSize | The size of LPD along the three axes (cm). |
spdSize | The size of SPD along the three axes (cm). |
Herd::Exception | if SetCubes has not been already called. |
|
inline |
Set the SPD size, i.e the side length [cm].
spdSize | the SPD size [cm]. |
void Herd::CaloGeoParams::SetSphericalRadius | ( | float | radius | ) |
Sets the radius of the spherical CALO.
The radius must be expressed in cube ID units. Calling this function also sets the CALO as effectively spherical.
radius | The spherical CALO radius. |
|
inline |
Return the position of the center of the SPD.
volID | Volume identifier. |
|
inline |
Return the SPD size, i.e the side length [cm].
const CaloGeoParams::EllipsoidalEnvelope & Herd::CaloGeoParams::SphericalCaloEnvelope | ( | ) | const |
Set the cube indexes.
This method can be called only for spherical CALO geometries.
Herd::Exception | if the CALO is not spherical. |
|
inline |
Gets the radius of the spherical CALO.
std::optional< unsigned int > Herd::CaloGeoParams::VolumeID | ( | const Indexes & | cooIndex | ) | const |
Return the volume ID starting from the indexes.
This method use a private lookup table which stores the conversion between each combination of indexes and volume IDs. This table is filled after the first request by this method. If one index is >=21 an runtime_error exception is thrown. If the indexes are < 21 but not related with a true crystals, (e.g. (20,20,20)) std::numeric_limits<unsigned int>::max() is returned.
cooIndex | indexes of this crystal |
std::optional< unsigned int > Herd::CaloGeoParams::VolumeID | ( | const Point & | point | ) | const |
Returns the ID of the cube containing the given point.
point | The point. |
|
inline |
Gets the wells sizes.
This method returns the sizes of the wells. If no well is present then the well size is equal to the gap size (since the cubes are always at least separated by the gap).
|
private |
! Matrix which contains the cooIndexes -> volumeID conversion
|
private |
The size of the cube, i.e. the side length (cm).
|
private |
The size of the cube slot (cm).
|
mutableprivate |
Parameters of the ellipsoidal envelope of the spherical CALO.
|
private |
|
private |
The gaps between the cubes (cm).
|
private |
The indexes of each cube.
|
private |
The relative position of the LPD on each cube.
|
private |
The size of the LPD (cm).
|
private |
The density the cube (g/cm3).
|
private |
The mask flag of each cube.
|
private |
! Maximum number of cubes along each direction.
|
private |
The positions of each cube.
|
mutableprivate |
Parameters of the prismatic envelope of the standard CALO.
|
private |
The relative position of the SPD on each cube.
|
private |
The size of the SPD (cm).
|
private |
The radius of the spherical CALO expressed in cube ID units.
|
private |
The sizes of the wells (cm).