CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions

PreshowerStrip Class Reference

A base class to handle the shape of preshower strips. More...

#include <PreshowerStrip.h>

Inheritance diagram for PreshowerStrip:
CaloCellGeometry

List of all members.

Public Types

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

Public Member Functions

const CCGFloat dx () const
const CCGFloat dy () const
const CCGFloat dz () const
virtual const CornersVecgetCorners () const
virtual Tr3D getTransform (Pt3DVec *lptr) const
PreshowerStripoperator= (const PreshowerStrip &tr)
 PreshowerStrip ()
 PreshowerStrip (const GlobalPoint &po, const CornersMgr *mgr, const CCGFloat *parm)
 PreshowerStrip (const PreshowerStrip &tr)
const CCGFloat tilt () const
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
virtual ~PreshowerStrip ()

Static Public Member Functions

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

Detailed Description

A base class to handle the shape of preshower strips.

Date:
2011/05/30 16:40:35
Revision:
1.12
Author:
F. Cossutti

Definition at line 25 of file PreshowerStrip.h.


Member Typedef Documentation

Reimplemented from CaloCellGeometry.

Definition at line 29 of file PreshowerStrip.h.

Reimplemented from CaloCellGeometry.

Definition at line 30 of file PreshowerStrip.h.

Reimplemented from CaloCellGeometry.

Definition at line 31 of file PreshowerStrip.h.

Reimplemented from CaloCellGeometry.

Definition at line 32 of file PreshowerStrip.h.


Constructor & Destructor Documentation

PreshowerStrip::PreshowerStrip ( )

Definition at line 10 of file PreshowerStrip.cc.

PreshowerStrip::PreshowerStrip ( const PreshowerStrip tr)

Definition at line 15 of file PreshowerStrip.cc.

{
   *this = tr ; 
}
PreshowerStrip::PreshowerStrip ( const GlobalPoint po,
const CornersMgr mgr,
const CCGFloat parm 
) [inline]

Definition at line 40 of file PreshowerStrip.h.

                                                 :
         CaloCellGeometry ( po , mgr, parm ) {}
virtual PreshowerStrip::~PreshowerStrip ( ) [inline, virtual]

Definition at line 45 of file PreshowerStrip.h.

{}

Member Function Documentation

const CCGFloat PreshowerStrip::dx ( ) const [inline]

Definition at line 49 of file PreshowerStrip.h.

References CaloCellGeometry::param().

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

{ return param()[0] ; }
const CCGFloat PreshowerStrip::dy ( ) const [inline]

Definition at line 50 of file PreshowerStrip.h.

References CaloCellGeometry::param().

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

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

Definition at line 51 of file PreshowerStrip.h.

References CaloCellGeometry::param().

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

{ return param()[2] ; }
const CaloCellGeometry::CornersVec & PreshowerStrip::getCorners ( ) const [virtual]

Implements CaloCellGeometry.

Definition at line 31 of file PreshowerStrip.cc.

References funct::cos(), dx(), dy(), dz(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), i, CaloCellGeometry::setCorners(), funct::sin(), tilt(), EZArrayFL< T >::uninitialized(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::y, PV3DBase< T, PVType, FrameType >::z(), and z.

{
   const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
   if( co.uninitialized() ) 
   {
      CornersVec& corners ( setCorners() ) ;

      const GlobalPoint& ctr ( getPosition() ) ;
      const CCGFloat x ( ctr.x() ) ;
      const CCGFloat y ( ctr.y() ) ;
      const CCGFloat z ( ctr.z() ) ;

      const double st ( sin(tilt()) ) ;
      const double ct ( cos(tilt()) ) ;

      for( unsigned int ix ( 0 ) ; ix !=2 ; ++ix )
      {
         const double sx ( 0 == ix ? -1.0 : +1.0 ) ;
         for( unsigned int iy ( 0 ) ; iy !=2 ; ++iy )
         {
            const double sy ( 0 == iy ? -1.0 : +1.0 ) ;
            for( unsigned int iz ( 0 ) ; iz !=2 ; ++iz )
            {
               const double sz ( 0 == iz ? -1.0 : +1.0 ) ;
               const unsigned int  i ( 4*iz + 2*ix + 
                                       ( 1 == ix ? 1-iy : iy ) ) ;//keeps ordering same as before

               corners[ i ] = GlobalPoint( 
                  dy()>dx() ? 
                  x + sx*dx() : 
                  x + sx*dx()*ct - sz*dz()*st ,
                  dy()<dx() ? 
                  y + sy*dy() : 
                  y + sy*dy()*ct - sz*dz()*st ,
                  dy()>dx() ? 
                  z + sz*dz()*ct + sy*dy()*st :
                  z + sz*dz()*ct + sx*dx()*st ) ;
            }
         }
      }
   }
   return co ;
}
virtual Tr3D PreshowerStrip::getTransform ( Pt3DVec lptr) const [inline, virtual]

Definition at line 63 of file PreshowerStrip.h.

      { return Tr3D() ; }
void PreshowerStrip::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) [static]

Definition at line 88 of file PreshowerStrip.cc.

References dx(), dy(), and dz().

Referenced by vocalCorners().

{
   assert( 8 == lc.size() ) ;
   assert( 0 != pv ) ;

   const CCGFloat dx ( pv[0] ) ;
   const CCGFloat dy ( pv[1] ) ;
   const CCGFloat dz ( pv[2] ) ;

   lc[0] = Pt3D( -dx, -dy, -dz ) ;
   lc[1] = Pt3D( -dx,  dy, -dz ) ;
   lc[2] = Pt3D(  dx,  dy, -dz ) ;
   lc[3] = Pt3D(  dx, -dy, -dz ) ;
   lc[4] = Pt3D( -dx, -dy,  dz ) ;
   lc[5] = Pt3D( -dx,  dy,  dz ) ;
   lc[6] = Pt3D(  dx,  dy,  dz ) ;
   lc[7] = Pt3D(  dx, -dy,  dz ) ;

   ref   = Pt3D(0,0,0) ;
}
PreshowerStrip & PreshowerStrip::operator= ( const PreshowerStrip tr)

Definition at line 21 of file PreshowerStrip.cc.

{
   CaloCellGeometry::operator=( tr ) ;
   if( this != &tr )
   {
   }
   return *this ; 
}
const CCGFloat PreshowerStrip::tilt ( ) const [inline]

Definition at line 52 of file PreshowerStrip.h.

References CaloCellGeometry::param().

Referenced by getCorners().

{ return param()[3] ; }
virtual void PreshowerStrip::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const [inline, virtual]

Implements CaloCellGeometry.

Definition at line 54 of file PreshowerStrip.h.

References localCorners().

      { localCorners( vec, pv, ref ) ; }