CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions
IdealCastorTrapezoid Class Reference

#include <IdealCastorTrapezoid.h>

Inheritance diagram for IdealCastorTrapezoid:
CaloCellGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
typedef CaloCellGeometry::Tr3D Tr3D
 
- Public Types inherited from CaloCellGeometry
typedef float CCGFloat
 
typedef EZMgrFL< GlobalPointCornersMgr
 
enum  CornersSize { k_cornerSize = 8 }
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D
< CCGFloat
Pt3D
 
typedef std::vector< Pt3DPt3DVec
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

CCGFloat an () const
 
CCGFloat dh () const
 
CCGFloat dhz () const
 
CCGFloat dR () const
 
CCGFloat dx () const
 
CCGFloat dxh () const
 
CCGFloat dxl () const
 
CCGFloat dy () const
 
CCGFloat dz () const
 
CCGFloat dzb () const
 
CCGFloat dzs () const
 
virtual const CornersVecgetCorners () const
 Returns the corner points of this cell's volume. More...
 
 IdealCastorTrapezoid ()
 
 IdealCastorTrapezoid (const IdealCastorTrapezoid &idct)
 
 IdealCastorTrapezoid (const GlobalPoint &faceCenter, const CornersMgr *mgr, const CCGFloat *parm)
 
IdealCastorTrapezoidoperator= (const IdealCastorTrapezoid &idct)
 
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
 
virtual ~IdealCastorTrapezoid ()
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
const GlobalPointgetPosition () const
 Returns the position of reference for this cell. More...
 
virtual void getTransform (Tr3D &tr, Pt3DVec *lptr) const
 --------— only needed by specific utility; overloaded when needed -— More...
 
bool inside (const GlobalPoint &point) const
 Returns true if the specified point is inside this cell. More...
 
const CCGFloatparam () const
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static void localCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const CCGFloatcheckParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv)
 
static const CCGFloatgetParmPtr (const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Additional Inherited Members

- Static Public Attributes inherited from CaloCellGeometry
static const CCGFloat k_ScaleFromDDDtoGeant
 
- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
 CaloCellGeometry (const CaloCellGeometry &cell)
 
CaloCellGeometryoperator= (const CaloCellGeometry &cell)
 
CornersVecsetCorners () const
 

Detailed Description

Trapezoid class used for CASTOR volumes.

Required parameters for an ideal trapezoid:

Total: 6+3 parameters

Date:
2011/09/27 09:15:30
Revision:
1.13
Author
P. Katsas - UoA

Definition at line 33 of file IdealCastorTrapezoid.h.

Member Typedef Documentation

Definition at line 37 of file IdealCastorTrapezoid.h.

Definition at line 38 of file IdealCastorTrapezoid.h.

Definition at line 39 of file IdealCastorTrapezoid.h.

Definition at line 40 of file IdealCastorTrapezoid.h.

Constructor & Destructor Documentation

IdealCastorTrapezoid::IdealCastorTrapezoid ( )

Definition at line 11 of file IdealCastorTrapezoid.cc.

13 {
14 }
IdealCastorTrapezoid::IdealCastorTrapezoid ( const IdealCastorTrapezoid idct)

Definition at line 16 of file IdealCastorTrapezoid.cc.

17  : CaloCellGeometry( idct )
18 {
19  *this = idct ;
20 }
IdealCastorTrapezoid::IdealCastorTrapezoid ( const GlobalPoint faceCenter,
const CornersMgr mgr,
const CCGFloat parm 
)

Definition at line 29 of file IdealCastorTrapezoid.cc.

32  : CaloCellGeometry ( faceCenter, mgr, parm )
33 {
34 }
IdealCastorTrapezoid::~IdealCastorTrapezoid ( )
virtual

Definition at line 36 of file IdealCastorTrapezoid.cc.

37 {
38 }

Member Function Documentation

CCGFloat IdealCastorTrapezoid::an ( ) const

Definition at line 95 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by dhz(), dy(), and localCorners().

96 {
97  return param()[4] ;
98 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dh ( ) const

Definition at line 59 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by dhz(), dy(), and localCorners().

60 {
61  return param()[2] ;
62 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dhz ( ) const

Definition at line 77 of file IdealCastorTrapezoid.cc.

References an(), funct::cos(), and dh().

Referenced by dzb(), dzs(), and localCorners().

78 {
79  return dh()*cos(an()) ;
80 }
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CCGFloat IdealCastorTrapezoid::dR ( ) const

Definition at line 101 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by getCorners().

102 {
103  return param()[5] ;
104 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dx ( ) const

Definition at line 53 of file IdealCastorTrapezoid.cc.

References dxh(), and dxl().

Referenced by getCorners(), and localCorners().

54 {
55  return ( dxl()+dxh() )/2. ;
56 }
CCGFloat IdealCastorTrapezoid::dxh ( ) const

Definition at line 47 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by dx(), and localCorners().

48 {
49  return param()[1] ;
50 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dxl ( ) const

Definition at line 41 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by dx(), and localCorners().

42 {
43  return param()[0] ;
44 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dy ( ) const

Definition at line 65 of file IdealCastorTrapezoid.cc.

References an(), dh(), and funct::sin().

Referenced by getCorners(), and localCorners().

66 {
67  return dh()*sin(an()) ;
68 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
CCGFloat IdealCastorTrapezoid::dz ( ) const

Definition at line 71 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::param().

Referenced by dzb(), dzs(), getCorners(), and localCorners().

72 {
73  return param()[3] ;
74 }
const CCGFloat * param() const
CCGFloat IdealCastorTrapezoid::dzb ( ) const

Definition at line 83 of file IdealCastorTrapezoid.cc.

References dhz(), and dz().

Referenced by localCorners().

84 {
85  return dz() + dhz() ;
86 }
CCGFloat IdealCastorTrapezoid::dzs ( ) const

Definition at line 89 of file IdealCastorTrapezoid.cc.

References dhz(), and dz().

Referenced by localCorners().

90 {
91  return dz() - dhz() ;
92 }
const CaloCellGeometry::CornersVec & IdealCastorTrapezoid::getCorners ( ) const
virtual

Returns the corner points of this cell's volume.

Implements CaloCellGeometry.

Definition at line 148 of file IdealCastorTrapezoid.cc.

References funct::cos(), dR(), dx(), dy(), dz(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), i, localCorners(), python.rootplot.utilities::ls(), AlCaHLTBitMon_ParallelJobs::p, CaloCellGeometry::param(), phi, rho, CaloCellGeometry::setCorners(), funct::sin(), EZArrayFL< T >::uninitialized(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

149 {
150  const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
151  if( co.uninitialized() )
152  {
154  const GlobalPoint& p ( getPosition() ) ;
155  const CCGFloat zsign ( 0 < p.z() ? 1. : -1. ) ;
156  const Pt3D gf ( p.x(), p.y(), p.z() ) ;
157 
158  Pt3D lf ;
159  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
160  localCorners( lc, param(), lf ) ;
161  const Pt3D lb ( lf.x() , lf.y() , lf.z() - 2.*dz() ) ;
162  const Pt3D ls ( lf.x() - dx(), lf.y(), lf.z() ) ;
163 
164 
165  const CCGFloat fphi ( atan( dx()/( dR() + dy() ) ) ) ;
166  const Pt3D gb ( gf.x() , gf.y() , gf.z() + 2.*zsign*dz() ) ;
167 
168  const CCGFloat rho ( dR() + dy() ) ;
169  const CCGFloat phi ( gf.phi() + fphi ) ;
170  const Pt3D gs ( rho*cos(phi) ,
171  rho*sin(phi) ,
172  gf.z() ) ;
173 
174  const Tr3D tr ( lf, lb, ls,
175  gf, gb, gs ) ;
176 
177  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
178  {
179  const Pt3D gl ( tr*lc[i] ) ;
180  corners[i] = GlobalPoint( gl.x(), gl.y(), gl.z() ) ;
181  }
182  }
183  return co ;
184 }
EZArrayFL< GlobalPoint > CornersVec
int i
Definition: DBlmapReader.cc:9
CaloCellGeometry::Pt3D Pt3D
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Definition: DDAxes.h:10
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
const CCGFloat * param() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D
CornersVec & setCorners() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.
Definition: DDAxes.h:10
void IdealCastorTrapezoid::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 115 of file IdealCastorTrapezoid.cc.

References an(), funct::cos(), dh(), dhz(), dx(), dxh(), dxl(), dy(), dz(), dzb(), dzs(), and funct::sin().

Referenced by getCorners(), CastorGeometry::localCorners(), and vocalCorners().

118 {
119  assert( 8 == lc.size() ) ;
120  assert( 0 != pv ) ;
121 
122  const CCGFloat dxl ( pv[0] ) ;
123  const CCGFloat dxh ( pv[1] ) ;
124  const CCGFloat dh ( pv[2] ) ;
125  const CCGFloat dz ( pv[3] ) ;
126  const CCGFloat an ( pv[4] ) ;
127  const CCGFloat dx ( ( dxl +dxh )/2. ) ;
128  const CCGFloat dy ( dh*sin(an) ) ;
129  const CCGFloat dhz ( dh*cos(an) ) ;
130  const CCGFloat dzb ( dz + dhz ) ;
131  const CCGFloat dzs ( dz - dhz ) ;
132 
133  assert( 0 < (dxl*dxh) ) ;
134 
135  lc[ 0 ] = Pt3D ( -dx, -dy , dzb ) ;
136  lc[ 1 ] = Pt3D ( -dx, +dy , dzs ) ;
137  lc[ 2 ] = Pt3D ( +2*dxh -dx, +dy , dzs ) ;
138  lc[ 3 ] = Pt3D ( +2*dxl -dx, -dy , dzb ) ;
139  lc[ 4 ] = Pt3D ( -dx, -dy , -dzs ) ;
140  lc[ 5 ] = Pt3D ( -dx, +dy , -dzb ) ;
141  lc[ 6 ] = Pt3D ( +2*dxh -dx, +dy , -dzb ) ;
142  lc[ 7 ] = Pt3D ( +2*dxl -dx, -dy , -dzs ) ;
143 
144  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
145 }
CaloCellGeometry::Pt3D Pt3D
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloCellGeometry::CCGFloat CCGFloat
IdealCastorTrapezoid & IdealCastorTrapezoid::operator= ( const IdealCastorTrapezoid idct)

Definition at line 23 of file IdealCastorTrapezoid.cc.

References CaloCellGeometry::operator=().

24 {
25  if( &idct != this ) CaloCellGeometry::operator=( idct ) ;
26  return *this ;
27 }
CaloCellGeometry & operator=(const CaloCellGeometry &cell)
void IdealCastorTrapezoid::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
virtual

Implements CaloCellGeometry.

Definition at line 107 of file IdealCastorTrapezoid.cc.

References localCorners().

110 {
111  localCorners( vec, pv, ref ) ;
112 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)