Go to the documentation of this file.
10 #ifndef HERD_CALOGEOPARAMS_H_
11 #define HERD_CALOGEOPARAMS_H_
76 unsigned char begin = defaultValue<unsigned char>;
77 unsigned char end = defaultValue<unsigned char>;
80 [[nodiscard]]
unsigned char Size()
const {
return end -
begin + 1; }
187 std::optional<unsigned int>
VolumeID(
const Point &point)
const;
198 std::optional<std::pair<Point, Point>>
225 [[nodiscard]]
float Volume()
const;
294 const std::array<Herd::Plane, 2> &
ZPlanes()
const;
368 void SetCubes(std::vector<Point> positions, std::vector<Indexes> indexes,
float cubeSize,
369 float cubeSlotSize = defaultValue<float>, std::vector<bool> mask = {});
437 std::vector<std::vector<std::vector<unsigned short>>>
std::vector< Indexes > _indexes
The indexes of each cube.
Definition: CaloGeoParams.h:422
const AxesArray< float > & Wells() const
Gets the wells sizes.
Definition: CaloGeoParams.h:338
const AxesArray< float > LPDSize() const
Return the LPD size, i.e the side length [cm].
Definition: CaloGeoParams.h:120
float m_xFaceYSize
The size along Y of the prism faces on X sides (cm).
Definition: CaloGeoParams.h:307
Parameters of the prismatic CALO envelope.
Definition: CaloGeoParams.h:249
bool operator==(const EllipsoidalEnvelope &rhs)
Definition: CaloGeoParams.cpp:366
void SetSPDSize(Herd::AxesArray< float > spdSize)
Set the SPD size, i.e the side length [cm].
Definition: CaloGeoParams.h:410
float LYSODensity() const
Return the LYSO density (g/cm3).
Definition: CaloGeoParams.h:132
void SetLYSODensity(float density)
Set the LYSO density.
Definition: CaloGeoParams.h:390
A class describing a vector in 3D space.
Definition: Vec3D.h:33
EllipsoidalEnvelope()
The half sizes of the truncated ellipsoid along each axis (cm).
Definition: CaloGeoParams.cpp:363
unsigned int _nMaxCubesPerSide
! Maximum number of cubes along each direction.
Definition: CaloGeoParams.h:439
virtual ~CaloGeoParams()=default
Virtual destructor
CooArray< unsigned char > Indexes
Definition: CaloGeoParams.h:50
void SetCubes(std::vector< Point > positions, std::vector< Indexes > indexes, float cubeSize, float cubeSlotSize=defaultValue< float >, std::vector< bool > mask={})
Set the cubes.
Definition: CaloGeoParams.cpp:266
bool operator==(const PrismaticEnvelope &rhs)
Definition: CaloGeoParams.cpp:492
Helper struct to hold a CooIndex range.
Definition: CaloGeoParams.h:75
const float & CubeSize() const
Return the cube size, i.e the side length [cm].
Definition: CaloGeoParams.h:114
float LYSONuclearInteractionLength() const
Return the nuclear interaction length of the LYSO material constituting the cube (cm).
Definition: CaloGeoParams.h:152
Class describing a line in the 3D space.
Definition: Line.h:37
float SphericalRadius() const
Gets the radius of the spherical CALO.
Definition: CaloGeoParams.h:206
std::string FillerMaterial() const
Return the filler material name.
Definition: CaloGeoParams.h:242
unsigned char end
Definition: CaloGeoParams.h:77
bool operator==(const CooIndexRange &other) const
Definition: CaloGeoParams.h:79
const AxesArray< float > SPDSize() const
Return the SPD size, i.e the side length [cm].
Definition: CaloGeoParams.h:126
void FillCooId2VolIDMatrix()
Fill the private lookup table which converts indexes into volume ID.
Definition: CaloGeoParams.cpp:23
void SetLPDSize(Herd::AxesArray< float > lpdSize)
Set the SPD size, i.e the side length [cm].
Definition: CaloGeoParams.h:404
CooIndexRange CooIndexesRange(RefFrame::Axis axis, unsigned char index1, unsigned char index2)
Return the CooIndex range for a given row of crystals.
Definition: CaloGeoParams.cpp:223
const EllipsoidalEnvelope & SphericalCaloEnvelope() const
Set the cube indexes.
Definition: CaloGeoParams.cpp:387
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
AxesArray< float > halfAxes
The center of the ellipsoid (cm).
Definition: CaloGeoParams.h:221
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.
Definition: CaloGeoParams.cpp:79
bool IsEmpty(unsigned int volID) const
Return true if the cube is masked.
Definition: CaloGeoParams.h:108
unsigned int NCubes() const
Return the total number of cubes.
Definition: CaloGeoParams.h:164
float _sphericalRadius
The radius of the spherical CALO expressed in cube ID units.
Definition: CaloGeoParams.h:431
std::optional< unsigned int > VolumeID(const Indexes &cooIndex) const
Return the volume ID starting from the indexes.
Definition: CaloGeoParams.cpp:46
float LYSORadiationLength() const
Return the radiation length of the LYSO material constituting the cube (cm).
Definition: CaloGeoParams.h:142
const AxesArray< float > & Gaps() const
Gets the gaps sizes.
Definition: CaloGeoParams.h:329
EllipsoidalEnvelope _ellipsoidalEnvelopeParams
Parameters of the ellipsoidal envelope of the spherical CALO.
Definition: CaloGeoParams.h:433
unsigned char begin
Definition: CaloGeoParams.h:76
void SetFillerMaterial(std::string fillerMaterial)
Set the filler material name.
Definition: CaloGeoParams.h:413
Vec3D _lpdOffset
The relative position of the LPD on each cube.
Definition: CaloGeoParams.h:424
void SetPDs(Vec3D lpdOffset, Vec3D spdOffset, Herd::AxesArray< float > lpdSize, Herd::AxesArray< float > spdSize)
Set the photodiodes.
Definition: CaloGeoParams.cpp:346
Parameters of the ellipsoidal CALO envelope.
Definition: CaloGeoParams.h:219
PrismaticEnvelope _prismaticEnvelopeParams
Parameters of the prismatic envelope of the standard CALO.
Definition: CaloGeoParams.h:434
float _lysoDensity
The density the cube (g/cm3).
Definition: CaloGeoParams.h:428
const DirectionsArray< Rectangle > & LateralFaces() const
Gets the lateral faces of the envelope.
Definition: CaloGeoParams.cpp:497
const Point LPDPosition(unsigned int volID) const
Return the position of the center of the LPD.
Definition: CaloGeoParams.h:57
Data structure for the Calo geometry parameters.
Definition: CaloGeoParams.h:35
const PrismaticEnvelope & PrismaticCaloEnvelope() const
Returns the parameters of the prismatic envelope of the standard CALO.
Definition: CaloGeoParams.cpp:539
AxesArray< float > _wells
The sizes of the wells (cm).
Definition: CaloGeoParams.h:430
PrismaticEnvelope()
Default constructor.
Definition: CaloGeoParams.cpp:457
float m_yFaceXSize
The size along X of the prism faces on Y sides (cm).
Definition: CaloGeoParams.h:308
Vec3D _spdOffset
The relative position of the SPD on each cube.
Definition: CaloGeoParams.h:425
const Indexes & CooIndexes(unsigned int volID) const
Return the cube indexes.
Definition: CaloGeoParams.h:71
const Point & Position(unsigned int volID) const
Return the position of the center of the cube.
Definition: CaloGeoParams.h:48
float Volume() const
Definition: CaloGeoParams.cpp:370
const std::array< Herd::Plane, 2 > & ZPlanes() const
Gets the top and bottom planes of the envelope.
Definition: CaloGeoParams.cpp:483
float _cubeSize
The size of the cube, i.e. the side length (cm).
Definition: CaloGeoParams.h:426
AxesArray< float > _lpdSize
The size of the LPD (cm).
Definition: CaloGeoParams.h:435
An array that accepts directions as subscripts.
Definition: DirectionsArray.h:71
Point center
Definition: CaloGeoParams.h:220
Axis
Aliases for the axes.
Definition: RefFrame.h:34
const Point SPDPosition(unsigned int volID) const
Return the position of the center of the SPD.
Definition: CaloGeoParams.h:64
Coo
Aliases for the three space coordinates.
Definition: RefFrame.h:24
float _cubeSlotSize
The size of the cube slot (cm).
Definition: CaloGeoParams.h:427
float Volume() const
Gets the total volume of the envelope.
Definition: CaloGeoParams.cpp:532
const float & CubeSlotSize() const
Return the size of the tray slot accommodating a single LYSO cube [cm].
Definition: CaloGeoParams.h:158
CaloGeoParams()
Default constructor
Definition: CaloGeoParams.cpp:18
unsigned char Size() const
Definition: CaloGeoParams.h:80
AxesArray< float > m_sizes
The size of the prism along each axis (cm).
Definition: CaloGeoParams.h:306
std::vector< std::vector< std::vector< unsigned short > > > _cooId2VolIDMatrix
! Matrix which contains the cooIndexes -> volumeID conversion
Definition: CaloGeoParams.h:438
AxesArray< float > _spdSize
The size of the SPD (cm).
Definition: CaloGeoParams.h:436
void SetSphericalRadius(float radius)
Sets the radius of the spherical CALO.
Definition: CaloGeoParams.cpp:357
Point m_center
The center of the prism (cm).
Definition: CaloGeoParams.h:305
const Point & Center() const
Gets the center of the envelope.
Definition: CaloGeoParams.h:276
AxesArray< float > _gaps
The gaps between the cubes (cm).
Definition: CaloGeoParams.h:429
std::vector< Point > _positions
The positions of each cube.
Definition: CaloGeoParams.h:421
std::vector< bool > _mask
The mask flag of each cube.
Definition: CaloGeoParams.h:423
AxesArray< float > halfSizes
The half axes of the full ellipsoid along each axis (cm).
Definition: CaloGeoParams.h:222
DirectionsArray< Rectangle > m_lateralFaces
Lateral faces of the envelope.
Definition: CaloGeoParams.h:309
std::array< Herd::Plane, 2 > m_zPlanes
Top (first) and bottom (second) envelope planes.
Definition: CaloGeoParams.h:310
std::string _fillerMaterial
Definition: CaloGeoParams.h:440