#include <RodPlaneBuilderFromDet.h>
Public Types | |
typedef GeomDet | Det |
Public Member Functions | |
std::pair < RectangularPlaneBounds *, GlobalVector > | computeBounds (const std::vector< const Det * > &dets, const Plane &plane) const |
Surface::RotationType | computeRotation (const std::vector< const Det * > &dets, const Surface::PositionType &meanPos) const |
Plane * | operator() (const std::vector< const Det * > &dets) const |
Builds the minimal rectangular box that contains all input Dets fully.
Definition at line 15 of file RodPlaneBuilderFromDet.h.
typedef GeomDet RodPlaneBuilderFromDet::Det |
Definition at line 17 of file RodPlaneBuilderFromDet.h.
std::pair<RectangularPlaneBounds*, GlobalVector> RodPlaneBuilderFromDet::computeBounds | ( | const std::vector< const Det * > & | dets, |
const Plane & | plane | ||
) | const |
Surface::RotationType RodPlaneBuilderFromDet::computeRotation | ( | const std::vector< const Det * > & | dets, |
const Surface::PositionType & | meanPos | ||
) | const |
Definition at line 110 of file BladeShapeBuilderFromDet.cc.
References Vector3DBase< T, FrameTag >::cross(), GloballyPositioned< T >::position(), Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
{ const Plane& plane = dets.front()->surface(); GlobalVector xAxis; GlobalVector yAxis; GlobalVector zAxis; GlobalVector planeXAxis = plane.toGlobal( LocalVector( 1, 0, 0)); GlobalPoint planePosition = plane.position(); if(planePosition.x()*planeXAxis.x()+planePosition.y()*planeXAxis.y() > 0.){ yAxis = planeXAxis; }else{ yAxis = -planeXAxis; } GlobalVector planeZAxis = plane.toGlobal( LocalVector( 0, 0, 1)); if(planeZAxis.z()*planePosition.z() > 0.){ zAxis = planeZAxis; }else{ zAxis = -planeZAxis; } xAxis = yAxis.cross( zAxis); return Surface::RotationType( xAxis, yAxis); }
Warning, remember to assign this pointer to a ReferenceCountingPointer! Should be changed to return a ReferenceCountingPointer<Plane>