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++);
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));
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()));
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()));
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());
DDRotation DDrotReflect(const DDName &ddname, std::unique_ptr< DDRotationMatrix > rot)
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::unique_ptr< T, impl::DeviceDeleter > unique_ptr
Represents a uniquely identifyable rotation matrix.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
std::ostream & operator<<(std::ostream &os, const DDRotation &r)
const std::string & name() const
Returns the name.
std::unique_ptr< DDRotation > DDrotPtr(const DDName &ddname, std::unique_ptr< DDRotationMatrix > rot)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Cos< T >::type cos(const T &t)
const DDName & name() const
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.
DDRotation DDrot(const DDName &ddname, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
DDRotation DDanonymousRot(std::unique_ptr< DDRotationMatrix > rot)
Defines a anonymous rotation or rotation-reflection matrix.
std::pair< const N *, bool > def_type
DDRotation()
refers to the unit-rotation (no rotation at all)
void create(const DDName &name, std::unique_ptr< DDRotationMatrix > vals)