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"
21 #endif // not XAOD_STANDALONE
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 <<
")";
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 );
121 #endif // not XAOD_STANDALONE