#include <DataFormats/GeometryCommonDetAlgo/interface/PerpendicularBoundPlaneBuilder.h>
Public Member Functions | |
BoundPlane * | operator() (const Surface::GlobalPoint &origin, const Surface::GlobalVector &perp) const |
Must be updated for reference counting.
Definition at line 11 of file PerpendicularBoundPlaneBuilder.h.
BoundPlane * PerpendicularBoundPlaneBuilder::operator() | ( | const Surface::GlobalPoint & | origin, | |
const Surface::GlobalVector & | perp | |||
) | const |
Definition at line 6 of file PerpendicularBoundPlaneBuilder.cc.
References Vector3DBase< T, FrameTag >::cross(), rot, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00008 { 00009 // z axis coincides with perp 00010 GlobalVector zAxis = perp.unit(); 00011 00012 // x axis has no global Z component 00013 GlobalVector xAxis; 00014 if ( zAxis.x() != 0 || zAxis.y() != 0) { 00015 // precision is not an issue here, just protect against divizion by zero 00016 xAxis = GlobalVector( -zAxis.y(), zAxis.x(), 0).unit(); 00017 } 00018 else { // perp coincides with global Z 00019 xAxis = GlobalVector( 1, 0, 0); 00020 } 00021 00022 // y axis obtained by cross product 00023 GlobalVector yAxis( zAxis.cross( xAxis)); 00024 00025 Surface::RotationType rot( xAxis.x(), xAxis.y(), xAxis.z(), 00026 yAxis.x(), yAxis.y(), yAxis.z(), 00027 zAxis.x(), zAxis.y(), zAxis.z()); 00028 00029 return new BoundPlane( origin, rot); 00030 }