9#ifndef GEOPRIMITIVESTOSTRINGCONVERTER_H_
10#define GEOPRIMITIVESTOSTRINGCONVERTER_H_
17#ifndef XAOD_STANDALONE
18# include "CLHEP/Geometry/Transform3D.h"
19# include "CLHEP/Geometry/Point3D.h"
20# include "CLHEP/Vector/TwoVector.h"
41 Vector3D trans{translation.x(), translation.y(), translation.z()};
47 std::stringstream sstr{};
49 if (
transform.translation().mag() > std::numeric_limits<float>::epsilon()) {
54 if (printed) sstr<<rotOffSet<<
", ";
55 sstr<<
"rotation: {"<<
toString(
transform.linear()*Vector3D::UnitX(), precision)<<
",";
60 if (!printed) sstr<<
"Identity matrix ";
64#ifndef XAOD_STANDALONE
66 inline std::string
toString(
const CLHEP::HepRotation& rot,
int precision = 4,
const std::string& offset=
"" ){
67 std::ostringstream sout;
69 sout << std::setiosflags(std::ios::fixed) << std::setprecision(precision);
70 for(
int i=0;i<3;++i ){
71 for(
int j=0;j<3;++j ){
72 if( j == 0 ) sout <<
"(";
75 if( j == 2 ) sout <<
")";
87 inline std::string
toString(
const CLHEP::Hep3Vector& translation,
int precision = 4){
88 std::ostringstream sout;
89 sout << std::setiosflags(std::ios::fixed) << std::setprecision(precision);
90 for(
int j=0;j<3;++j ){
91 if( j == 0 ) sout <<
"(";
94 if( j == 2 ) sout <<
")";
100 inline std::string
toString(
const CLHEP::Hep2Vector& translation,
int precision = 4){
101 std::ostringstream sout;
102 sout << std::setiosflags(std::ios::fixed) << std::setprecision(precision);
103 for(
int j=0;j<2;++j ){
104 if( j == 0 ) sout <<
"(";
107 if( j == 1 ) sout <<
")";
113 inline std::string
toString(
const HepGeom::Transform3D& transf,
int precision = 4,
const std::string& offset=
""){
114 std::ostringstream sout;
115 sout <<
"Translation : " <<
toString( transf.getTranslation(), precision ) << std::endl;
116 std::string rotationOffset = offset +
" ";
117 sout << offset <<
"Rotation : " <<
toString( transf.getRotation(), precision+2, rotationOffset );
Definition of ATLAS Math & Geometry primitives (Amg)
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
double roundWithPrecision(double val, int precision)
EventPrimitvesToStringConverter.
bool doesNotDeform(const Amg::Transform3D &trans)
Checks whether the linear part of the transformation rotates or stetches any of the basis vectors.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D