CMS 3D CMS Logo

calogeom::IdealObliquePrism Class Reference

Oblique prism class used for HCAL (HB, HE, HO) volumes. More...

#include <Geometry/CaloGeometry/interface/IdealObliquePrism.h>

Inheritance diagram for calogeom::IdealObliquePrism:

CaloCellGeometry

List of all members.

Public Member Functions

float dEta () const
float dPhi () const
float dz () const
virtual const CornersVecgetCorners () const
 IdealObliquePrism (const GlobalPoint &faceCenter, const CornersMgr *mgr, const float *parm)
virtual bool inside (const GlobalPoint &point) const
virtual ~IdealObliquePrism ()

Private Member Functions

const float * param () const

Private Attributes

const float * m_parms


Detailed Description

Oblique prism class used for HCAL (HB, HE, HO) volumes.

Required parameters for an ideal oblique prism:

Total: 6+1 parameters

Internally, the "point of reference" is the center (eta/phi) of the front face of the prism. Therefore, the only internally stored parameters are eta and phi widths, the axis tower thickness, and the parallel/perpendicular setting. The parallel/perpendicular setting is encoded in the sign of the thickness. (positive = parallel to z-axis, negative = perpendicular)

Date
2007/10/21 16:07:34
Revision
1.5
Author:
J. Mans - Minnesota

Definition at line 31 of file IdealObliquePrism.h.


Constructor & Destructor Documentation

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

Definition at line 35 of file IdealObliquePrism.h.

00037                                                             : 
00038             CaloCellGeometry ( faceCenter, mgr ) ,
00039             m_parms          ( parm )               {}

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

Definition at line 41 of file IdealObliquePrism.h.

00041 {}


Member Function Documentation

float calogeom::IdealObliquePrism::dEta (  )  const [inline]

Definition at line 47 of file IdealObliquePrism.h.

References param().

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

00047 { return param()[0] ; }

float calogeom::IdealObliquePrism::dPhi (  )  const [inline]

Definition at line 48 of file IdealObliquePrism.h.

References param().

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

00048 { return param()[1] ; }

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

Definition at line 49 of file IdealObliquePrism.h.

References param().

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

00049 { return param()[2] ; }

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

Implements CaloCellGeometry.

Definition at line 28 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta, PV3DBase< T, PVType, FrameType >::eta(), calogeom::etaPhiPerp(), calogeom::etaPhiZ(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::mag(), muonGeometry::mag(), p, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, CaloCellGeometry::setCorners(), EZArrayFL< T >::uninitialized(), and PV3DBase< T, PVType, FrameType >::z().

00029    {
00030       const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
00031       if( co.uninitialized() )
00032       {
00033          CornersVec& corners ( setCorners() ) ;
00034          if( dz()>0 ) 
00035          { 
00036             /* In this case, the faces are parallel to the zaxis.  
00037                This implies that all corners will have the same 
00038                cylindrical radius. 
00039             */
00040             const GlobalPoint p      ( getPosition() ) ;
00041             const float       r_near ( p.perp()/cos(dPhi()) ) ;
00042             const float       r_far  ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
00043             const float       eta    ( p.eta() ) ;
00044             const float       phi    ( p.phi() ) ;
00045             corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
00046             corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
00047             corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
00048             corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
00049             corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
00050             corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
00051             corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
00052             corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
00053          } 
00054          else 
00055          {
00056             /* In this case, the faces are perpendicular to the zaxis.  
00057                This implies that all corners will have the same 
00058                z-dimension. 
00059             */
00060             const GlobalPoint p      ( getPosition() ) ;
00061             const float       z_near ( p.z() ) ;
00062             const float       mag    ( p.mag() ) ;
00063             const float       z_far  ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
00064             const float       eta    ( p.eta() ) ;
00065             const float       phi    ( p.phi() ) ;
00066             
00067             corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ) ; // (+,+,near)
00068             corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ) ; // (+,-,near)
00069             corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ) ; // (-,-,near)
00070             corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ) ; // (-,+,near)
00071             corners[ 4 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_far  ) ; // (+,+,far)
00072             corners[ 5 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_far  ) ; // (+,-,far)
00073             corners[ 6 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_far  ) ; // (-,-,far)
00074             corners[ 7 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_far  ) ; // (-,+,far)
00075 
00076          }
00077       }
00078       return co ;
00079    }

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

Implements CaloCellGeometry.

Definition at line 82 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), PV3DBase< T, PVType, FrameType >::eta(), calogeom::etaPhiR(), CaloCellGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::mag(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), and PV3DBase< T, PVType, FrameType >::z().

00083    {
00084       // first check eta/phi
00085       bool is_inside ( false ) ;
00086 
00087       const GlobalPoint& face ( getPosition() ) ;
00088 
00089       // eta
00090       if( fabs( point.eta() - face.eta() ) <= dEta()  &&
00091           fabs( point.phi() - face.phi() ) <= dPhi()     )
00092       {
00093          // distance (trickier)
00094          GlobalPoint face2 ( etaPhiR( face.eta(), 
00095                                       face.phi(), 
00096                                       face.mag() + 2*fabs( dz() ) ) );
00097          if( dz() > 0 ) 
00098          { // 
00099             const float projection ( point.perp()*cos( point.phi() - face.phi() ) ) ;
00100             is_inside = ( projection >= face.perp() &&
00101                           projection <= face2.perp()    ) ;
00102          } 
00103          else 
00104          { // here, it is just a Z test.
00105             is_inside = ( ( ( face.z()<0 ) ? ( point.z()<=face.z()  ) :
00106                             ( point.z()>=face.z()  ) ) && // "front" face
00107                           ( ( face.z()<0 ) ? ( point.z()>=face2.z() ) :
00108                             ( point.z()<=face2.z() ) ) ); // "back" face
00109          }
00110       }
00111       return is_inside;
00112    }

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

Definition at line 53 of file IdealObliquePrism.h.

References m_parms.

Referenced by dEta(), dPhi(), and dz().

00053 { return m_parms ; }


Member Data Documentation

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

Definition at line 55 of file IdealObliquePrism.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