CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PerpendicularBoundPlaneBuilder Class Reference

#include <PerpendicularBoundPlaneBuilder.h>

Public Member Functions

BoundPlaneoperator() (const Surface::GlobalPoint &origin, const Surface::GlobalVector &perp) const
 

Detailed Description

Constructs a plane perpendicular to an axis, and oriented in a special way. Must be updated for reference counting.

Definition at line 11 of file PerpendicularBoundPlaneBuilder.h.

Member Function Documentation

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(), makeMuonMisalignmentScenario::rot, csvLumiCalc::unit, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and MetAnalyzer::zAxis.

8 {
9  // z axis coincides with perp
10  GlobalVector zAxis = perp.unit();
11 
12  // x axis has no global Z component
13  GlobalVector xAxis;
14  if ( zAxis.x() != 0 || zAxis.y() != 0) {
15  // precision is not an issue here, just protect against divizion by zero
16  xAxis = GlobalVector( -zAxis.y(), zAxis.x(), 0).unit();
17  }
18  else { // perp coincides with global Z
19  xAxis = GlobalVector( 1, 0, 0);
20  }
21 
22  // y axis obtained by cross product
23  GlobalVector yAxis( zAxis.cross( xAxis));
24 
25  Surface::RotationType rot( xAxis.x(), xAxis.y(), xAxis.z(),
26  yAxis.x(), yAxis.y(), yAxis.z(),
27  zAxis.x(), zAxis.y(), zAxis.z());
28 
29  return new BoundPlane( origin, rot);
30 }
T y() const
Definition: PV3DBase.h:63
string unit
Definition: csvLumiCalc.py:46
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
T z() const
Definition: PV3DBase.h:64
Vector3DBase unit() const
Definition: Vector3DBase.h:57
tuple zAxis
Definition: MetAnalyzer.py:56
T x() const
Definition: PV3DBase.h:62
Global3DVector GlobalVector
Definition: GlobalVector.h:10