HerdSoftware  0.4.0
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Herd::CaloGeoParams Class Reference

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 PointPosition (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 IndexesCooIndexes (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 EllipsoidalEnvelopeSphericalCaloEnvelope () const
 Set the cube indexes. More...
 
std::string FillerMaterial () const
 Return the filler material name. More...
 
const PrismaticEnvelopePrismaticCaloEnvelope () 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
 

Detailed Description

Data structure for the Calo geometry parameters.

Member Typedef Documentation

◆ Indexes

using Herd::CaloGeoParams::Indexes = CooArray<unsigned char>

Constructor & Destructor Documentation

◆ CaloGeoParams()

Herd::CaloGeoParams::CaloGeoParams ( )

Default constructor

◆ ~CaloGeoParams()

virtual Herd::CaloGeoParams::~CaloGeoParams ( )
virtualdefault

Virtual destructor

Member Function Documentation

◆ CooIndexes()

const Indexes& Herd::CaloGeoParams::CooIndexes ( unsigned int  volID) const
inline

Return the cube indexes.

Parameters
volIDVolume identifier.
Returns
the indexes of the cube.

◆ CooIndexesRange()

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).

Parameters
axisThe axis along which the crystals are aligned
index1The CooIndex in the abscissa of the view ortoghonal to the specified axis
index2The CooIndex in the ordinate of the view ortoghonal to the specified axis
Returns
The CooIndex range for the selected row

◆ CubeIntersections()

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.

Parameters
trackThe line.
volIDThe cube ID.
sort_by_cooif specified, determines the order in which points are stored in the output based on increasing coordinate
Returns
Optional: a pair of valid points if the line intersects the cube

◆ CubeSize()

const float& Herd::CaloGeoParams::CubeSize ( ) const
inline

Return the cube size, i.e the side length [cm].

Returns
the cube size [cm].

◆ CubeSlotSize()

const float& Herd::CaloGeoParams::CubeSlotSize ( ) const
inline

Return the size of the tray slot accommodating a single LYSO cube [cm].

Returns
the slot size [cm].

◆ FillCooId2VolIDMatrix()

void Herd::CaloGeoParams::FillCooId2VolIDMatrix ( )
private

Fill the private lookup table which converts indexes into volume ID.

◆ FillerMaterial()

std::string Herd::CaloGeoParams::FillerMaterial ( ) const
inline

Return the filler material name.

Returns
the filler material name.

◆ Gaps()

const AxesArray<float>& Herd::CaloGeoParams::Gaps ( ) const
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.

Returns
The gaps size along each axis (cm).

◆ IsEmpty()

bool Herd::CaloGeoParams::IsEmpty ( unsigned int  volID) const
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.

Parameters
volIDVolume identifier.
Returns
true if the cube is masked/empty, false otherwise.

◆ LPDPosition()

const Point Herd::CaloGeoParams::LPDPosition ( unsigned int  volID) const
inline

Return the position of the center of the LPD.

Parameters
volIDVolume identifier.
Returns
the position of the center of the LPD.

◆ LPDSize()

const AxesArray<float> Herd::CaloGeoParams::LPDSize ( ) const
inline

Return the LPD size, i.e the side length [cm].

Returns
the LPD size [cm].

◆ LYSODensity()

float Herd::CaloGeoParams::LYSODensity ( ) const
inline

Return the LYSO density (g/cm3).

Returns
the LYSO density (g/cm3).

◆ LYSONuclearInteractionLength()

float Herd::CaloGeoParams::LYSONuclearInteractionLength ( ) const
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.

Returns
the nuclear interaction length of the LYSO.

◆ LYSORadiationLength()

float Herd::CaloGeoParams::LYSORadiationLength ( ) const
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.

Returns
the radiation length of the LYSO.

◆ NCubes()

unsigned int Herd::CaloGeoParams::NCubes ( ) const
inline

Return the total number of cubes.

Returns
the total number of cubes

◆ Position()

const Point& Herd::CaloGeoParams::Position ( unsigned int  volID) const
inline

Return the position of the center of the cube.

Parameters
volIDVolume identifier.
Returns
the position of the center of the cube.

◆ PrismaticCaloEnvelope()

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.

Returns
A PrismaticEnvelope with the parameters of the CALO envelope.
Exceptions
Herd::Exceptionif the CALO is not standard.

◆ SetCubes()

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.

Parameters
positionsThe positions of the cubes (cm).
indexesThe indexes of the cubes.
cubeSizeThe size of the cube (cm).
cubeSlotSizeThe size of the cube slot (cm).
maskThe cubes mask (true: masked, false: not masked).
Exceptions
Herd::Exceptionif 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.

◆ SetFillerMaterial()

void Herd::CaloGeoParams::SetFillerMaterial ( std::string  fillerMaterial)
inline

Set the filler material name.

◆ SetLPDSize()

void Herd::CaloGeoParams::SetLPDSize ( Herd::AxesArray< float >  lpdSize)
inline

Set the SPD size, i.e the side length [cm].

Parameters
lpdSizethe LPD size [cm].

◆ SetLYSODensity()

void Herd::CaloGeoParams::SetLYSODensity ( float  density)
inline

Set the LYSO density.

Parameters
densitythe LYSO density (g/cm3).

◆ SetPDs()

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.

Parameters
lpdOffsetThe position offset of the large photodiode w.r.t. the center of the cube (cm).
spdOffsetThe position offset of the small photodiode w.r.t. the center of the cube (cm).
lpdSizeThe size of LPD along the three axes (cm).
spdSizeThe size of SPD along the three axes (cm).
Exceptions
Herd::Exceptionif SetCubes has not been already called.

◆ SetSPDSize()

void Herd::CaloGeoParams::SetSPDSize ( Herd::AxesArray< float >  spdSize)
inline

Set the SPD size, i.e the side length [cm].

Parameters
spdSizethe SPD size [cm].

◆ SetSphericalRadius()

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.

Parameters
radiusThe spherical CALO radius.

◆ SPDPosition()

const Point Herd::CaloGeoParams::SPDPosition ( unsigned int  volID) const
inline

Return the position of the center of the SPD.

Parameters
volIDVolume identifier.
Returns
the position of the center of the SPD.

◆ SPDSize()

const AxesArray<float> Herd::CaloGeoParams::SPDSize ( ) const
inline

Return the SPD size, i.e the side length [cm].

Returns
the SPD size [cm].

◆ SphericalCaloEnvelope()

const CaloGeoParams::EllipsoidalEnvelope & Herd::CaloGeoParams::SphericalCaloEnvelope ( ) const

Set the cube indexes.

This method can be called only for spherical CALO geometries.

Returns
An EllipsoidalEnvelope with the parameters of the CALO envelope.
Exceptions
Herd::Exceptionif the CALO is not spherical.
See also
SetSphericalRadius

◆ SphericalRadius()

float Herd::CaloGeoParams::SphericalRadius ( ) const
inline

Gets the radius of the spherical CALO.

Returns
radius The spherical CALO radius in cube ID units, or defaultValue<float> if the CALO is not spherical.

◆ VolumeID() [1/2]

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.

Parameters
cooIndexindexes of this crystal
Returns
Optional: unsigned int volume ID of this crystal if indexes point to a valid cube.

◆ VolumeID() [2/2]

std::optional< unsigned int > Herd::CaloGeoParams::VolumeID ( const Point point) const

Returns the ID of the cube containing the given point.

Parameters
pointThe point.
Returns
Optional: unsigned int The volume ID of the cube containing the given point, if there is one..

◆ Wells()

const AxesArray<float>& Herd::CaloGeoParams::Wells ( ) const
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).

Returns
The well size along each axis (cm).

Member Data Documentation

◆ _cooId2VolIDMatrix

std::vector<std::vector<std::vector<unsigned short> > > Herd::CaloGeoParams::_cooId2VolIDMatrix
private

! Matrix which contains the cooIndexes -> volumeID conversion

◆ _cubeSize

float Herd::CaloGeoParams::_cubeSize
private

The size of the cube, i.e. the side length (cm).

◆ _cubeSlotSize

float Herd::CaloGeoParams::_cubeSlotSize
private

The size of the cube slot (cm).

◆ _ellipsoidalEnvelopeParams

EllipsoidalEnvelope Herd::CaloGeoParams::_ellipsoidalEnvelopeParams
mutableprivate

Parameters of the ellipsoidal envelope of the spherical CALO.

◆ _fillerMaterial

std::string Herd::CaloGeoParams::_fillerMaterial
private

◆ _gaps

AxesArray<float> Herd::CaloGeoParams::_gaps
private

The gaps between the cubes (cm).

◆ _indexes

std::vector<Indexes> Herd::CaloGeoParams::_indexes
private

The indexes of each cube.

◆ _lpdOffset

Vec3D Herd::CaloGeoParams::_lpdOffset
private

The relative position of the LPD on each cube.

◆ _lpdSize

AxesArray<float> Herd::CaloGeoParams::_lpdSize
private

The size of the LPD (cm).

◆ _lysoDensity

float Herd::CaloGeoParams::_lysoDensity
private

The density the cube (g/cm3).

◆ _mask

std::vector<bool> Herd::CaloGeoParams::_mask
private

The mask flag of each cube.

◆ _nMaxCubesPerSide

unsigned int Herd::CaloGeoParams::_nMaxCubesPerSide
private

! Maximum number of cubes along each direction.

◆ _positions

std::vector<Point> Herd::CaloGeoParams::_positions
private

The positions of each cube.

◆ _prismaticEnvelopeParams

PrismaticEnvelope Herd::CaloGeoParams::_prismaticEnvelopeParams
mutableprivate

Parameters of the prismatic envelope of the standard CALO.

◆ _spdOffset

Vec3D Herd::CaloGeoParams::_spdOffset
private

The relative position of the SPD on each cube.

◆ _spdSize

AxesArray<float> Herd::CaloGeoParams::_spdSize
private

The size of the SPD (cm).

◆ _sphericalRadius

float Herd::CaloGeoParams::_sphericalRadius
private

The radius of the spherical CALO expressed in cube ID units.

◆ _wells

AxesArray<float> Herd::CaloGeoParams::_wells
private

The sizes of the wells (cm).


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