CMS 3D CMS Logo

Public Types | Public Member Functions

RodPlaneBuilderFromDet Class Reference

#include <RodPlaneBuilderFromDet.h>

List of all members.

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
Planeoperator() (const std::vector< const Det * > &dets) const

Detailed Description

Builds the minimal rectangular box that contains all input Dets fully.

Definition at line 15 of file RodPlaneBuilderFromDet.h.


Member Typedef Documentation

Definition at line 17 of file RodPlaneBuilderFromDet.h.


Member Function Documentation

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);
}
Plane* RodPlaneBuilderFromDet::operator() ( const std::vector< const Det * > &  dets) const

Warning, remember to assign this pointer to a ReferenceCountingPointer! Should be changed to return a ReferenceCountingPointer<Plane>