15 #include "Math/GenVector/AxisAngle.h" 16 #include "Math/GenVector/Cartesian3D.h" 17 #include "Math/GenVector/DisplacementVector3D.h" 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++);
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
const DDName & name() const
constexpr NumType convertRadToDeg(NumType radians)
Sin< T >::type sin(const T &t)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
DDName is used to identify DDD entities uniquely.
friend DDRotation DDanonymousRot(std::unique_ptr< DDRotationMatrix >)
Defines a anonymous rotation or rotation-reflection matrix.
Represents a uniquely identifyable rotation matrix.
std::ostream & operator<<(std::ostream &os, const DDRotation &r)
friend std::unique_ptr< DDRotation > DDrotPtr(const DDName &, std::unique_ptr< DDRotationMatrix >)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Cos< T >::type cos(const T &t)
friend DDRotation DDrotReflect(const DDName &, double, double, double, double, double, double)
Defines a rotation-reflection in the Geant3 way.
std::unique_ptr< DDRotationMatrix > DDcreateRotationMatrix(double thetaX, double phiX, double thetaY, double phiY, double thetaZ, double phiZ)
create a new DDRotationMatrix in the GEANT3 style.
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.
ROOT::Math::AxisAngle DDAxisAngle
friend DDRotation DDrot(const DDName &, std::unique_ptr< DDRotationMatrix >)
Definition of a uniquely identifiable rotation matrix named by DDName name.
const DDName & ddname() const
void create(const DDName &name, std::unique_ptr< DDRotationMatrix > vals)