CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

calogeom::IdealObliquePrism Class Reference

#include <IdealObliquePrism.h>

Inheritance diagram for calogeom::IdealObliquePrism:
CaloCellGeometry

List of all members.

Public Member Functions

double dEta () const
double dPhi () const
double dz () const
double eta () const
virtual const CornersVecgetCorners () const
 IdealObliquePrism (const GlobalPoint &faceCenter, const CornersMgr *mgr, const double *parm)
virtual std::vector
< HepGeom::Point3D< double > > 
vocalCorners (const double *pv, HepGeom::Point3D< double > &ref) const
double z () const
virtual ~IdealObliquePrism ()

Static Public Member Functions

static std::vector
< HepGeom::Point3D< double > > 
localCorners (const double *pv, HepGeom::Point3D< double > &ref)

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:
2010/04/20 17:23:11
Revision:
1.9
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 double *  parm 
) [inline]

Definition at line 35 of file IdealObliquePrism.h.

                                                            : 
            CaloCellGeometry ( faceCenter, mgr, parm ) {}
virtual calogeom::IdealObliquePrism::~IdealObliquePrism ( ) [inline, virtual]

Definition at line 40 of file IdealObliquePrism.h.

{}

Member Function Documentation

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

Definition at line 44 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

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

{ return param()[0] ; }
double calogeom::IdealObliquePrism::dPhi ( ) const [inline]

Definition at line 45 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

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

{ return param()[1] ; }
double calogeom::IdealObliquePrism::dz ( ) const [inline]

Definition at line 46 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

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

{ return param()[2] ; }
double calogeom::IdealObliquePrism::eta ( void  ) const [inline]

Definition at line 47 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by getCorners(), and localCorners().

{ return param()[3] ; }
const CaloCellGeometry::CornersVec & calogeom::IdealObliquePrism::getCorners ( ) const [virtual]

Implements CaloCellGeometry.

Definition at line 83 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(), mag(), L1TEmulatorMonitor_cff::p, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), phi, CaloCellGeometry::setCorners(), EZArrayFL< T >::uninitialized(), and PV3DBase< T, PVType, FrameType >::z().

   {
      const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
      if( co.uninitialized() )
      {
         CornersVec& corners ( setCorners() ) ;
         if( dz()>0 ) 
         { 
            /* In this case, the faces are parallel to the zaxis.  
               This implies that all corners will have the same 
               cylindrical radius. 
            */
            const GlobalPoint p      ( getPosition() ) ;
            const float       r_near ( p.perp()/cos(dPhi()) ) ;
            const float       r_far  ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
            const float       eta    ( p.eta() ) ;
            const float       phi    ( p.phi() ) ;
            corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
            corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
            corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
            corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
            corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
            corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
            corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
            corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
         } 
         else 
         {
            /* In this case, the faces are perpendicular to the zaxis.  
               This implies that all corners will have the same 
               z-dimension. 
            */
            const GlobalPoint p      ( getPosition() ) ;
            const float       z_near ( p.z() ) ;
            const float       mag    ( p.mag() ) ;
            const float       z_far  ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
            const float       eta    ( p.eta() ) ;
            const float       phi    ( p.phi() ) ;
            
            corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ) ; // (+,+,near)
            corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ) ; // (+,-,near)
            corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ) ; // (-,-,near)
            corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ) ; // (-,+,near)
            corners[ 4 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_far  ) ; // (+,+,far)
            corners[ 5 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_far  ) ; // (+,-,far)
            corners[ 6 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_far  ) ; // (-,-,far)
            corners[ 7 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_far  ) ; // (-,+,far)

         }
      }
      return co ;
   }
std::vector< HepGeom::Point3D< double > > calogeom::IdealObliquePrism::localCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
) [static]

Definition at line 31 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta(), calogeom::etaPhiPerp(), calogeom::etaPhiZ(), i, PV3DBase< T, PVType, FrameType >::mag(), L1TEmulatorMonitor_cff::p, PV3DBase< T, PVType, FrameType >::perp(), and z().

Referenced by CaloTowerGeometry::localCorners(), HcalGeometry::localCorners(), and vocalCorners().

   {
      assert( 0 != pv ) ;

      const double dEta ( pv[0] ) ;
      const double dPhi ( pv[1] ) ;
      const double dz   ( pv[2] ) ;
      const double eta  ( pv[3] ) ;
      const double z    ( pv[4] ) ;

      std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
      std::vector<HepGeom::Point3D<double> >  lc ( 8, HepGeom::Point3D<double> ( 0,0,0) ) ;

      const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;

      if( 0 < dz )
      {
         const float r_near ( p.perp()/cos( dPhi ) ) ;
         const float r_far  ( r_near*( ( p.mag() + 2*dz )/p.mag() ) ) ;
         gc[ 0 ] = etaPhiPerp( eta + dEta , +dPhi , r_near ) ; // (+,+,near)
         gc[ 1 ] = etaPhiPerp( eta + dEta , -dPhi , r_near ) ; // (+,-,near)
         gc[ 2 ] = etaPhiPerp( eta - dEta , -dPhi , r_near ) ; // (-,-,near)
         gc[ 3 ] = etaPhiPerp( eta - dEta , +dPhi , r_near ) ; // (-,+,far)
         gc[ 4 ] = etaPhiPerp( eta + dEta , +dPhi , r_far  ) ; // (+,+,far)
         gc[ 5 ] = etaPhiPerp( eta + dEta , -dPhi , r_far  ) ; // (+,-,far)
         gc[ 6 ] = etaPhiPerp( eta - dEta , -dPhi , r_far  ) ; // (-,-,far)
         gc[ 7 ] = etaPhiPerp( eta - dEta , +dPhi , r_far  ) ; // (-,+,far)
      }
      else
      {
         const float z_near ( z ) ;
         const float z_far  ( z*( 1 - 2*dz/p.mag() ) ) ;
         gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
         gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
         gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
         gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,far)
         gc[ 4 ] = etaPhiZ( eta + dEta , +dPhi , z_far  ) ; // (+,+,far)
         gc[ 5 ] = etaPhiZ( eta + dEta , -dPhi , z_far  ) ; // (+,-,far)
         gc[ 6 ] = etaPhiZ( eta - dEta , -dPhi , z_far  ) ; // (-,-,far)
         gc[ 7 ] = etaPhiZ( eta - dEta , +dPhi , z_far  ) ; // (-,+,far)
      }
      for( unsigned int i ( 0 ) ; i != 8 ; ++i )
      {
         lc[i] = HepGeom::Point3D<double> ( gc[i].x(), gc[i].y(), gc[i].z() ) ;
      }

      ref   = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
      return lc ;
   }
virtual std::vector<HepGeom::Point3D<double> > calogeom::IdealObliquePrism::vocalCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
) const [inline, virtual]

Implements CaloCellGeometry.

Definition at line 53 of file IdealObliquePrism.h.

References localCorners().

         { return localCorners( pv, ref ) ; }
double calogeom::IdealObliquePrism::z ( ) const [inline]

Definition at line 48 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by localCorners().

{ return param()[4] ; }