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

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

Definition at line 396 of file DDCompareTools.cc.

396 : tol_(tol) { }

Member Function Documentation

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

Definition at line 398 of file DDCompareTools.cc.

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

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