CMS 3D CMS Logo

calogeom::IdealCastorTrapezoid Class Reference

Trapezoid class used for CASTOR volumes. More...

#include <Geometry/ForwardGeometry/interface/IdealCastorTrapezoid.h>

Inheritance diagram for calogeom::IdealCastorTrapezoid:

CaloCellGeometry

List of all members.

Public Member Functions

const float an () const
const float dx () const
const float dy () const
const float dz () const
virtual const CornersVecgetCorners () const
 IdealCastorTrapezoid (const GlobalPoint &faceCenter, const CornersMgr *mgr, const float *parm)
virtual bool inside (const GlobalPoint &point) const
virtual ~IdealCastorTrapezoid ()

Private Member Functions

const float * param () const

Private Attributes

const float * m_parms


Detailed Description

Trapezoid class used for CASTOR volumes.

Required parameters for an ideal trapezoid:

Total: 7 parameters

Date
2007/10/08 20:54:40
Revision
1.1
Author:
P. Katsas - UoA

Definition at line 23 of file IdealCastorTrapezoid.h.


Constructor & Destructor Documentation

calogeom::IdealCastorTrapezoid::IdealCastorTrapezoid ( const GlobalPoint faceCenter,
const CornersMgr mgr,
const float *  parm 
) [inline]

Definition at line 27 of file IdealCastorTrapezoid.h.

00029                                                              :  
00030             CaloCellGeometry ( faceCenter, mgr ) ,
00031             m_parms          ( parm )                   {}

virtual calogeom::IdealCastorTrapezoid::~IdealCastorTrapezoid (  )  [inline, virtual]

Definition at line 33 of file IdealCastorTrapezoid.h.

00033 {}


Member Function Documentation

const float calogeom::IdealCastorTrapezoid::an (  )  const [inline]

Definition at line 39 of file IdealCastorTrapezoid.h.

References param().

Referenced by getCorners(), inside(), and calogeom::operator<<().

00039 { return param()[0] ; }

const float calogeom::IdealCastorTrapezoid::dx (  )  const [inline]

Definition at line 40 of file IdealCastorTrapezoid.h.

References param().

Referenced by getCorners(), inside(), and calogeom::operator<<().

00040 { return param()[1] ; }

const float calogeom::IdealCastorTrapezoid::dy (  )  const [inline]

Definition at line 41 of file IdealCastorTrapezoid.h.

References param().

Referenced by getCorners(), inside(), and calogeom::operator<<().

00041 { return param()[2] ; }

const float calogeom::IdealCastorTrapezoid::dz (  )  const [inline]

Definition at line 42 of file IdealCastorTrapezoid.h.

References param().

Referenced by getCorners(), inside(), and calogeom::operator<<().

00042 { return param()[3] ; }

const CaloCellGeometry::CornersVec & calogeom::IdealCastorTrapezoid::getCorners (  )  const [virtual]

Implements CaloCellGeometry.

Definition at line 7 of file IdealCastorTrapezoid.cc.

References an(), funct::cos(), dx(), dy(), dz(), EZArrayFL< T >::empty(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), p, CaloCellGeometry::setCorners(), funct::sin(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00008    {
00009       const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
00010       if( co.empty() ) 
00011       {
00012          CaloCellGeometry::CornersVec& corners ( setCorners() ) ;
00013          const GlobalPoint& p ( getPosition() ) ;
00014          const float zz   ( p.z() ) ;
00015          const float yy   ( p.y() ) ;
00016          const float cdy  ( cos( an() )*dy()/2. ) ;
00017          const float sdy  ( sin( an() )*dy()/2. ) ;
00018          const float sign ( zz<0 ? 1 : -1 ) ;
00019          const float z1   ( zz + sign*cdy ) ;
00020          const float z2   ( zz - sign*cdy ) ;
00021          const float z3   ( z1 + dz() ) ;
00022          const float z4   ( z2 + dz() ) ;
00023          const float x1   (  dx()/2 );
00024          const float x2   ( -dx()/2 );
00025          const float y1   ( yy + sdy ) ;
00026          const float y2   ( yy - sdy ) ;
00027          corners[ 0 ] = GlobalPoint( x1, y1, z1 ) ; 
00028          corners[ 1 ] = GlobalPoint( x2, y1, z1 ) ;
00029          corners[ 2 ] = GlobalPoint( x2, y2, z2 ) ;
00030          corners[ 3 ] = GlobalPoint( x1, y2, z2 ) ;
00031          corners[ 4 ] = GlobalPoint( x1, y1, z3 ) ;
00032          corners[ 5 ] = GlobalPoint( x2, y1, z3 ) ;
00033          corners[ 6 ] = GlobalPoint( x2, y2, z4 ) ;
00034          corners[ 7 ] = GlobalPoint( x1, y2, z4 ) ;
00035       }
00036       return co ;
00037    }

bool calogeom::IdealCastorTrapezoid::inside ( const GlobalPoint point  )  const [virtual]

Implements CaloCellGeometry.

Definition at line 40 of file IdealCastorTrapezoid.cc.

References an(), dx(), dy(), dz(), CaloCellGeometry::getPosition(), funct::sin(), sl, funct::tan(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00041    {
00042       bool is_inside ( false ) ;
00043 
00044       const GlobalPoint& face ( getPosition() ) ;
00045 
00046       if( fabs( point.x() - face.x() ) <= dx()/2   &&
00047           fabs( point.y() - face.y() ) <= sin( an() )*dy()/2 )
00048       {
00049          const float sl   ( tan( an() ) ) ;
00050          const float blow ( face.y() - sl*face.z() ) ;
00051 
00052          const float sign ( 0 < point.z() ? 1 : -1 ) ;
00053          const float bhigh ( face.y() - sl*sign*( face.z() + sign*dz() ) ) ;
00054 
00055          is_inside = ( ( point.z() >  sign*( point.y() - blow  )/sl )  &&
00056                        ( point.z() <= sign*( point.y() - bhigh )/sl )     ) ;
00057       }
00058       return is_inside;
00059    }

const float* calogeom::IdealCastorTrapezoid::param (  )  const [inline, private]

Definition at line 46 of file IdealCastorTrapezoid.h.

References m_parms.

Referenced by an(), dx(), dy(), and dz().

00046 { return m_parms ; }


Member Data Documentation

const float* calogeom::IdealCastorTrapezoid::m_parms [private]

Definition at line 48 of file IdealCastorTrapezoid.h.

Referenced by param().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:36:17 2009 for CMSSW by  doxygen 1.5.4