// // $Id: SiLadder.cpp,v 1.12 2001/11/05 11:32:58 skulik Exp $ // // File: SiLadder.cc // Purpose: // Created: 21-OCT-1997 John Hobbs // // $Revision: 1.12 $ // // // Include files #include #include "SiLadder.hpp" #include // Global definitions using namespace std; using namespace dgs; bool operator<(const SiLadder& lhs, const SiLadder&rhs) { return lhs.get_position()[2] < rhs.get_position()[2]; } bool operator==(const SiLadder& lhs, const SiLadder&rhs) { return lhs.get_position() == rhs.get_position() && lhs.get_xsize() == rhs.get_xsize() && lhs.get_ysize() == rhs.get_ysize(); } // Accessors const list SiLadder::get_children() { list empty_list; return empty_list; } #ifdef OLDMAN SpacePoint SiLadder::local_to_global(const CartesianCoordinate& lpt) const // // Purpose: Convert a point in silicon local coordinates to global D0 // Arguements: // Returns: // { return GeometryElement::local_to_global(lpt); } MatrixD SiLadder::local_to_global(const CartesianMatrix& theMatrix) const // // Purpose: Convert a point in silicon local coordinates to global D0 // Remember that the silicon local coordinate is different than the // Plane local coordinate. So, first, transform the matrix into // the plane coordinate // Arguements: // Returns: // { if( intrinsic_mode ) return GeometryElement::local_to_global(theMatrix); // For the old method of handling the local coordinates double ladder_to_plane[9]={1.0,0.0,0.0,0.0,0.0,1.0,0.0,-1.0,0.0}; MatrixD l2p(3,ladder_to_plane); MatrixD planeMatrix = l2p*theMatrix*l2p.inverse(); return GeometryElement::local_to_global(planeMatrix); } CartesianCoordinate SiLadder::global_to_local(const SpacePoint& gpt) const { CartesianCoordinate undone = get_position().invert(gpt); if( intrinsic_mode ) return undone; return CartesianCoordinate(undone.x(),-undone.z(),undone.y()); } #endif std::ostream& operator<< (std::ostream& os, const SiLadder& me) { const Plane* me_as_plane = &me; os << "SiLadder: " << *me_as_plane; return os; } float SiLadder::get_alength() const { if( fabs(_alength) < 1e-7 ) return get_ysize(); return _alength; } float SiLadder::get_awidth() const { if( fabs(_awidth) < 1e-7 ) return get_xsize(); return _awidth; } float SiLadder::get_alcenter() const { return _calength; } float SiLadder::get_awcenter() const { return _cawidth; }