File indexing completed on 2025-01-18 09:14:32
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #if defined(DD4HEP_PARSER_HEADER)
0016
0017 #define DD4HEP_NEED_EVALUATOR
0018
0019
0020 #include DD4HEP_PARSER_HEADER
0021
0022 #else
0023
0024
0025 #include "Parsers/spirit/ToStream.h"
0026
0027 #endif
0028
0029 #ifndef DD4HEP_PARSERS_NO_ROOT
0030 #include "Math/Translation3D.h"
0031
0032
0033 namespace dd4hep {
0034
0035 namespace Parsers {
0036
0037
0038 std::ostream& toStream_(const ROOT::Math::XYZPoint& obj, std::ostream& s) {
0039 s << "( ";
0040 toStream_(obj.X () , s );
0041 s << " , ";
0042 toStream_(obj.Y () , s );
0043 s << " , ";
0044 toStream_(obj.Z () , s );
0045 s << " )";
0046 return s;
0047 }
0048 template <> std::ostream& toStream(const ROOT::Math::XYZPoint& obj, std::ostream& s)
0049 { return toStream_(obj, s); }
0050
0051
0052 std::ostream& toStream_(const ROOT::Math::XYZVector& obj, std::ostream& s) {
0053 s << "( ";
0054 toStream_(obj.X () , s );
0055 s << " , ";
0056 toStream_(obj.Y () , s );
0057 s << " , ";
0058 toStream_(obj.Z () , s );
0059 s << " )";
0060 return s;
0061 }
0062 template <> std::ostream& toStream(const ROOT::Math::XYZVector& obj, std::ostream& s)
0063 { return toStream_(obj, s); }
0064
0065
0066 std::ostream& toStream_(const ROOT::Math::PxPyPzEVector& obj, std::ostream& s){
0067 s << "( ";
0068 toStream_(obj.Px () , s , 12 );
0069 s << " , ";
0070 toStream_(obj.Py () , s , 12 );
0071 s << " , ";
0072 toStream_(obj.Pz () , s , 13 );
0073 s << " , ";
0074 toStream_(obj.E () , s , 14 );
0075 s << " )";
0076 return s;
0077 }
0078 template <> std::ostream& toStream(const ROOT::Math::PxPyPzEVector& obj, std::ostream& s)
0079 { return toStream_(obj, s); }
0080
0081
0082 std::ostream& toStream_(const ROOT::Math::Translation3D& obj, std::ostream& s){
0083 double x,y,z;
0084 obj.GetComponents(x,y,z);
0085 s << "( ";
0086 toStream_(x , s );
0087 s << " , ";
0088 toStream_(y , s );
0089 s << " , ";
0090 toStream_(z, s );
0091 s << " )";
0092 return s;
0093 }
0094 template <> std::ostream& toStream(const ROOT::Math::Translation3D& obj, std::ostream& s)
0095 { return toStream_(obj, s); }
0096
0097
0098 std::ostream& toStream_(const ROOT::Math::RotationZYX& obj, std::ostream& s){
0099 s << "( ";
0100 toStream_(obj.Phi () , s , 12 );
0101 s << " , ";
0102 toStream_(obj.Theta () , s , 12 );
0103 s << " , ";
0104 toStream_(obj.Psi () , s , 12 );
0105 s << " )";
0106 return s;
0107 }
0108 template <> std::ostream& toStream(const ROOT::Math::RotationZYX& obj, std::ostream& s)
0109 { return toStream_(obj, s); }
0110 }
0111 }
0112 #endif