15 #include "Math/GenVector/AxisAngle.h" 16 #include "Math/GenVector/Cartesian3D.h" 17 #include "Math/GenVector/DisplacementVector3D.h" 25 os << *(defined.first) <<
" ";
29 os <<
"t=" <<
CONVERT_TO( ra.Axis().Theta(), deg ) <<
"deg " 30 <<
"p=" <<
CONVERT_TO( ra.Axis().Phi(), deg ) <<
"deg " 31 <<
"a=" <<
CONVERT_TO( ra.Angle(), deg ) <<
"deg";
34 os <<
"* rotation not defined * ";
38 os <<
"* rotation not declared * ";
46 constexpr char const* baseName =
"DdBlNa";
52 static std::atomic<int> countBlank;
54 snprintf( buf, 64,
"%s%i", baseName, countBlank++ );
55 create(
DDName( buf, baseName ), std::make_unique<DDRotationMatrix>());
73 static std::atomic<int> countNN;
75 snprintf(buf, 64,
"DdNoNa%i", countNN++);
86 std::unique_ptr<DDRotation>
95 double thetaX,
double phiX,
96 double thetaY,
double phiY,
97 double thetaZ,
double phiZ)
105 double check = (x.Cross(y)).Dot(z);
106 if (fabs(1.-check)>tol) {
107 edm::LogError(
"DDRotation") << ddname <<
" is not a RIGHT-handed orthonormal matrix!" << std::endl;
112 std::make_unique<DDRotationMatrix>(x.x(),y.x(),z.x(),
125 double thetaX,
double phiX,
126 double thetaY,
double phiY,
127 double thetaZ,
double phiZ )
135 double check = (x.Cross(y)).Dot(z);
136 if (fabs(1.+check)>tol) {
137 edm::LogError(
"DDRotation") << ddname <<
" is not a LEFT-handed orthonormal matrix!" << std::endl;
142 std::make_unique<DDRotationMatrix>(x.x(),y.x(),z.x(),
148 std::unique_ptr<DDRotationMatrix>
150 double thetaY,
double phiY,
151 double thetaZ,
double phiZ )
159 double check = (x.Cross(y)).Dot(z);
160 if ((1.-fabs(check))>tol) {
161 std::ostringstream
o;
162 o <<
"matrix is not an (left or right handed) orthonormal matrix! (in deg)" << std::endl
171 return std::make_unique<DDRotationMatrix>(x.x(),y.x(),z.x(),
def_type isDefined() const
const DDName & name() const
Sin< T >::type sin(const T &t)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
#define CONVERT_TO(_x, _y)
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)