Project
Loading...
Searching...
No Matches
Deformations.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
12#ifndef ITS3_DEFORMATIONS_H_
13#define ITS3_DEFORMATIONS_H_
14
17
18#include <filesystem>
19
21{
22
24{
25 public:
26 // init deformations from the parameter file
27 void init(const std::filesystem::path&);
28
29 double getDeformationX(unsigned int id, double u, double v) const { return getDeformation<0>(id, u, v); }
30 double getDeformationY(unsigned int id, double u, double v) const { return getDeformation<1>(id, u, v); }
31 double getDeformationZ(unsigned int id, double u, double v) const { return getDeformation<2>(id, u, v); }
32 double getDeformation(unsigned int id, unsigned int axis, double u, double v) const
33 {
34 if (axis == 0) {
35 return mLegX[id](u, v);
36 } else if (axis == 1) {
37 return mLegY[id](u, v);
38 } else {
39 return mLegZ[id](u, v);
40 }
41 }
42 std::array<double, 3> getDeformation(unsigned int id, double u, double v) const
43 {
44 return {getDeformation<0>(id, u, v),
45 getDeformation<1>(id, u, v),
46 getDeformation<2>(id, u, v)};
47 }
48 std::array<unsigned int, 3> getOrders(unsigned int id) const
49 {
50 return {mLegX[id].NOrder(), mLegY[id].NOrder(), mLegZ[id].NOrder()};
51 }
52 const o2::math_utils::Legendre2DPolynominal& getLegendre(unsigned int id, unsigned int axis) const
53 {
54 if (axis == 0) {
55 return mLegX[id];
56 } else if (axis == 1) {
57 return mLegY[id];
58 } else {
59 return mLegZ[id];
60 }
61 }
62
63 private:
64 template <int axis>
65 double getDeformation(unsigned int id, double u, double v) const
66 {
67 if constexpr (axis == 0) {
68 return mLegX[id](u, v);
69 } else if constexpr (axis == 1) {
70 return mLegY[id](u, v);
71 } else {
72 return mLegZ[id](u, v);
73 }
74 }
75
76 // 3 Legendre polynominals to model deformations in x,y,z; parameterized by normalized phi (u) and z (v) coordinates
77 std::array<o2::math_utils::Legendre2DPolynominal, 6> mLegX;
78 std::array<o2::math_utils::Legendre2DPolynominal, 6> mLegY;
79 std::array<o2::math_utils::Legendre2DPolynominal, 6> mLegZ;
80};
81
82} // namespace o2::its3::align
83
84#endif
Definition of the NDim Legendre Polynominals.
Definition of the MisalignmentParameters class.
double getDeformationZ(unsigned int id, double u, double v) const
std::array< unsigned int, 3 > getOrders(unsigned int id) const
double getDeformationY(unsigned int id, double u, double v) const
const o2::math_utils::Legendre2DPolynominal & getLegendre(unsigned int id, unsigned int axis) const
double getDeformation(unsigned int id, unsigned int axis, double u, double v) const
std::array< double, 3 > getDeformation(unsigned int id, double u, double v) const
double getDeformationX(unsigned int id, double u, double v) const
void init(const std::filesystem::path &)
const GLdouble * v
Definition glcorearb.h:832
GLuint id
Definition glcorearb.h:650