HerdSoftware  0.1.1
Classes | 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  CaloCube
 This struct is used only inside the object, it is public since Root can not save the object otherwise. More...
 

Public Member Functions

 CaloGeoParams (unsigned int nCubes)
 Constructor. More...
 
 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 CooArray< unsigned char > & CooIndexes (unsigned int volID) const
 Return the cube indexes. More...
 
bool IsEmpty (unsigned int volID) const
 Return true if the cube is empty. More...
 
const float & CubeSize () const
 Return the cube 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...
 
unsigned int VolumeID (const CooArray< unsigned char > &cooIndex)
 Return the volume ID starting from the indexes. More...
 
unsigned int VolumeID (const Point &position)
 Return the volume ID given a position. More...
 
std::pair< Point, PointGetCubeIntersections (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...
 
void SetNCubes (unsigned int nCubes)
 Set the number of cubes. More...
 
void SetPosition (unsigned int volID, Point position)
 Set the position of the center of the cube. More...
 
void SetCooIndexes (unsigned int volID, CooArray< unsigned char > indexes)
 Set the cube indexes. More...
 
void SetIsEmpty (unsigned int volID, bool isEmpty)
 Set the flag which indicates if the cube is empty. More...
 
void SetCubeSize (float cubeSize)
 Set the cube size, i.e the side length [cm]. More...
 
void SetCubeSlotSize (float cubeSlotSize)
 Set the cube slot size [cm]. More...
 
void SetLYSODensity (float density)
 Set the LYSO density. More...
 

Private Member Functions

void FillCooId2VolIDMatrix ()
 Fill the private lookup table which converts indexes into volume ID. More...
 

Private Attributes

std::vector< CaloCube_caloCubes
 Vector of CaloCube, which contains the cube position and indexes. 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...
 
std::vector< std::vector< std::vector< unsigned short > > > _cooId2VolIDMatrix
 

Detailed Description

Data structure for the Calo geometry parameters.

Constructor & Destructor Documentation

◆ CaloGeoParams() [1/2]

Herd::CaloGeoParams::CaloGeoParams ( unsigned int  nCubes)
inline

Constructor.

Parameters
nCubesNumber of cubes

◆ CaloGeoParams() [2/2]

Herd::CaloGeoParams::CaloGeoParams ( )
inline

Default constructor.

◆ ~CaloGeoParams()

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

Virtual destructor.

Member Function Documentation

◆ CooIndexes()

const CooArray<unsigned char>& Herd::CaloGeoParams::CooIndexes ( unsigned int  volID) const
inline

Return the cube indexes.

Parameters
volIDVolume identifier.
Returns
the indexes of 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.

◆ GetCubeIntersections()

std::pair< Point, Point > Herd::CaloGeoParams::GetCubeIntersections ( 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
sort_by_cooif specified, determines the order in which points are stored in the output based on increasing coordinate
Returns
a pair of valid points if the line intersects the cube, otherwise the points will be set at their default value (filled with std::numeric_limits<float>::max())

◆ IsEmpty()

bool Herd::CaloGeoParams::IsEmpty ( unsigned int  volID) const
inline

Return true if the cube is empty.

Parameters
volIDVolume identifier.
Returns
true if the cube is empty, false if ti is filled with LYSO.

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

◆ SetCooIndexes()

void Herd::CaloGeoParams::SetCooIndexes ( unsigned int  volID,
CooArray< unsigned char >  indexes 
)
inline

Set the cube indexes.

Parameters
volIDVolume identifier.
indexesThe indexes of the cube.

◆ SetCubeSize()

void Herd::CaloGeoParams::SetCubeSize ( float  cubeSize)
inline

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

Parameters
cubeSizeThe cube size [cm].

◆ SetCubeSlotSize()

void Herd::CaloGeoParams::SetCubeSlotSize ( float  cubeSlotSize)
inline

Set the cube slot size [cm].

Parameters
cubeSizeThe slot size [cm].

◆ SetIsEmpty()

void Herd::CaloGeoParams::SetIsEmpty ( unsigned int  volID,
bool  isEmpty 
)
inline

Set the flag which indicates if the cube is empty.

When CaloGeoParams is constructed, the default value of isEmpty is false for each crystals.

Parameters
volIDVolume identifier.
indexestrue if the cube is empty, false if it is filled with LYSO.

◆ SetLYSODensity()

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

Set the LYSO density.

Parameters
densitythe LYSO density (g/cm3).

◆ SetNCubes()

void Herd::CaloGeoParams::SetNCubes ( unsigned int  nCubes)
inline

Set the number of cubes.

Parameters
nCubesNumber of cubes

◆ SetPosition()

void Herd::CaloGeoParams::SetPosition ( unsigned int  volID,
Point  position 
)
inline

Set the position of the center of the cube.

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

◆ VolumeID() [1/2]

unsigned int Herd::CaloGeoParams::VolumeID ( const CooArray< unsigned char > &  cooIndex)

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
unsigned int volume ID of this crystal

◆ VolumeID() [2/2]

unsigned int Herd::CaloGeoParams::VolumeID ( const Point position)

Return the volume ID given a position.

This method returns the volume ID of the cube containing the given point.

Parameters
cooIndexindexes of this crystal
Returns
unsigned int volume ID of this crystal

Member Data Documentation

◆ _caloCubes

std::vector<CaloCube> Herd::CaloGeoParams::_caloCubes
private

Vector of CaloCube, which contains the cube position and indexes.

◆ _cooId2VolIDMatrix

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

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

◆ _lysoDensity

float Herd::CaloGeoParams::_lysoDensity
private

The density the cube (g/cm3).


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