CMS 3D CMS Logo

Public Member Functions | Public Attributes

DDCompareDDRotMat Struct Reference

#include <DDCompareTools.h>

Inheritance diagram for DDCompareDDRotMat:
binary_function

List of all members.

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.

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

Definition at line 382 of file DDCompareTools.cc.

: 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, run_regression::ret, tol_, x, detailsBasic3DVector::y, and z.

                                                                                                    {
  bool ret(true);
  // manual way to do it... postponed.  Tested with Distance method from root::math
  //DD3Vector x1, y1, z1;
  //lhs.GetComponents(x1,y1,z1);
  //DD3Vector x2, y2, z2;
  //rhs.GetComponents(x2,y2,z2);
  double dist = Distance(lhs,rhs);
  if ( std::fabs(dist) > tol_ ) {
    std::cout << "Rotation matrices do not match." << std::endl;
    ret = false;
    DD3Vector x, y, z;
    std::cout << "FIRST" << std::endl;
    lhs.GetComponents(x,y,z);
    std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
    std::cout << "SECOND" << std::endl;
    rhs.GetComponents(x,y,z);
    std::cout << std::setw(12) << std::fixed << std::setprecision(4) << x.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.X();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Y();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << x.Z();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << y.Z();
    std::cout << "," << std::setw(12) << std::fixed << std::setprecision(4) << z.Z() << std::endl;
  }

  return ret;
}

Member Data Documentation

Definition at line 94 of file DDCompareTools.h.

Referenced by operator()().