CHeT Library
Loading...
Searching...
No Matches
Classes | Functions | Variables
CHeT::Config Namespace Reference

Global Settings namespace containing configuration structures, physical constants, and utility functions for the detector geometry. More...

Classes

struct  BundlesIntersection
 Represents a geometric intersection between two bundles. More...
 
struct  CylinderConfig
 Configuration for a full cylinder (Inner + Outer layers). More...
 
struct  FiberProp
 Properties of a specific reconstructed fiber. More...
 
struct  LayerConfig
 Configuration for a single fiber layer. More...
 

Functions

double GetStereoAngle (double radius, double deltaPhi=M_PI, double length=2.0 *L_HALF)
 Computes the analytical stereo angle for a given radius.
 
double GetOffsetExp ()
 Retrieves the current experimental angular offset (OFFSET_EXP).
 
void SetOffsetExp (double val)
 Sets the experimental angular offset (OFFSET_EXP).
 
double GetDeltaI (int cylIdx)
 Retrieves the current experimental parameter DELTA for a specific cylinder.
 
void SetDeltaI (int cylIdx, double val)
 Sets the experimental parameter DELTA for a specific cylinder.
 
void SetDeltas (const std::vector< double > &deltas)
 Sets the experimental parameter DELTA for all cylinders.
 
std::vector< double > GetDeltas ()
 Gets the experimental parameter DELTA for all cylinders.
 
void SetRotation (double rx, double ry, double rz)
 Sets the global rotation of the detector using Euler angles. Rotations are applied in order: X, then Y, then Z.
 
void GetRotation (double &rx, double &ry, double &rz)
 Retrieves the current global rotation angles.
 
void SetTranslation (double tx, double ty, double tz)
 Sets the global translation of the detector origin.
 
void GetTranslation (double &tx, double &ty, double &tz)
 Retrieves the current global translation.
 
void ApplyRotation (double &x, double &y, double &z)
 Rotates a 3D VECTOR in-place from the Detector Local Frame to the Global Lab Frame. Uses the currently set rotation angles. This applies ONLY rotation (suitable for direction vectors).
 
void ApplyInverseRotation (double &x, double &y, double &z)
 Rotates a 3D VECTOR in-place from the Global Lab Frame to the Detector Local Frame. (Inverse of ApplyRotation). This applies ONLY rotation (suitable for direction vectors).
 
void ApplyTransformation (double &x, double &y, double &z)
 Transforms a 3D POINT in-place from the Detector Local Frame to the Global Lab Frame. Applies Rotation then Translation. P_global = R * P_local + T.
 
void ApplyInverseTransformation (double &x, double &y, double &z)
 Transforms a 3D POINT in-place from the Global Lab Frame to the Detector Local Frame. Applies Inverse Translation then Inverse Rotation. P_local = R^T * (P_global - T)
 
int GetBoardGlobalOffset (int board_id)
 Returns the global offset (bundle count) for a specific board.
 
void SetActiveCylinders (const std::vector< int > &active_ids)
 Sets the list of active cylinder IDs. This defines the physical composition of the detector for the current run/simulation. Only these cylinders will be returned by GetCylinders().
 
std::vector< int > GetActiveCylinders ()
 Retrieves the list of currently active cylinder IDs.
 
const std::vector< CylinderConfig > & GetCylinders ()
 Retrieves the configuration for all active cylinders.
 
double wrap0_2pi (double angle)
 Wraps an angle into the [0, 2*PI) range.
 
FiberProp GetFiberProp (int b_id)
 Retrieves fiber properties given a global bundle ID.
 
int GetGlobalBundleId (int board_id, int channel_id)
 Converts Hardware Board/Channel to Global Bundle ID.
 
std::vector< BundlesIntersectionFindIntersections (const std::vector< int > &hit_ids)
 Finds 3D intersections between a list of hit bundles.
 
int GetGlobalIdFromGeometry (int cyl_id, int layer_id, int layer_idx)
 Helper: Converts Geometry (Cyl, Layer, Index) to Global ID.
 
void PrintBundleMapping (int global_id)
 Helper: Prints mapping details for a given Global ID to stdout.
 
void MapExplorer ()
 Interactive CLI menu to explore the mapping.
 

Variables

constexpr double L_HALF = 150.0
 Half-length of the detector [mm].
 
constexpr double FIBER_WIDTH = 0.5
 Physical width of a single fiber [mm].
 
constexpr int FIBERS_PER_SIPM = 4
 Number of fibers per SiPM (bundle)
 
constexpr double BUNDLE_WIDTH = FIBER_WIDTH * FIBERS_PER_SIPM
 Physical width of a bundle [mm].
 

Detailed Description

Global Settings namespace containing configuration structures, physical constants, and utility functions for the detector geometry.

Function Documentation

◆ ApplyInverseRotation()

void CHeT::Config::ApplyInverseRotation ( double &  x,
double &  y,
double &  z 
)

Rotates a 3D VECTOR in-place from the Global Lab Frame to the Detector Local Frame. (Inverse of ApplyRotation). This applies ONLY rotation (suitable for direction vectors).

Parameters
xX component
yY component
zZ component

Definition at line 217 of file CHeTGlobalSettings.cc.

◆ ApplyInverseTransformation()

void CHeT::Config::ApplyInverseTransformation ( double &  x,
double &  y,
double &  z 
)

Transforms a 3D POINT in-place from the Global Lab Frame to the Detector Local Frame. Applies Inverse Translation then Inverse Rotation. P_local = R^T * (P_global - T)

Parameters
xX coordinate [mm]
yY coordinate [mm]
zZ coordinate [mm]

Definition at line 243 of file CHeTGlobalSettings.cc.

◆ ApplyRotation()

void CHeT::Config::ApplyRotation ( double &  x,
double &  y,
double &  z 
)

Rotates a 3D VECTOR in-place from the Detector Local Frame to the Global Lab Frame. Uses the currently set rotation angles. This applies ONLY rotation (suitable for direction vectors).

Parameters
xX component
yY component
zZ component

Definition at line 203 of file CHeTGlobalSettings.cc.

◆ ApplyTransformation()

void CHeT::Config::ApplyTransformation ( double &  x,
double &  y,
double &  z 
)

Transforms a 3D POINT in-place from the Detector Local Frame to the Global Lab Frame. Applies Rotation then Translation. P_global = R * P_local + T.

Parameters
xX coordinate [mm]
yY coordinate [mm]
zZ coordinate [mm]

Definition at line 232 of file CHeTGlobalSettings.cc.

◆ FindIntersections()

std::vector< BundlesIntersection > CHeT::Config::FindIntersections ( const std::vector< int > &  hit_ids)

Finds 3D intersections between a list of hit bundles.

Parameters
hit_idsVector of global bundle IDs that fired.
Returns
Vector of intersection points.

Definition at line 425 of file CHeTGlobalSettings.cc.

◆ GetActiveCylinders()

std::vector< int > CHeT::Config::GetActiveCylinders ( )

Retrieves the list of currently active cylinder IDs.

Returns
Vector of active cylinder IDs.

Definition at line 275 of file CHeTGlobalSettings.cc.

◆ GetBoardGlobalOffset()

int CHeT::Config::GetBoardGlobalOffset ( int  board_id)

Returns the global offset (bundle count) for a specific board.

Parameters
board_idThe hardware board ID.
Returns
The offset in bundle index, or -1 if invalid.

Definition at line 254 of file CHeTGlobalSettings.cc.

◆ GetCylinders()

const std::vector< CylinderConfig > & CHeT::Config::GetCylinders ( )

Retrieves the configuration for all active cylinders.

Returns
A constant reference to the vector of cylinder configurations.

Definition at line 282 of file CHeTGlobalSettings.cc.

◆ GetDeltaI()

double CHeT::Config::GetDeltaI ( int  cylIdx)

Retrieves the current experimental parameter DELTA for a specific cylinder.

Parameters
cylIdxThe index of the cylinder (0 to 5).
Returns
The value of DELTA for the cylinder.

Definition at line 97 of file CHeTGlobalSettings.cc.

◆ GetDeltas()

std::vector< double > CHeT::Config::GetDeltas ( )

Gets the experimental parameter DELTA for all cylinders.

Returns
A vector containing the DELTA values for all cylinders.

Definition at line 122 of file CHeTGlobalSettings.cc.

◆ GetFiberProp()

FiberProp CHeT::Config::GetFiberProp ( int  b_id)

Retrieves fiber properties given a global bundle ID.

Parameters
b_idGlobal bundle ID.
Returns
FiberProp structure containing geometry info.

Definition at line 363 of file CHeTGlobalSettings.cc.

◆ GetGlobalBundleId()

int CHeT::Config::GetGlobalBundleId ( int  board_id,
int  channel_id 
)

Converts Hardware Board/Channel to Global Bundle ID.

Parameters
board_idHardware board ID.
channel_idHardware channel ID.
Returns
Global Bundle ID, or -1 if mapping not found.

Definition at line 394 of file CHeTGlobalSettings.cc.

◆ GetGlobalIdFromGeometry()

int CHeT::Config::GetGlobalIdFromGeometry ( int  cyl_id,
int  layer_id,
int  layer_idx 
)

Helper: Converts Geometry (Cyl, Layer, Index) to Global ID.

Definition at line 486 of file CHeTGlobalSettings.cc.

◆ GetOffsetExp()

double CHeT::Config::GetOffsetExp ( )

Retrieves the current experimental angular offset (OFFSET_EXP).

Returns
The offset value in radians.

Definition at line 87 of file CHeTGlobalSettings.cc.

◆ GetRotation()

void CHeT::Config::GetRotation ( double &  rx,
double &  ry,
double &  rz 
)

Retrieves the current global rotation angles.

Parameters
rxOutput rotation around X axis [rad]
ryOutput rotation around Y axis [rad]
rzOutput rotation around Z axis [rad]

Definition at line 182 of file CHeTGlobalSettings.cc.

◆ GetStereoAngle()

double CHeT::Config::GetStereoAngle ( double  radius,
double  deltaPhi = M_PI,
double  length = 2.0 * L_HALF 
)
inline

Computes the analytical stereo angle for a given radius.

Parameters
radiusThe radius of the cylinder layer [mm]
deltaPhiThe total twist angle of the fiber from end to end [rad] (default: PI)
lengthThe total longitudinal length of the cylinder [mm] (default: 2 * L_HALF)
Returns
Stereo angle in radians

Definition at line 96 of file CHeTGlobalSettings.hh.

◆ GetTranslation()

void CHeT::Config::GetTranslation ( double &  tx,
double &  ty,
double &  tz 
)

Retrieves the current global translation.

Parameters
txOutput Translation X [mm]
tyOutput Translation Y [mm]
tzOutput Translation Z [mm]

Definition at line 196 of file CHeTGlobalSettings.cc.

◆ MapExplorer()

void CHeT::Config::MapExplorer ( )

Interactive CLI menu to explore the mapping.

Definition at line 575 of file CHeTGlobalSettings.cc.

◆ PrintBundleMapping()

void CHeT::Config::PrintBundleMapping ( int  global_id)

Helper: Prints mapping details for a given Global ID to stdout.

Definition at line 515 of file CHeTGlobalSettings.cc.

◆ SetActiveCylinders()

void CHeT::Config::SetActiveCylinders ( const std::vector< int > &  active_ids)

Sets the list of active cylinder IDs. This defines the physical composition of the detector for the current run/simulation. Only these cylinders will be returned by GetCylinders().

Parameters
active_idsVector of cylinder IDs.

Definition at line 269 of file CHeTGlobalSettings.cc.

◆ SetDeltaI()

void CHeT::Config::SetDeltaI ( int  cylIdx,
double  val 
)

Sets the experimental parameter DELTA for a specific cylinder.

Note
Setting this value invalidates the geometry cache, causing a lazy recalculation.
Parameters
cylIdxThe index of the cylinder (0 to 5).
valThe new value for DELTA.

Definition at line 104 of file CHeTGlobalSettings.cc.

◆ SetDeltas()

void CHeT::Config::SetDeltas ( const std::vector< double > &  deltas)

Sets the experimental parameter DELTA for all cylinders.

Note
Setting this value invalidates the geometry cache, causing a lazy recalculation.
Parameters
deltasA vector containing the DELTA values for all cylinders.

Definition at line 113 of file CHeTGlobalSettings.cc.

◆ SetOffsetExp()

void CHeT::Config::SetOffsetExp ( double  val)

Sets the experimental angular offset (OFFSET_EXP).

Note
Setting this value invalidates the geometry cache, causing a lazy recalculation.
Parameters
valThe new offset value in radians.

Definition at line 91 of file CHeTGlobalSettings.cc.

◆ SetRotation()

void CHeT::Config::SetRotation ( double  rx,
double  ry,
double  rz 
)

Sets the global rotation of the detector using Euler angles. Rotations are applied in order: X, then Y, then Z.

Parameters
rxRotation around X axis [rad]
ryRotation around Y axis [rad]
rzRotation around Z axis [rad]

Definition at line 127 of file CHeTGlobalSettings.cc.

◆ SetTranslation()

void CHeT::Config::SetTranslation ( double  tx,
double  ty,
double  tz 
)

Sets the global translation of the detector origin.

Parameters
txTranslation X [mm]
tyTranslation Y [mm]
tzTranslation Z [mm]

Definition at line 189 of file CHeTGlobalSettings.cc.

◆ wrap0_2pi()

double CHeT::Config::wrap0_2pi ( double  angle)

Wraps an angle into the [0, 2*PI) range.

Parameters
angleInput angle in radians.
Returns
Wrapped angle.

Definition at line 355 of file CHeTGlobalSettings.cc.

Variable Documentation

◆ BUNDLE_WIDTH

constexpr double CHeT::Config::BUNDLE_WIDTH = FIBER_WIDTH * FIBERS_PER_SIPM
constexpr

Physical width of a bundle [mm].

Definition at line 87 of file CHeTGlobalSettings.hh.

◆ FIBER_WIDTH

constexpr double CHeT::Config::FIBER_WIDTH = 0.5
constexpr

Physical width of a single fiber [mm].

Definition at line 85 of file CHeTGlobalSettings.hh.

◆ FIBERS_PER_SIPM

constexpr int CHeT::Config::FIBERS_PER_SIPM = 4
constexpr

Number of fibers per SiPM (bundle)

Definition at line 86 of file CHeTGlobalSettings.hh.

◆ L_HALF

constexpr double CHeT::Config::L_HALF = 150.0
constexpr

Half-length of the detector [mm].

Definition at line 84 of file CHeTGlobalSettings.hh.