File indexing completed on 2023-03-17 10:49:55
0001
0002
0003 #include "DataFormats/GeometryCommonDetAlgo/interface/PerpendicularBoundPlaneBuilder.h"
0004
0005 BoundPlane* PerpendicularBoundPlaneBuilder::operator()(const Surface::GlobalPoint& origin,
0006 const Surface::GlobalVector& perp) const {
0007
0008 GlobalVector zAxis = perp.unit();
0009
0010
0011 GlobalVector xAxis;
0012 if (zAxis.x() != 0 || zAxis.y() != 0) {
0013
0014 xAxis = GlobalVector(-zAxis.y(), zAxis.x(), 0).unit();
0015 } else {
0016 xAxis = GlobalVector(1, 0, 0);
0017 }
0018
0019
0020 GlobalVector yAxis(zAxis.cross(xAxis));
0021
0022 Surface::RotationType rot(
0023 xAxis.x(), xAxis.y(), xAxis.z(), yAxis.x(), yAxis.y(), yAxis.z(), zAxis.x(), zAxis.y(), zAxis.z());
0024
0025 return new BoundPlane(origin, rot);
0026 }