CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
DDCompareDDRotMat Struct Reference

#include <DDCompareTools.h>

Inheritance diagram for DDCompareDDRotMat:

Public Member Functions

 DDCompareDDRotMat ()
 
 DDCompareDDRotMat (double tol)
 
bool operator() (const DDRotationMatrix &lhs, const DDRotationMatrix &rhs) const
 

Public Attributes

double tol_
 

Detailed Description

Definition at line 100 of file DDCompareTools.h.

Constructor & Destructor Documentation

DDCompareDDRotMat::DDCompareDDRotMat ( )

Definition at line 327 of file DDCompareTools.cc.

327 : tol_(0.0004) { }
DDCompareDDRotMat::DDCompareDDRotMat ( double  tol)

Definition at line 329 of file DDCompareTools.cc.

329 : tol_(tol) { }

Member Function Documentation

bool DDCompareDDRotMat::operator() ( const DDRotationMatrix lhs,
const DDRotationMatrix rhs 
) const

Definition at line 331 of file DDCompareTools.cc.

References gather_cfg::cout, alignBH_cfg::fixed, tol_, x, y, and z.

331  {
332  bool ret(true);
333  // manual way to do it... postponed. Tested with Distance method from root::math
334  //DD3Vector x1, y1, z1;
335  //lhs.GetComponents(x1,y1,z1);
336  //DD3Vector x2, y2, z2;
337  //rhs.GetComponents(x2,y2,z2);
338  double dist = Distance(lhs,rhs);
339  if ( std::fabs(dist) > tol_ ) {
340  std::cout << "Rotation matrices do not match." << std::endl;
341  ret = false;
342  DD3Vector x, y, z;
343  std::cout << "FIRST" << std::endl;
344  lhs.GetComponents(x,y,z);
345  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
346  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
347  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
348  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
349  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
350  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
351  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
352  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
353  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
354  std::cout << "SECOND" << std::endl;
355  rhs.GetComponents(x,y,z);
356  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
357  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
358  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
359  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
360  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
361  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
362  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
363  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
364  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
365  }
366 
367  return ret;
368 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6

Member Data Documentation

double DDCompareDDRotMat::tol_

Definition at line 104 of file DDCompareTools.h.

Referenced by operator()().