Project
Loading...
Searching...
No Matches
GeometryTransformer.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
16
17#ifndef O2_MID_GEOMETRYTRANSFORMER_H
18#define O2_MID_GEOMETRYTRANSFORMER_H
19
20#include <array>
22#include "MathUtils/Cartesian.h"
23
24class TGeoManager;
25
26namespace o2
27{
28namespace mid
29{
33{
34 public:
35 void setMatrix(int deId, const ROOT::Math::Transform3D& matrix);
37 inline const ROOT::Math::Transform3D getMatrix(int deId) { return mTransformations[deId]; }
38
39 template <typename T>
41 {
43 return mTransformations[deId](position);
44 }
45 template <typename T>
47 {
49 return mTransformations[deId].ApplyInverse(position);
50 }
51 template <typename T>
52 math_utils::Point3D<T> localToGlobal(int deId, T xPos, T yPos) const
53 {
55 return localToGlobal(deId, math_utils::Point3D<T>(xPos, yPos, 0.));
56 }
57 template <typename T>
58 math_utils::Point3D<T> globalToLocal(int deId, T xPos, T yPos, T zPos) const
59 {
61 return globalToLocal(deId, math_utils::Point3D<T>(xPos, yPos, zPos));
62 }
63 template <typename T>
65 {
67 return mTransformations[deId](direction);
68 }
69 template <typename T>
71 {
73 return mTransformations[deId].ApplyInverse(direction);
74 }
75
76 private:
77 std::array<o2::math_utils::Transform3D, detparams::NDetectionElements> mTransformations;
78};
79
81ROOT::Math::Transform3D getDefaultRPCTransform(bool isRight, int chamber, int rpc);
82GeometryTransformer createDefaultTransformer();
83GeometryTransformer createTransformationFromManager(const TGeoManager* geoManager);
84} // namespace mid
85} // namespace o2
86
87#endif /* O2_MID_GEOMETRYTRANSFORMER_H */
Useful detector parameters for MID.
math_utils::Point3D< T > globalToLocal(int deId, T xPos, T yPos, T zPos) const
math_utils::Point3D< T > localToGlobal(int deId, const math_utils::Point3D< T > &position) const
math_utils::Vector3D< T > localToGlobal(int deId, const math_utils::Vector3D< T > &direction) const
const ROOT::Math::Transform3D getMatrix(int deId)
Gets the matrix transformation for detection element deId.
math_utils::Point3D< T > localToGlobal(int deId, T xPos, T yPos) const
math_utils::Vector3D< T > globalToLocal(int deId, const math_utils::Vector3D< T > &direction) const
void setMatrix(int deId, const ROOT::Math::Transform3D &matrix)
math_utils::Point3D< T > globalToLocal(int deId, const math_utils::Point3D< T > &position) const
GeometryTransformer createTransformationFromManager(const TGeoManager *geoManager)
ROOT::Math::Transform3D getDefaultChamberTransform(int ichamber)
ROOT::Math::Transform3D getDefaultRPCTransform(bool isRight, int chamber, int rpc)
GeometryTransformer createDefaultTransformer()
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...