ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoPrimitives
GeoPrimitives
CLHEPtoEigenEulerAnglesConverters.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* eigen_migration
7
* main.cpp
8
*
9
* Created on: Feb 4, 2014
10
* Author: rbianchi <Riccardo.Maria.Bianchi@cern.ch>
11
*
12
*/
13
14
#ifndef _GEOPRIMITIVES_CLHEPTOEIGENEULERANGLESCONVERTERS_H
15
#define _GEOPRIMITIVES_CLHEPTOEIGENEULERANGLESCONVERTERS_H
16
17
#include "
GeoPrimitives/GeoPrimitives.h
"
18
19
#include <math.h>
// for M_PI definition
20
21
22
23
namespace
Amg
{
24
25
34
inline
Amg::Vector3D
convert_CLHEPPhiThetaPsi_to_EigenEulerAngles
(
Amg::Vector3D
clhep_angles,
int
convention = 0)
35
{
36
Amg::Vector3D
eigen_angles;
37
38
// using Z-X-Z convention (CLHEP): (2,0,2) == "Z,X,Z". // DEFAULT
39
if
(convention == 0) {
40
eigen_angles(2) = -clhep_angles(0);
// Phi-->Z
41
eigen_angles(1) = -clhep_angles(1);
// Theta-->X
42
eigen_angles(0) = -clhep_angles(2);
// Psi-->Z
43
}
44
// using Z-Y-Z convention: (2,1,2) == "Z,Y,Z"
45
else
{
46
eigen_angles(0) = -0.5 * clhep_angles(0);
// Phi-->Z
47
eigen_angles(1) = clhep_angles(1);
// Theta-->Y
48
eigen_angles(2) = clhep_angles(2);
// Psi-->Z
49
}
50
51
return
eigen_angles;
52
}
53
62
inline
Amg::Vector3D
convert_EigenEulerAngles_to_CLHEPPhiThetaPsi
(
Amg::Vector3D
eigen_angles,
int
convention = 0)
63
{
64
Amg::Vector3D
clhep_angles;
65
66
double
phi
;
67
double
theta
;
68
double
psi;
69
84
// using Z-X-Z convention: (2,0,2) == "Z,X,Z". // DEFAULT
85
if
(convention == 0) {
86
phi
= -eigen_angles(2);
// Z-->Phi
87
theta
= -eigen_angles(1);
// X-->Theta
88
psi = -eigen_angles(0);
// Z-->Psi
89
}
90
// using Z-Y-Z convention: (2,1,2) == "Z,Y,Z"
91
else
{
92
phi
= -2 * eigen_angles(0);
// Z-->Phi
93
theta
= eigen_angles(1);
// Y-->Theta
94
psi = eigen_angles(2);
// Z-->Psi
95
}
96
97
clhep_angles(0) =
phi
;
98
clhep_angles(1) =
theta
;
99
clhep_angles(2) = psi;
100
101
return
clhep_angles;
102
103
}
104
105
106
}
// end of namespace Amg
107
108
109
#endif
110
111
112
113
114
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
theta
Scalar theta() const
theta method
Definition
AmgMatrixBasePlugin.h:75
GeoPrimitives.h
Amg
Definition of ATLAS Math & Geometry primitives (Amg).
Definition
AmgStringHelpers.h:19
Amg::convert_EigenEulerAngles_to_CLHEPPhiThetaPsi
Amg::Vector3D convert_EigenEulerAngles_to_CLHEPPhiThetaPsi(Amg::Vector3D eigen_angles, int convention=0)
Convert Eigen euler angles to CLEHP Phi,Theta,Psi angles.
Definition
CLHEPtoEigenEulerAnglesConverters.h:62
Amg::convert_CLHEPPhiThetaPsi_to_EigenEulerAngles
Amg::Vector3D convert_CLHEPPhiThetaPsi_to_EigenEulerAngles(Amg::Vector3D clhep_angles, int convention=0)
Convert CLEHP Phi,Theta,Psi angles to Eigen euler angles using Z-X-Z convention.
Definition
CLHEPtoEigenEulerAnglesConverters.h:34
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Generated on
for ATLAS Offline Software by
1.17.0