1#ifndef CHETGLOBALSETTINGS_HH
2#define CHETGLOBALSETTINGS_HH
98 return std::atan((radius * deltaPhi) / length);
139void SetDeltas(
const std::vector<double> &deltas);
164void GetRotation(
double &rx,
double &ry,
double &rz);
278std::vector<BundlesIntersection>
FindIntersections(
const std::vector<int> &hit_ids);
FiberProp GetFiberProp(int b_id)
Retrieves fiber properties given a global bundle ID.
constexpr int FIBERS_PER_SIPM
Number of fibers per SiPM (bundle)
int GetBoardGlobalOffset(int board_id)
Returns the global offset (bundle count) for a specific board.
void ApplyInverseTransformation(double &x, double &y, double &z)
Transforms a 3D POINT in-place from the Global Lab Frame to the Detector Local Frame....
double GetOffsetExp()
Retrieves the current experimental angular offset (OFFSET_EXP).
void SetDeltaI(int cylIdx, double val)
Sets the experimental parameter DELTA for a specific cylinder.
void ApplyRotation(double &x, double &y, double &z)
Rotates a 3D VECTOR in-place from the Detector Local Frame to the Global Lab Frame....
std::vector< BundlesIntersection > FindIntersections(const std::vector< int > &hit_ids)
Finds 3D intersections between a list of hit bundles.
constexpr double FIBER_WIDTH
Physical width of a single fiber [mm].
void SetDeltas(const std::vector< double > &deltas)
Sets the experimental parameter DELTA for all cylinders.
constexpr double BUNDLE_WIDTH
Physical width of a bundle [mm].
std::vector< int > GetActiveCylinders()
Retrieves the list of currently active cylinder IDs.
void ApplyTransformation(double &x, double &y, double &z)
Transforms a 3D POINT in-place from the Detector Local Frame to the Global Lab Frame....
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 c...
void SetOffsetExp(double val)
Sets the experimental angular offset (OFFSET_EXP).
double wrap0_2pi(double angle)
Wraps an angle into the [0, 2*PI) range.
int GetGlobalBundleId(int board_id, int channel_id)
Converts Hardware Board/Channel to Global Bundle ID.
void SetTranslation(double tx, double ty, double tz)
Sets the global translation of the detector origin.
void MapExplorer()
Interactive CLI menu to explore the mapping.
const std::vector< CylinderConfig > & GetCylinders()
Retrieves the configuration for all active cylinders.
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.
double GetDeltaI(int cylIdx)
Retrieves the current experimental parameter DELTA for a specific cylinder.
constexpr double L_HALF
Half-length of the detector [mm].
std::vector< double > GetDeltas()
Gets the experimental parameter DELTA for all cylinders.
void ApplyInverseRotation(double &x, double &y, double &z)
Rotates a 3D VECTOR in-place from the Global Lab Frame to the Detector Local Frame....
void GetRotation(double &rx, double &ry, double &rz)
Retrieves the current global rotation angles.
void SetRotation(double rx, double ry, double rz)
Sets the global rotation of the detector using Euler angles. Rotations are applied in order: X,...
void GetTranslation(double &tx, double &ty, double &tz)
Retrieves the current global translation.
double GetStereoAngle(double radius, double deltaPhi=M_PI, double length=2.0 *L_HALF)
Computes the analytical stereo angle for a given radius.
Root namespace for the Cylindrical Helix Tracker (CHeT) project.
Represents a geometric intersection between two bundles.
double widthZ
Longitudinal uncertainty due to fiber thickness [mm].
int cylinderId
ID of the cylinder where intersection occurs.
double y
Transverse position Y [mm].
double z_loc
Longitudinal position [mm] (Local)
double x
Transverse position X [mm].
double y_loc
Transverse position Y [mm] (Local)
double x_loc
Transverse position X [mm] (Local)
double z
Longitudinal position [mm].
Configuration for a full cylinder (Inner + Outer layers).
LayerConfig outer
Configuration for the outer layer.
LayerConfig inner
Configuration for the inner layer.
double nominalRadius
Nominal radius in [mm].
Properties of a specific reconstructed fiber.
int layerId
0 for inner, 1 for outer
int dir
Winding direction.
int color
ROOT color index.
double phi0
Initial angle [rad].
Configuration for a single fiber layer.
double thickness
Thickness in [mm].
double radius
Radius in [mm].
int direction
Winding direction: +1 (CCW) or -1 (CW)
int color
ROOT color index for display.
int nBundles
Number of bundles in the layer.
double phiOffset
Angular offset in [rad].
double nominalStereoAngle
Nominal stereo angle in [rad].