CMS 3D CMS Logo

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

#include <IdealCastorTrapezoid.h>

Inheritance diagram for calogeom::IdealCastorTrapezoid:
CaloCellGeometry

Public Member Functions

const double an () const
 
const double dh () const
 
const double dhz () const
 
const double dR () const
 
const double dx () const
 
const double dxh () const
 
const double dxl () const
 
const double dy () const
 
const double dz () const
 
const double dzb () const
 
const double dzs () const
 
virtual const CornersVecgetCorners () const
 
 IdealCastorTrapezoid (const GlobalPoint &faceCenter, const CornersMgr *mgr, const double *parm)
 
virtual std::vector
< HepGeom::Point3D< double > > 
vocalCorners (const double *pv, HepGeom::Point3D< double > &ref) const
 
virtual ~IdealCastorTrapezoid ()
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
const GlobalPointgetPosition () const
 
virtual HepGeom::Transform3D getTransform (std::vector< HepGeom::Point3D< double > > *lptr) const
 
bool inside (const GlobalPoint &point) const
 
const double * param () const
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static std::vector
< HepGeom::Point3D< double > > 
localCorners (const double *pv, HepGeom::Point3D< double > &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const double * checkParmPtr (const std::vector< double > &vd, ParVecVec &pvv)
 
static const double * getParmPtr (const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Additional Inherited Members

- Public Types inherited from CaloCellGeometry
typedef EZMgrFL< GlobalPointCornersMgr
 
enum  CornersSize { k_cornerSize = 8 }
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< double > ParMgr
 
typedef EZArrayFL< double > ParVec
 
typedef std::vector< ParVecParVecVec
 
- Static Public Attributes inherited from CaloCellGeometry
static const float k_ScaleFromDDDtoGeant
 
- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const double *par)
 
 CaloCellGeometry (const CornersVec &cv, const double *par)
 
CornersVecsetCorners () const
 

Detailed Description

Trapezoid class used for CASTOR volumes.

Required parameters for an ideal trapezoid:

Total: 6+3 parameters

Date:
2009/05/25 09:34:16
Revision:
1.10
Author
P. Katsas - UoA

Definition at line 34 of file IdealCastorTrapezoid.h.

Constructor & Destructor Documentation

calogeom::IdealCastorTrapezoid::IdealCastorTrapezoid ( const GlobalPoint faceCenter,
const CornersMgr mgr,
const double *  parm 
)
inline

Definition at line 38 of file IdealCastorTrapezoid.h.

40  :
41  CaloCellGeometry ( faceCenter, mgr, parm ) {}
CaloCellGeometry(CornersVec::const_reference gp, const CornersMgr *mgr, const double *par)
virtual calogeom::IdealCastorTrapezoid::~IdealCastorTrapezoid ( )
inlinevirtual

Definition at line 43 of file IdealCastorTrapezoid.h.

43 {}

Member Function Documentation

const double calogeom::IdealCastorTrapezoid::an ( ) const
inline

Definition at line 56 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

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

56 { return param()[4] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dh ( ) const
inline

Definition at line 50 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

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

50 { return param()[2] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dhz ( ) const
inline

Definition at line 53 of file IdealCastorTrapezoid.h.

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

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

53 { return dh()*cos(an()) ; }
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
const double calogeom::IdealCastorTrapezoid::dR ( ) const
inline

Definition at line 57 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

Referenced by getCorners().

57 { return param()[5] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dx ( ) const
inline

Definition at line 49 of file IdealCastorTrapezoid.h.

References dxh(), and dxl().

Referenced by getCorners(), and localCorners().

49 { return ( dxl()+dxh() )/2. ; }
const double calogeom::IdealCastorTrapezoid::dxh ( ) const
inline

Definition at line 48 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

Referenced by dx(), and localCorners().

48 { return param()[1] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dxl ( ) const
inline

Definition at line 47 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

Referenced by dx(), and localCorners().

47 { return param()[0] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dy ( ) const
inline

Definition at line 51 of file IdealCastorTrapezoid.h.

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

Referenced by getCorners(), and localCorners().

51 { return dh()*sin(an()) ; }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const double calogeom::IdealCastorTrapezoid::dz ( ) const
inline

Definition at line 52 of file IdealCastorTrapezoid.h.

References CaloCellGeometry::param().

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

52 { return param()[3] ; }
const double * param() const
const double calogeom::IdealCastorTrapezoid::dzb ( ) const
inline

Definition at line 54 of file IdealCastorTrapezoid.h.

References dhz(), and dz().

Referenced by localCorners().

54 { return dz() + dhz() ; }
const double calogeom::IdealCastorTrapezoid::dzs ( ) const
inline

Definition at line 55 of file IdealCastorTrapezoid.h.

References dhz(), and dz().

Referenced by localCorners().

55 { return dz() - dhz() ; }
const CaloCellGeometry::CornersVec & calogeom::IdealCastorTrapezoid::getCorners ( ) const
virtual

Implements CaloCellGeometry.

Definition at line 43 of file IdealCastorTrapezoid.cc.

References funct::cos(), dR(), dx(), dy(), dz(), CaloCellGeometry::getCorners(), CaloCellGeometry::getPosition(), gf, i, localCorners(), python.rootplot.utilities::ls(), L1TEmulatorMonitor_cff::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().

44  {
46  if( co.uninitialized() )
47  {
49  const GlobalPoint& p ( getPosition() ) ;
50  const double zsign ( 0 < p.z() ? 1. : -1. ) ;
51  const HepGeom::Point3D<double> gf ( p.x(), p.y(), p.z() ) ;
52 
53  HepGeom::Point3D<double> lf ;
54  const std::vector<HepGeom::Point3D<double> > lc ( localCorners( param(), lf ) ) ;
55  const HepGeom::Point3D<double> lb ( lf.x() , lf.y() , lf.z() - 2.*dz() ) ;
56  const HepGeom::Point3D<double> ls ( lf.x() - dx(), lf.y(), lf.z() ) ;
57 
58 
59  const double fphi ( atan( dx()/( dR() + dy() ) ) ) ;
60  const HepGeom::Point3D<double> gb ( gf.x() , gf.y() , gf.z() + 2.*zsign*dz() ) ;
61 
62  const double rho ( dR() + dy() ) ;
63  const double phi ( gf.phi() + fphi ) ;
64  const HepGeom::Point3D<double> gs ( rho*cos(phi) ,
65  rho*sin(phi) ,
66  gf.z() ) ;
67 
68  const HepGeom::Transform3D tr ( lf, lb, ls,
69  gf, gb, gs ) ;
70 
71  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
72  {
73  const HepGeom::Point3D<double> gl ( tr*lc[i] ) ;
74  corners[i] = GlobalPoint( gl.x(), gl.y(), gl.z() ) ;
75  }
76  }
77  return co ;
78  }
EZArrayFL< GlobalPoint > CornersVec
int i
Definition: DBlmapReader.cc:9
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Definition: DDAxes.h:10
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const double * param() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CornersVec & setCorners() const
double gf
Definition: hdecay.h:34
const GlobalPoint & getPosition() const
virtual const CornersVec & getCorners() const =0
Definition: DDAxes.h:10
std::vector< HepGeom::Point3D< double > > calogeom::IdealCastorTrapezoid::localCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
)
static

Definition at line 9 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().

11  {
12  assert( 0 != pv ) ;
13 
14  const double dxl ( pv[0] ) ;
15  const double dxh ( pv[1] ) ;
16  const double dh ( pv[2] ) ;
17  const double dz ( pv[3] ) ;
18  const double an ( pv[4] ) ;
19  const double dx ( ( dxl +dxh )/2. ) ;
20  const double dy ( dh*sin(an) ) ;
21  const double dhz ( dh*cos(an) ) ;
22  const double dzb ( dz + dhz ) ;
23  const double dzs ( dz - dhz ) ;
24 
25  assert( 0 < (dxl*dxh) ) ;
26 
27  std::vector<HepGeom::Point3D<double> > lc ( 8, HepGeom::Point3D<double> ( 0,0,0) ) ;
28 
29  lc[ 0 ] = HepGeom::Point3D<double> ( -dx, -dy , dzb ) ;
30  lc[ 1 ] = HepGeom::Point3D<double> ( -dx, +dy , dzs ) ;
31  lc[ 2 ] = HepGeom::Point3D<double> ( +2*dxh -dx, +dy , dzs ) ;
32  lc[ 3 ] = HepGeom::Point3D<double> ( +2*dxl -dx, -dy , dzb ) ;
33  lc[ 4 ] = HepGeom::Point3D<double> ( -dx, -dy , -dzs ) ;
34  lc[ 5 ] = HepGeom::Point3D<double> ( -dx, +dy , -dzb ) ;
35  lc[ 6 ] = HepGeom::Point3D<double> ( +2*dxh -dx, +dy , -dzb ) ;
36  lc[ 7 ] = HepGeom::Point3D<double> ( +2*dxl -dx, -dy , -dzs ) ;
37 
38  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
39  return lc ;
40  }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual std::vector<HepGeom::Point3D<double> > calogeom::IdealCastorTrapezoid::vocalCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
) const
inlinevirtual

Implements CaloCellGeometry.

Definition at line 59 of file IdealCastorTrapezoid.h.

References localCorners().

61  { return localCorners( pv, ref ) ; }
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)