BmnRoot
Loading...
Searching...
No Matches
BmnAlignDefines.h
Go to the documentation of this file.
1/*
2 BM@N alignment routine
3 BM@N experiment at NICA complex, JINR, 2025
4
5 Department: Math & Soft Group of HEP lab
6 Author: Igor Polev, polev@jinr.ru
7
8 Global defines for alignment task
9*/
10
11#ifndef BMN_ALIGN_DEFINES_H
12#define BMN_ALIGN_DEFINES_H
13
14#include "Math/SMatrix.h"
15#include "Math/SVector.h"
16#include "RtypesCore.h"
17
18// main configuration parameters
19#define BMN_MODULE_COUNT 22 // total number of FSD+GEM alignable detector elements (run 8)
20#define BMN_CORRECTIONS {"dX", "dY", "dZ"}
21#define BMN_GLOBAL_PARAMS_PD 3 // global alignment parameters per detector
22#define BMN_LOCAL_PARAMS_PT 4 // local alignment parameters per track
23#define BMN_MIN_HITS_PER_TRACK 5 // minimum alowed number of hits in track
24#define BMN_MAX_CHI2_PER_NDF 5.0 // maximum allowed chi2 per hit in track
25#define BMN_MIN_HITS_PORTION 0.1 // minimum portion of even part of tracks that must hit detector
26
27// TODO: avoid variables in this header
28constexpr static Int_t BMN_GLPARAMS_TOTAL{BMN_MODULE_COUNT * BMN_GLOBAL_PARAMS_PD};
29
30#define BMN_SVD_LOW 10.0 // threshold for SVD values visualization
31#define BMN_ALMOST_ZERO 1.0E-12 // approximate zero value for hard tests
32#define BMN_CLOSE_TO_ZERO 1.0E-6 // approximate zero for (soft) tests of numerical solution
33#define BMN_DRAW_TRACKS_CNT 20 // number of random tracks to draw
34
35#define BMN_MAX_HIT_RAM_SIZE 8589934592 // 8GB RAM limit
36#define BMN_MIN_TRACKS_PER_THREAD 1000 // multi-threading chunks
37#define BMN_TRACKS_READ_PORTION 100000 // UI
38#define BMN_THREAD_TRACKS_TICK 40000 // UI
39
40// alignment algorithm parameters
41#define BMN_MIN_ACTIVE_DETECTORS 1 // minimum number of active detectors to continue alignment
42#define BMN_MIN_REL_PROGRESS 0.001 // relative tolerance for MSE convergence
43#define BMN_REL_PROGRESS_GOOD 0.05 // relative iteration progress to turn off regularization
44#define BMN_MIN_REGULAR_ITERS 3 // minimum number of sequential iterations with egularization
45#define BMN_MAX_REGULAR_RETRY 10 // maximum number of retries with regularization turned on
46#define BMN_1D_STEP_TOLERANCE 0.01 // absolute tolerance for 1D minimizer
47#define BMN_BRENT_GRID_SIZE 4 // number of points in Brent preliminary grid
48#define BMN_LM_ITERATIONS_MIN 3 // minimum number of Levenberg–Marquardt iterations (at least 2 required)
49#define BMN_LM_ITERATIONS_MAX \
50 10 // maximum number of Levenberg–Marquardt iterations
51 // (at least BMN_LM_ITERATIONS_MIN + 1)
52#define BMN_LM_MULT_STEP 10.0 // multiplier for Levenberg–Marquardt factor
53
54// alignment algorithm test parameters
55#define BMN_TEST_MODULE_COUNT 16
56#define BMN_TEST_AVERAGE_DX 0.0208 // taken from real data 0.0208
57#define BMN_TEST_AVERAGE_DY 0.1234 // taken from real data 0.1234
58#define BMN_TEST_ALPHA1_SIGMA 1.0
59#define BMN_TEST_ALPHA2_MIN -1.0 // not really physical value
60#define BMN_TEST_ALPHA2_MAX 1.0 // not really physical value
61#define BMN_ALIGN_PARAM_TOLERENCE 0.1
62
63#define BMN_RESIDUALS_BINS 201
64#define BMN_RESIDUALS_RANGE_X 0.2
65#define BMN_RESIDUALS_RANGE_Y 1.0
66#define BMN_RESIDUALS_MAX 1000.0
67
68// fixed-size matrix types aliases
69
70typedef ROOT::Math::SVector<Double_t, 2> SVect2; // used in DEBUG only right now
71typedef ROOT::Math::SVector<Double_t, 3> SVect3;
72typedef ROOT::Math::SVector<Double_t, BMN_LOCAL_PARAMS_PT> SVectLC;
73typedef ROOT::Math::SVector<Double_t, BMN_GLOBAL_PARAMS_PD> SVectGL;
74typedef ROOT::Math::SVector<Double_t, BMN_GLPARAMS_TOTAL> SVectGLT;
75
76typedef ROOT::Math::SMatrix<Double_t, 3, 3> SMatr3x3;
77typedef ROOT::Math::SMatrix<Double_t, BMN_LOCAL_PARAMS_PT, BMN_LOCAL_PARAMS_PT> SMatrLC;
78typedef ROOT::Math::SMatrix<Double_t, BMN_GLOBAL_PARAMS_PD, BMN_GLOBAL_PARAMS_PD> SMatrGL;
79typedef ROOT::Math::SMatrix<Double_t, BMN_GLPARAMS_TOTAL, BMN_GLPARAMS_TOTAL> SMatrC;
80typedef ROOT::Math::SMatrix<Double_t, BMN_GLPARAMS_TOTAL, BMN_LOCAL_PARAMS_PT> SMatrG;
81typedef ROOT::Math::SMatrix<Double_t, BMN_GLOBAL_PARAMS_PD, BMN_LOCAL_PARAMS_PT> SMatrGP;
82
84{
85 iX = 0,
86 iY = 1,
87 iZ = 2
88};
89
91{
92 iX0 = 0,
93 iX1 = 1,
94 iY0 = 2,
95 iY1 = 3
96};
97
98// using global random generator for reproducibility purposes
99// TODO: try to avoid static variables in this header
100#include "TRandom3.h"
101static TRandom3 BMN_RND{0};
102
103#endif
ROOT::Math::SVector< Double_t, 2 > SVect2
ROOT::Math::SMatrix< Double_t, BMN_GLPARAMS_TOTAL, BMN_GLPARAMS_TOTAL > SMatrC
ROOT::Math::SMatrix< Double_t, BMN_GLOBAL_PARAMS_PD, BMN_GLOBAL_PARAMS_PD > SMatrGL
LocalParamsIdx
@ iY1
@ iY0
@ iX1
@ iX0
ROOT::Math::SVector< Double_t, BMN_GLPARAMS_TOTAL > SVectGLT
ROOT::Math::SMatrix< Double_t, BMN_GLPARAMS_TOTAL, BMN_LOCAL_PARAMS_PT > SMatrG
ROOT::Math::SMatrix< Double_t, BMN_GLOBAL_PARAMS_PD, BMN_LOCAL_PARAMS_PT > SMatrGP
ROOT::Math::SMatrix< Double_t, BMN_LOCAL_PARAMS_PT, BMN_LOCAL_PARAMS_PT > SMatrLC
ROOT::Math::SVector< Double_t, BMN_GLOBAL_PARAMS_PD > SVectGL
ROOT::Math::SMatrix< Double_t, 3, 3 > SMatr3x3
ROOT::Math::SVector< Double_t, 3 > SVect3
ROOT::Math::SVector< Double_t, BMN_LOCAL_PARAMS_PT > SVectLC
#define BMN_MODULE_COUNT
CoordIdx
@ iZ
@ iX
@ iY
#define BMN_GLOBAL_PARAMS_PD