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

CCGFloat dx () const
CCGFloat dy () const
CCGFloat dz () const
virtual const CornersVecgetCorners () const
 Returns the corner points of this cell's volume.
virtual Tr3D getTransform (Pt3DVec *) const
PreshowerStripoperator= (const PreshowerStrip &tr)
 PreshowerStrip ()
 PreshowerStrip (const GlobalPoint &po, const CornersMgr *mgr, const CCGFloat *parm)
 PreshowerStrip (const PreshowerStrip &tr)
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/09/27 09:10:38
Revision:
1.13
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 14 of file PreshowerStrip.cc.

  : CaloCellGeometry( tr )
{
  *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 ) {}
PreshowerStrip::~PreshowerStrip ( ) [virtual]

Definition at line 20 of file PreshowerStrip.cc.

{}

Member Function Documentation

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] ; }
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] ; }
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]

Returns the corner points of this cell's volume.

Implements CaloCellGeometry.

Definition at line 34 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.

Referenced by operator<<().

{
  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 ) 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 100 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 24 of file PreshowerStrip.cc.

{
  if( &tr != this )
  {
    CaloCellGeometry::operator=( tr ) ;
  }
  return *this ; 
}
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 ) ; }