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 395 of file DDCompareTools.cc.

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

Definition at line 397 of file DDCompareTools.cc.

397 : tol_(tol) { }

Member Function Documentation

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

Definition at line 399 of file DDCompareTools.cc.

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

399  {
400  bool ret(true);
401  // manual way to do it... postponed. Tested with Distance method from root::math
402  //DD3Vector x1, y1, z1;
403  //lhs.GetComponents(x1,y1,z1);
404  //DD3Vector x2, y2, z2;
405  //rhs.GetComponents(x2,y2,z2);
406  double dist = Distance(lhs,rhs);
407  if ( std::fabs(dist) > tol_ ) {
408  std::cout << "Rotation matrices do not match." << std::endl;
409  ret = false;
410  DD3Vector x, y, z;
411  std::cout << "FIRST" << std::endl;
412  lhs.GetComponents(x,y,z);
413  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
414  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
415  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
416  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
417  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
418  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
419  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
420  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
421  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
422  std::cout << "SECOND" << std::endl;
423  rhs.GetComponents(x,y,z);
424  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
425  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
426  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
427  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
428  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
429  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
430  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
431  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
432  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
433  }
434 
435  return ret;
436 }
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()().