CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions | Static Private Member Functions

IdealObliquePrism Class Reference

#include <IdealObliquePrism.h>

Inheritance diagram for IdealObliquePrism:
CaloCellGeometry

List of all members.

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
typedef CaloCellGeometry::Pt3D Pt3D
typedef CaloCellGeometry::Pt3DVec Pt3DVec

Public Member Functions

CCGFloat dEta () const
CCGFloat dPhi () const
CCGFloat dz () const
CCGFloat eta () const
virtual const CornersVecgetCorners () const
 Returns the corner points of this cell's volume.
 IdealObliquePrism (const GlobalPoint &faceCenter, const CornersMgr *mgr, const CCGFloat *parm)
 IdealObliquePrism (const IdealObliquePrism &idop)
 IdealObliquePrism ()
IdealObliquePrismoperator= (const IdealObliquePrism &idop)
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
CCGFloat z () const
virtual ~IdealObliquePrism ()

Static Public Member Functions

static void localCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)

Static Private Member Functions

static GlobalPoint etaPhiPerp (float eta, float phi, float perp)
static GlobalPoint etaPhiZ (float eta, float phi, float z)

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:
2011/09/27 09:10:38
Revision:
1.11
Author:
J. Mans - Minnesota

Definition at line 30 of file IdealObliquePrism.h.


Member Typedef Documentation

Reimplemented from CaloCellGeometry.

Definition at line 34 of file IdealObliquePrism.h.

Reimplemented from CaloCellGeometry.

Definition at line 35 of file IdealObliquePrism.h.

Reimplemented from CaloCellGeometry.

Definition at line 36 of file IdealObliquePrism.h.


Constructor & Destructor Documentation

IdealObliquePrism::IdealObliquePrism ( )

Definition at line 8 of file IdealObliquePrism.cc.

IdealObliquePrism::IdealObliquePrism ( const IdealObliquePrism idop)

Definition at line 12 of file IdealObliquePrism.cc.

  : CaloCellGeometry( idop )
{
  *this = idop ;
}
IdealObliquePrism::IdealObliquePrism ( const GlobalPoint faceCenter,
const CornersMgr mgr,
const CCGFloat parm 
)

Definition at line 25 of file IdealObliquePrism.cc.

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

Definition at line 31 of file IdealObliquePrism.cc.

{}

Member Function Documentation

CCGFloat IdealObliquePrism::dEta ( ) const

Definition at line 35 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

{
   return param()[0] ;
}
CCGFloat IdealObliquePrism::dPhi ( ) const

Definition at line 41 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

{ 
   return param()[1] ;
}
CCGFloat IdealObliquePrism::dz ( ) const

Definition at line 47 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

{
   return param()[2] ;
}
CCGFloat IdealObliquePrism::eta ( void  ) const

Definition at line 53 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by getCorners(), and localCorners().

{
   return param()[3] ; 
}
GlobalPoint IdealObliquePrism::etaPhiPerp ( float  eta,
float  phi,
float  perp 
) [static, private]

Definition at line 82 of file IdealObliquePrism.cc.

Referenced by getCorners(), and localCorners().

{
   return GlobalPoint( perp*cosf(phi) ,
                       perp*sinf(phi) ,
                       perp*sinhf(eta) ) ;
}
GlobalPoint IdealObliquePrism::etaPhiZ ( float  eta,
float  phi,
float  z 
) [static, private]

Definition at line 90 of file IdealObliquePrism.cc.

Referenced by getCorners(), and localCorners().

{
   return GlobalPoint( z*cosf(phi)/sinhf(eta) , 
                       z*sinf(phi)/sinhf(eta) ,
                       z                       ) ;
}
const CaloCellGeometry::CornersVec & IdealObliquePrism::getCorners ( ) const [virtual]

Returns the corner points of this cell's volume.

Implements CaloCellGeometry.

Definition at line 149 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), PV3DBase< T, PVType, FrameType >::eta(), eta(), etaPhiPerp(), etaPhiZ(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), AlCaHLTBitMon_ParallelJobs::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 CCGFloat    r_near ( p.perp()/cos(dPhi()) ) ;
         const CCGFloat    r_far  ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
         const CCGFloat    eta    ( p.eta() ) ;
         const CCGFloat    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 CCGFloat    z_near ( p.z() ) ;
         const CCGFloat    mag    ( p.mag() ) ;
         const CCGFloat    z_far  ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
         const CCGFloat    eta    ( p.eta() ) ;
         const CCGFloat    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 ;
}
void IdealObliquePrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) [static]

Definition at line 97 of file IdealObliquePrism.cc.

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

Referenced by vocalCorners().

{
   assert( 8 == lc.size() ) ;
   assert( 0 != pv ) ;
   
   const CCGFloat dEta ( pv[0] ) ;
   const CCGFloat dPhi ( pv[1] ) ;
   const CCGFloat dz   ( pv[2] ) ;
   const CCGFloat eta  ( pv[3] ) ;
   const CCGFloat z    ( pv[4] ) ;
   
   std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;

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

   if( 0 < dz )
   {
      const CCGFloat r_near ( p.perp()/cos( dPhi ) ) ;
      const CCGFloat 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 CCGFloat z_near ( z ) ;
      const CCGFloat 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] = Pt3D( gc[i].x(), gc[i].y(), gc[i].z() ) ;
   }
   
   ref   = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
}
IdealObliquePrism & IdealObliquePrism::operator= ( const IdealObliquePrism idop)

Definition at line 19 of file IdealObliquePrism.cc.

{
  if( &idop != this ) CaloCellGeometry::operator=( idop ) ;
  return *this ;
}
void IdealObliquePrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const [virtual]

Implements CaloCellGeometry.

Definition at line 65 of file IdealObliquePrism.cc.

References localCorners().

{ 
   localCorners( vec, pv, ref ) ; 
}
CCGFloat IdealObliquePrism::z ( ) const

Definition at line 59 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by localCorners().

{
   return param()[4] ;
}