11 #include <framework/geometry/B2Vector3.h>
14 #include <TMatrixDSym.h>
17 #include <TRotation.h>
18 #include <Math/Vector3D.h>
26 namespace RotationTools {
32 inline TMatrixD toMatrix(TRotation r)
35 for (
int i = 0; i < 3; ++i)
36 for (
int j = 0; j < 3; ++j)
48 inline TMatrixD getRotationMatrixYZ(
double angleY,
double angleZ)
63 inline TMatrixD getRotationMatrixXY(
double angleX,
double angleY)
79 inline TMatrixD rotateTensor(
const B2Vector3D& vTo,
const TMatrixD& orgMat)
81 TMatrixD r = getRotationMatrixYZ(vTo.Theta(), vTo.Phi());
82 TMatrixD rT = r; rT.T();
83 return r * orgMat * rT;
92 inline TMatrixD rotateTensorInv(
const ROOT::Math::XYZVector& vTo,
const TMatrixD& orgMat)
94 TMatrixD r = getRotationMatrixYZ(vTo.Theta(), vTo.Phi());
95 TMatrixD rT = r; rT.T();
96 return rT * orgMat * r;
106 inline TMatrixDSym toSymMatrix(
const TMatrixD& m)
108 TMatrixDSym mS(m.GetNrows());
109 for (
int i = 0; i < m.GetNrows(); ++i)
110 for (
int j = 0; j < m.GetNcols(); ++j) {
111 mS(i, j) = (m(i, j) + m(j, i)) / 2;
123 return TVectorD(0, 2, v.X(), v.Y(), v.Z(),
"END");
B2Vector3< DataType > Unit() const
Unit vector parallel to this.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Abstract base class for different kinds of events.