15 #include "Math/GenVector/AxisAngle.h"
16 #include "Math/GenVector/Cartesian3D.h"
17 #include "Math/GenVector/DisplacementVector3D.h"
19 using namespace geant_units::operators;
24 os << *(defined.first) <<
" ";
32 os <<
"* rotation not defined * ";
35 os <<
"* rotation not declared * ";
41 constexpr
char const* baseName =
"DdBlNa";
47 static std::atomic<int> countBlank;
49 snprintf(buf, 64,
"%s%i", baseName, countBlank++);
50 create(
DDName(buf, baseName), std::make_unique<DDRotationMatrix>());
61 static std::atomic<int> countNN;
63 snprintf(buf, 64,
"DdNoNa%i", countNN++);
72 std::unique_ptr<DDRotation>
DDrotPtr(
const DDName& ddname, std::unique_ptr<DDRotationMatrix>
rot) {
74 return std::make_unique<DDRotation>(ddname,
std::move(rot));
86 double check = (x.Cross(y)).Dot(z);
87 if (fabs(1. - check) > tol) {
88 edm::LogError(
"DDRotation") << ddname <<
" is not a RIGHT-handed orthonormal matrix!" << std::endl;
93 std::make_unique<DDRotationMatrix>(x.x(), y.x(), z.x(), x.y(), y.y(), z.y(), x.z(), y.z(), z.z()));
109 double check = (x.Cross(y)).Dot(z);
110 if (fabs(1. + check) > tol) {
111 edm::LogError(
"DDRotation") << ddname <<
" is not a LEFT-handed orthonormal matrix!" << std::endl;
116 std::make_unique<DDRotationMatrix>(x.x(), y.x(), z.x(), x.y(), y.y(), z.y(), x.z(), y.z(), z.z()));
128 double check = (x.Cross(y)).Dot(z);
129 if ((1. - fabs(check)) > tol) {
130 std::ostringstream
o;
131 o <<
"matrix is not an (left or right handed) orthonormal matrix! (in deg)" << std::endl
140 return std::make_unique<DDRotationMatrix>(x.x(), y.x(), z.x(), x.y(), y.y(), z.y(), x.z(), y.z(), z.z());
def_type isDefined() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
ROOT::Math::AxisAngle DDAxisAngle
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
DDName is used to identify DDD entities uniquely.
Log< level::Error, false > LogError
std::ostream & operator<<(std::ostream &out, const ALILine &li)
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Represents a uniquely identifyable rotation matrix.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Cos< T >::type cos(const T &t)
std::pair< const N *, bool > def_type
const DDRotationMatrix & rotation() const
Returns the read-only rotation-matrix.
DDRotation()
refers to the unit-rotation (no rotation at all)
const std::string & name() const
Returns the name.
void create(const DDName &name, std::unique_ptr< DDRotationMatrix >vals)