Project
Loading...
Searching...
No Matches
Cartesian.cxx
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#include <iostream>
13#include "MathUtils/Cartesian.h"
14
18
19namespace o2
20{
21namespace math_utils
22{
23
24//_________________________________________________
25Transform3D::Transform3D(const TGeoMatrix& m)
26{
27 /*
28 * Construct from TGeoMatrix or its derived classes
29 */
30 set(m);
31}
32
33//_________________________________________________
34void Transform3D::set(const TGeoMatrix& m)
35{
36 /*
37 * Set parameters from TGeoMatrix
38 */
39 const double* t = m.GetTranslation();
40 const double* r = m.GetRotationMatrix();
41 SetComponents(r[0], r[1], r[2], t[0], r[3], r[4], r[5], t[1], r[6], r[7], r[8], t[2]);
42}
43
44//_________________________________________________
46{
47 /*
48 * print itself
49 */
50 std::cout << *this << std::endl;
51}
52
53} // namespace math_utils
54} // namespace o2
55
56//_________________________________________________
57std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Df_t& t)
58{
59 float cs, sn;
60 t.getComponents(cs, sn);
61 os << "cos: " << cs << " sin: " << sn;
62 return os;
63}
64
65//_________________________________________________
66std::ostream& operator<<(std::ostream& os, const o2::math_utils::Rotation2Dd_t& t)
67{
68 double cs, sn;
69 t.getComponents(cs, sn);
70 os << "cos: " << cs << " sin: " << sn;
71 return os;
72}
ClassImp(o2::math_utils::Transform3D)
std::ostream & operator<<(std::ostream &os, const o2::math_utils::Rotation2Df_t &t)
Definition Cartesian.cxx:57
transformation types
Definition Cartesian.h:62
void getComponents(value_t &cs, value_t &sn) const
Definition Cartesian.h:90
void set(const TGeoMatrix &m)
Definition Cartesian.cxx:34
const GLfloat * m
Definition glcorearb.h:4066
GLboolean r
Definition glcorearb.h:1233
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...