CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

CylinderBuilderFromDet Class Reference

#include <CylinderBuilderFromDet.h>

List of all members.

Public Types

typedef GeomDet Det
typedef Surface::PositionType PositionType
typedef Surface::RotationType RotationType
typedef
PositionType::BasicVectorType 
Vector

Public Member Functions

BoundCylinderbuild () const
 CylinderBuilderFromDet ()
void operator() (const Det &det)
BoundCylinderoperator() (std::vector< const Det * >::const_iterator first, std::vector< const Det * >::const_iterator last) const

Private Attributes

float rmax
float rmin
float zmax
float zmin

Detailed Description

Given a container of GeomDets, constructs a cylinder of minimal dimensions that contains all of the Dets completely (all corners etc.) Useful for defining a BarrelDetLayer from a group of DetUnits.

Date:
2007/08/22 16:07:44
Revision:
1.4

Definition at line 20 of file CylinderBuilderFromDet.h.


Member Typedef Documentation

Definition at line 22 of file CylinderBuilderFromDet.h.

Definition at line 23 of file CylinderBuilderFromDet.h.

Definition at line 24 of file CylinderBuilderFromDet.h.

Definition at line 25 of file CylinderBuilderFromDet.h.


Constructor & Destructor Documentation

CylinderBuilderFromDet::CylinderBuilderFromDet ( ) [inline]

Member Function Documentation

BoundCylinder * CylinderBuilderFromDet::build ( ) const

Definition at line 83 of file CylinderBuilderFromDet.cc.

References pos, makeMuonMisalignmentScenario::rot, and PV3DBase< T, PVType, FrameType >::z().

                                                   {
  
  PositionType pos( 0, 0, 0.5*(zmin+zmax));
  RotationType rot;      // only "barrel" orientation supported
  
  return new BoundCylinder( pos, rot, 
                            SimpleCylinderBounds( rmin, rmax, 
                                                  zmin-pos.z(), zmax-pos.z()));
}
BoundCylinder* CylinderBuilderFromDet::operator() ( std::vector< const Det * >::const_iterator  first,
std::vector< const Det * >::const_iterator  last 
) const
void CylinderBuilderFromDet::operator() ( const Det det)

Definition at line 64 of file CylinderBuilderFromDet.cc.

References BoundSurface::bounds(), max(), min, PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), GeomDet::surface(), and Bounds::thickness().

                                                      {
  BoundingBox bb( dynamic_cast<const BoundPlane&>(det.surface()));
  for (int nc=0; nc<8; ++nc) {
    float r = bb[nc].perp();
    float z = bb[nc].z();
    rmin = std::min( rmin, r);
    rmax = std::max( rmax, r);
    zmin = std::min( zmin, z);
    zmax = std::max( zmax, z);
  }
  // in addition to the corners we have to check the middle of the 
  // det +/- thickness/2
  // , since the min  radius for some barrel dets is reached there
  float rdet = det.surface().position().perp();
  float halfThick = det.surface().bounds().thickness() / 2.F;
  rmin = std::min( rmin, rdet-halfThick);
  rmax = std::max( rmax, rdet+halfThick);
}

Member Data Documentation

Definition at line 42 of file CylinderBuilderFromDet.h.

Definition at line 41 of file CylinderBuilderFromDet.h.

Definition at line 44 of file CylinderBuilderFromDet.h.

Definition at line 43 of file CylinderBuilderFromDet.h.