CbmRoot
Loading...
Searching...
No Matches
CbmBbaAlignmentBody.h
Go to the documentation of this file.
1/* Copyright (C) 2025 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergey Gorbunov [committer] */
4
9
10#pragma once
11
12#include <TGeoMatrix.h>
13#include <TString.h>
14
15#include <array>
16
17namespace cbm::bba
18{
48 public:
50 AlignmentBody() = default;
51
54 explicit AlignmentBody(double shiftX, double shiftY, double shiftZ, double rotX, double rotY, double rotZ);
55
58 AlignmentBody(const std::string nodePath);
59
61 ~AlignmentBody() = default;
62 static constexpr int NofParameters = 6;
63
64 bool IsValid() const { return fIsValid; }
65
66 bool CreateFromGeoNode(const std::string nodePath);
67
68 void ActivateParameters(const std::array<bool, NofParameters>& isParActive);
69
70 bool IsParameterActive(int i) const { return fIsParActive[i]; }
71
72 void SetParameters(double shiftX = 0., double shiftY = 0., double shiftZ = 0., double rotX = 0., double rotY = 0.,
73 double rotZ = 0.);
74
76 const std::string& GetNodePath() const { return fNodePath; }
77
79 const TGeoHMatrix& GetGlobalTransform() const { return fGlobal; }
80
82 std::array<double, 3> ApplyAlignmentToHit(const std::array<double, 3> hit) const;
83
85 std::array<double, 3> ApplyInverseAlignmentToHit(const std::array<double, 3> hit) const;
86
88 const std::array<double, NofParameters>& GetParameters() const { return fPar; }
89
90 void GetParameters(double* par) const;
91
93 const std::array<double, NofParameters>& GetInitialParameters() const { return fPar0; }
94
96 const TGeoHMatrix& GetAlignmentMatrix() const { return fAlignment; }
97
100 const TGeoHMatrix& GetHitTransform() const { return fHitTransform; }
101
103 void SetStatistics(long statistics) { fStatistics = statistics; }
104
106 void IncrementStatistics(int increment) { fStatistics += increment; }
107
109 long GetStatistics() const { return fStatistics; }
110
112 int GetTrackingStation() const { return fTrackingStation; }
113
115 void SetTrackingStation(int station) { fTrackingStation = station; }
116
117
118 private:
120 bool fIsValid{false};
121
122 std::string fNodePath{};
123
124 std::array<double, NofParameters> fPar{0.};
125
126 std::array<bool, NofParameters> fIsParActive{false};
127
128
129 std::array<double, NofParameters> fPar0{0.};
130
131 TGeoHMatrix fAlignment;
132
133 TGeoHMatrix fGlobal;
134 TGeoHMatrix fGlobalInv;
135 TGeoHMatrix fGlobalNominal;
136
137 TGeoHMatrix fHitTransform;
140
142
143 long fStatistics{0};
144
146 };
147} // namespace cbm::bba
void ActivateParameters(const std::array< bool, NofParameters > &isParActive)
TGeoHMatrix fGlobal
global transformation matrix of the alignment body
const TGeoHMatrix & GetHitTransform() const
Get the transformation of the initially aligned {x,y,z} to the newly aligned {x,y,...
long fStatistics
additional information
const TGeoHMatrix & GetAlignmentMatrix() const
Get the transformation matrix of the alignment body.
TGeoHMatrix fGlobalNominal
nominal global transformation matrix, without (pre-)alignment
const TGeoHMatrix & GetGlobalTransform() const
Get the transformation of the aligment body to the glaobal coordinates.
std::string fNodePath
full path to the node in the root geometry
bool IsParameterActive(int i) const
bool fIsValid
flag indicating if the alignment body is valid
void SetStatistics(long statistics)
Set the statistics for the alignment body.
std::array< double, NofParameters > fPar0
initial alignment parameters
void SetTrackingStation(int station)
Set the Tracking Station index.
ClassDefNV(AlignmentBody, 0)
std::array< double, 3 > ApplyAlignmentToHit(const std::array< double, 3 > hit) const
Apply the alignment to hit: return = fHitTransform * hit.
const std::array< double, NofParameters > & GetParameters() const
Get the alignment parameters.
AlignmentBody()=default
Default constructor.
std::array< double, NofParameters > fPar
alignment parameters: shiftX, shiftY, shiftZ, rotX, rotY, rotZ
void IncrementStatistics(int increment)
Increment the statistics for the alignment body.
const std::string & GetNodePath() const
Get the full path to the node in the ROOT geometry.
const std::array< double, NofParameters > & GetInitialParameters() const
Get the initial alignment parameters.
std::array< bool, NofParameters > fIsParActive
flags for the parameters to be aligned
int GetTrackingStation() const
Get the Tracking Station index.
static constexpr int NofParameters
number of alignment parameters
~AlignmentBody()=default
Destructor.
TGeoHMatrix fAlignment
transformation matrix of the alignment body. Corresponds to the fPar values.
bool CreateFromGeoNode(const std::string nodePath)
long GetStatistics() const
Get the statistics for the alignment body.
void SetParameters(double shiftX=0., double shiftY=0., double shiftZ=0., double rotX=0., double rotY=0., double rotZ=0.)
TGeoHMatrix fGlobalInv
inverse of the global transformation matrix
std::array< double, 3 > ApplyInverseAlignmentToHit(const std::array< double, 3 > hit) const
Apply the inverse alignment to hit: return = fHitTransform^{-1} * hit.