CMS 3D CMS Logo

PerpendicularBoundPlaneBuilder.cc
Go to the documentation of this file.
1 //#include "Utilities/Configuration/interface/Architecture.h"
2 
4 
6  const Surface::GlobalVector& perp) const {
7  // z axis coincides with perp
8  GlobalVector zAxis = perp.unit();
9 
10  // x axis has no global Z component
12  if (zAxis.x() != 0 || zAxis.y() != 0) {
13  // precision is not an issue here, just protect against divizion by zero
14  xAxis = GlobalVector(-zAxis.y(), zAxis.x(), 0).unit();
15  } else { // perp coincides with global Z
16  xAxis = GlobalVector(1, 0, 0);
17  }
18 
19  // y axis obtained by cross product
20  GlobalVector yAxis(zAxis.cross(xAxis));
21 
23  xAxis.x(), xAxis.y(), xAxis.z(), yAxis.x(), yAxis.y(), yAxis.z(), zAxis.x(), zAxis.y(), zAxis.z());
24 
25  return new BoundPlane(origin, rot);
26 }
Plane BoundPlane
Definition: Plane.h:94
Vector3DBase< float, GlobalTag > GlobalVector
BoundPlane * operator()(const Surface::GlobalPoint &origin, const Surface::GlobalVector &perp) const
T perp() const
Magnitude of transverse component.
Basic3DVector unit() const
Point3DBase< float, GlobalTag > GlobalPoint
Global3DVector GlobalVector
Definition: GlobalVector.h:10