CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 90 of file DDCompareTools.h.

Constructor & Destructor Documentation

DDCompareDDRotMat::DDCompareDDRotMat ( )

Definition at line 380 of file DDCompareTools.cc.

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

Definition at line 382 of file DDCompareTools.cc.

382 : tol_(tol) { }

Member Function Documentation

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

Definition at line 384 of file DDCompareTools.cc.

References gather_cfg::cout, runTheMatrix::ret, tol_, x, y, and z.

384  {
385  bool ret(true);
386  // manual way to do it... postponed. Tested with Distance method from root::math
387  //DD3Vector x1, y1, z1;
388  //lhs.GetComponents(x1,y1,z1);
389  //DD3Vector x2, y2, z2;
390  //rhs.GetComponents(x2,y2,z2);
391  double dist = Distance(lhs,rhs);
392  if ( std::fabs(dist) > tol_ ) {
393  std::cout << "Rotation matrices do not match." << std::endl;
394  ret = false;
395  DD3Vector x, y, z;
396  std::cout << "FIRST" << std::endl;
397  lhs.GetComponents(x,y,z);
398  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
399  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
400  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
401  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
402  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
403  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
404  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
405  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
406  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
407  std::cout << "SECOND" << std::endl;
408  rhs.GetComponents(x,y,z);
409  std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
410  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
411  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
412  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
413  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
414  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
415  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
416  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
417  std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
418  }
419 
420  return ret;
421 }
tuple ret
prodAgent to be discontinued
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

double DDCompareDDRotMat::tol_

Definition at line 94 of file DDCompareTools.h.

Referenced by operator()().