BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMeasureLin4.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 BmnMeasureLin4 class header-only implementation
9 Reduced measurement model: 3 shifts + rotation about Z axis only
10 (phi and theta, the rotations about X and Y, are excluded).
11*/
12
13#ifndef BMNMEASURELIN4_H
14#define BMNMEASURELIN4_H
15
16#include "BmnMeasureModel.h"
17
18/*
19 * Same linearized transformation as BmnMeasureLin6 with phi = theta = 0.
20 *
21 * IMPORTANT: The formulae below are just reduced versions of full
22 * BmnMeasureLin6 model -- they was not checked separately.
23 *
24 * R_z = | 1 -psi 0 |
25 * | psi 1 0 |
26 * | 0 0 1 |
27 *
28 * x_m = alpha_x + beta_x * z0 + dx - dz * beta_x_bar - psi * y_bar
29 * y_m = alpha_y + beta_y * z0 + dy - dz * beta_y_bar + psi * x_bar
30 *
31 * IMPORTANT: The phi and theta slots of the parameter vector stay
32 * in place but carry no effect (SVectGL is fixed size 6).
33 * Do not forget to add the corresponding constraints!
34 */
35
37{
38 public:
39 const char* Description() const noexcept override; // out of line: anchors the vtable
40
41 inline Double_t X(Double_t z0, const SVectGL& gl, const SVectLC& lc) const noexcept override
42 {
43 const Double_t beta_x{lc(iX1)};
44 return lc(iX0) + beta_x * z0 + gl(idX) - gl(idZ) * beta_x - gl(iPsi) * (lc(iY0) + lc(iY1) * z0);
45 }
46
47 inline Double_t Y(Double_t z0, const SVectGL& gl, const SVectLC& lc) const noexcept override
48 {
49 const Double_t beta_y{lc(iY1)};
50 return lc(iY0) + beta_y * z0 + gl(idY) - gl(idZ) * beta_y + gl(iPsi) * (lc(iX0) + lc(iX1) * z0);
51 }
52
53 inline SVectGL dXdA(Double_t z0, const SVectLC& lc) const noexcept override
54 {
55 return SVectGL{
56 1.0,
57 0.0,
58 -lc(iX1), // d/ddZ = -beta_x
59 0.0, // d/dphi excluded
60 0.0, // d/dtheta excluded
61 -(lc(iY0) + lc(iY1) * z0) // d/dpsi = -y_bar
62 };
63 }
64
65 inline SVectGL dYdA(Double_t z0, const SVectLC& lc) const noexcept override
66 {
67 return SVectGL{
68 0.0,
69 1.0,
70 -lc(iY1), // d/ddZ = -beta_y
71 0.0, // d/dphi excluded
72 0.0, // d/dtheta excluded
73 lc(iX0) + lc(iX1) * z0 // d/dpsi = x_bar
74 };
75 }
76
77 inline Bool_t AlignHit(FairHit& hit, const SVectGL& a) const noexcept override
78 {
80 rot(1, 0) = a(iPsi);
81 rot(0, 1) = -a(iPsi);
82
83 Int_t ifail;
84 SVect3 hitAligned{rot.InverseFast(ifail) * SVect3(hit.GetX() - a(idX), hit.GetY() - a(idY), -a(idZ))};
85 if (ifail)
86 return kFALSE;
87
88 hit.SetXYZ(hitAligned(iX), hitAligned(iY), hitAligned(iZ) + hit.GetZ());
89 return kTRUE;
90 }
91
92 inline void AlignHitApproximately(SVect3& hit, const SVectGL& a) const noexcept override
93 {
94 // First order approximate correction (Z rotation only)
95 const Double_t x_m{hit(iX)}, y_m{hit(iY)};
96 hit(iX) -= a(iX) - a(iPsi) * y_m;
97 hit(iY) -= a(iY) + a(iPsi) * x_m;
98 hit(iZ) -= a(iZ);
99 }
100};
101
102#endif // BMNMEASURELIN4_H
@ iY1
@ iY0
@ iX1
@ iX0
RM::SVector< Double_t, 3 > SVect3
@ idX
@ idZ
@ iPsi
@ 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
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
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
SVectGL dXdA(Double_t z0, const SVectLC &lc) const noexcept override
SMatrix< T, D1, D2, R > InverseFast(int &ifail) const