BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMeasureLin6.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.int
7
8 BmnMeasureLin6 class header-only implementation
9 Linearized measurement model with 6 alignment parameters per detector
10 (3 shifts + 3 rotations) and 4 local parameters per straight track.
11
12 Reference: 16-th BM@N Collaboration Meeting report by I. Polev,
13 Appendix A (alignment transformation) and Appendix B (measurement model).
14*/
15
16#ifndef BMNMEASURELIN6_H
17#define BMNMEASURELIN6_H
18
19#include "BmnMeasureModel.h"
20
21/*
22 * Alignment transformation:
23 *
24 * | x_m | | x | | dx |
25 * | y_m | = R_zyx * | y | + | dy |
26 * | z0 | | z - z0 | | dz + z0 |
27 *
28 * R_zyx = | 1 -psi theta | (linearized rotation)
29 * | psi 1 -phi |
30 * |-theta phi 1 |
31 *
32 * Linearized measurement model, with `bar` denoting the latest
33 * approximation of the local parameters:
34 *
35 * x_m = alpha_x + beta_x * z0 + dx - dz * beta_x_bar - psi * y_bar - phi * beta_x_bar * y_bar + theta *
36 * beta_x_bar * x_bar y_m = alpha_y + beta_y * z0 + dy - dz * beta_y_bar + psi * x_bar - phi * beta_y_bar * y_bar +
37 * theta * beta_y_bar * x_bar x_bar = alpha_x_bar + beta_x_bar * z0 y_bar = alpha_y_bar + beta_y_bar * z0
38 */
39
41{
42 public:
43 const char* Description() const noexcept override; // out of line: anchors the vtable
44
45 inline Double_t X(Double_t z0, const SVectGL& gl, const SVectLC& lc) const noexcept override
46 {
47 const Double_t beta_x{lc(iX1)}, x_bar{lc(iX0) + beta_x * z0}, y_bar{lc(iY0) + lc(iY1) * z0};
48 return x_bar + gl(idX) - gl(idZ) * beta_x - gl(iPsi) * y_bar - gl(iPhi) * beta_x * y_bar
49 + gl(iTheta) * beta_x * x_bar;
50 }
51
52 inline Double_t Y(Double_t z0, const SVectGL& gl, const SVectLC& lc) const noexcept override
53 {
54 const Double_t beta_y{lc(iY1)}, x_bar{lc(iX0) + lc(iX1) * z0}, y_bar{lc(iY0) + beta_y * z0};
55 return y_bar + gl(idY) - gl(idZ) * beta_y + gl(iPsi) * x_bar - gl(iPhi) * beta_y * y_bar
56 + gl(iTheta) * beta_y * x_bar;
57 }
58
59 inline SVectGL dXdA(Double_t z0, const SVectLC& lc) const noexcept override
60 {
61 const Double_t beta_x{lc(iX1)}, beta_x_m{-beta_x}, y_bar{lc(iY0) + lc(iY1) * z0};
62 return SVectGL{1.0, 0.0, beta_x_m, beta_x_m * y_bar, beta_x * (lc(iX0) + beta_x * z0), -y_bar};
63 }
64
65 inline SVectGL dYdA(Double_t z0, const SVectLC& lc) const noexcept override
66 {
67 const Double_t beta_y{lc(iY1)}, beta_y_m{-beta_y}, x_bar{lc(iX0) + lc(iX1) * z0};
68 return SVectGL{0.0, 1.0, beta_y_m, beta_y_m * (lc(iY0) + beta_y * z0), beta_y * x_bar, x_bar};
69 }
70
71 inline Bool_t AlignHit(FairHit& hit, const SVectGL& a) const noexcept override
72 {
74 rot(2, 1) = a(iPhi);
75 rot(1, 2) = -a(iPhi);
76 rot(0, 2) = a(iTheta);
77 rot(2, 0) = -a(iTheta);
78 rot(1, 0) = a(iPsi);
79 rot(0, 1) = -a(iPsi);
80
81 Int_t ifail;
82 SVect3 hitAligned{rot.InverseFast(ifail) * SVect3(hit.GetX() - a(idX), hit.GetY() - a(idY), -a(idZ))};
83 if (ifail)
84 return kFALSE;
85
86 hit.SetXYZ(hitAligned(iX), hitAligned(iY), hitAligned(iZ) + hit.GetZ());
87 return kTRUE;
88 }
89
90 inline void AlignHitApproximately(SVect3& hit, const SVectGL& a) const noexcept override
91 {
92 // First order approximate correction
93 const Double_t x_m{hit(iX)}, y_m{hit(iY)};
94 hit(iX) -= a(iX) - a(iPsi) * y_m;
95 hit(iY) -= a(iY) + a(iPsi) * x_m;
96 hit(iZ) -= a(iZ) + a(iPhi) * y_m - a(iTheta) * x_m;
97 }
98};
99
100#endif // BMNMEASURELIN6_H
@ iY1
@ iY0
@ iX1
@ iX0
RM::SVector< Double_t, 3 > SVect3
@ idX
@ iPhi
@ idZ
@ iPsi
@ iTheta
@ idY
RM::SVector< Double_t, BMN_LOCAL_PARAMS_PT > SVectLC
RM::SVector< Double_t, BMN_GLOBAL_PARAMS_PD > SVectGL
RM::SMatrix< Double_t, 3, 3 > SMatr3x3
@ iZ
@ iX
@ iY
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
SVectGL dXdA(Double_t z0, const SVectLC &lc) const noexcept override
Bool_t AlignHit(FairHit &hit, const SVectGL &a) const noexcept override
Double_t X(Double_t z0, const SVectGL &gl, const SVectLC &lc) const noexcept override
const char * Description() const noexcept override
SVectGL dYdA(Double_t z0, const SVectLC &lc) const noexcept override
Double_t Y(Double_t z0, const SVectGL &gl, const SVectLC &lc) const noexcept override
void AlignHitApproximately(SVect3 &hit, const SVectGL &a) const noexcept override
SMatrix< T, D1, D2, R > InverseFast(int &ifail) const