Project
Loading...
Searching...
No Matches
MisalignmentParameters.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ITS3_MISALIGNMENTPARAMETERS_H_
16#define ITS3_MISALIGNMENTPARAMETERS_H_
17
18#include "ITS3Base/SpecsV2.h"
19
20#include "TNamed.h"
21#include "TFile.h"
22#include "TMatrixD.h"
23
24#include <array>
25#include <string>
26
27namespace o2::its3::align
28{
29
30class MisalignmentParameters : public TNamed
31{
32 public:
34
35 // IO
36 bool store(const std::string& file) const;
37 static MisalignmentParameters* load(const std::string& file);
38
40 double getGloTransX(unsigned int detID) const { return mGloTransX[detID]; }
41 double getGloTransY(unsigned int detID) const { return mGloTransY[detID]; }
42 double getGloTransZ(unsigned int detID) const { return mGloTransZ[detID]; }
43 double getGloRotX(unsigned int detID) const { return mGloRotX[detID]; }
44 double getGloRotY(unsigned int detID) const { return mGloRotY[detID]; }
45 double getGloRotZ(unsigned int detID) const { return mGloRotZ[detID]; }
47 void setGloTransX(unsigned int detID, double v) { mGloTransX[detID] = v; }
48 void setGloTransY(unsigned int detID, double v) { mGloTransY[detID] = v; }
49 void setGloTransZ(unsigned int detID, double v) { mGloTransZ[detID] = v; }
50 void setGloRotX(unsigned int detID, double v) { mGloRotX[detID] = v; }
51 void setGloRotY(unsigned int detID, double v) { mGloRotY[detID] = v; }
52 void setGloRotZ(unsigned int detID, double v) { mGloRotZ[detID] = v; }
53
55 const TMatrixD& getLegendreCoeffX(unsigned int sensorID) const { return mLegCoeffX[sensorID]; }
56 const TMatrixD& getLegendreCoeffY(unsigned int sensorID) const { return mLegCoeffY[sensorID]; }
57 const TMatrixD& getLegendreCoeffZ(unsigned int sensorID) const { return mLegCoeffZ[sensorID]; }
59 void setLegendreCoeffX(unsigned int sensorID, const TMatrixD& m) { setMatrix(mLegCoeffX[sensorID], m); }
60 void setLegendreCoeffY(unsigned int sensorID, const TMatrixD& m) { setMatrix(mLegCoeffY[sensorID], m); }
61 void setLegendreCoeffZ(unsigned int sensorID, const TMatrixD& m) { setMatrix(mLegCoeffZ[sensorID], m); }
62
63 void printParams(unsigned int detID) const;
64 void printLegendreParams(unsigned int sensorID) const;
65
66 private:
67 inline void setMatrix(TMatrixD& o, const TMatrixD& n)
68 {
69 o.ResizeTo(n.GetNrows(), n.GetNcols());
70 o = n;
71 }
72
73 static constexpr unsigned int nDetectors{constants::detID::nChips};
74
75 // Global parameters
76 std::array<double, nDetectors> mGloTransX;
77 std::array<double, nDetectors> mGloTransY;
78 std::array<double, nDetectors> mGloTransZ;
79 std::array<double, nDetectors> mGloRotX;
80 std::array<double, nDetectors> mGloRotY;
81 std::array<double, nDetectors> mGloRotZ;
82
83 // Legendre Polynominals coefficients
84 std::array<TMatrixD, constants::nSensorsIB> mLegCoeffX;
85 std::array<TMatrixD, constants::nSensorsIB> mLegCoeffY;
86 std::array<TMatrixD, constants::nSensorsIB> mLegCoeffZ;
87
88 ClassDefOverride(MisalignmentParameters, 1);
89};
90
91} // namespace o2::its3::align
92
93#endif
bool o
void printLegendreParams(unsigned int sensorID) const
double getGloTransZ(unsigned int detID) const
double getGloRotZ(unsigned int detID) const
const TMatrixD & getLegendreCoeffZ(unsigned int sensorID) const
void setLegendreCoeffY(unsigned int sensorID, const TMatrixD &m)
double getGloRotX(unsigned int detID) const
static MisalignmentParameters * load(const std::string &file)
void setGloRotY(unsigned int detID, double v)
void setGloTransZ(unsigned int detID, double v)
double getGloTransX(unsigned int detID) const
Global getters.
double getGloRotY(unsigned int detID) const
bool store(const std::string &file) const
const TMatrixD & getLegendreCoeffX(unsigned int sensorID) const
Legendre Coeff. getters.
const TMatrixD & getLegendreCoeffY(unsigned int sensorID) const
void setLegendreCoeffZ(unsigned int sensorID, const TMatrixD &m)
void setGloRotZ(unsigned int detID, double v)
double getGloTransY(unsigned int detID) const
void setGloTransY(unsigned int detID, double v)
void setGloTransX(unsigned int detID, double v)
Global setters.
void setLegendreCoeffX(unsigned int sensorID, const TMatrixD &m)
Legendre Coeff. setters.
void setGloRotX(unsigned int detID, double v)
GLdouble n
Definition glcorearb.h:1982
const GLfloat * m
Definition glcorearb.h:4066
const GLdouble * v
Definition glcorearb.h:832
constexpr unsigned int nChips
Definition SpecsV2.h:131