2 #include "CLHEP/Geometry/Plane3D.h"
3 #include "CLHEP/Geometry/Transform3D.h"
8 std::vector<HepGeom::Point3D<double> >
10 HepGeom::Point3D<double> & ref )
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 ) ;
25 assert( 0 < (dxl*dxh) ) ;
27 std::vector<HepGeom::Point3D<double> > lc ( 8, HepGeom::Point3D<double> ( 0,0,0) ) ;
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 ) ;
38 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
50 const double zsign ( 0 < p.
z() ? 1. : -1. ) ;
51 const HepGeom::Point3D<double>
gf ( p.
x(), p.
y(), p.
z() ) ;
53 HepGeom::Point3D<double> 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() ) ;
59 const double fphi ( atan(
dx()/(
dR() +
dy() ) ) ) ;
60 const HepGeom::Point3D<double> gb (
gf.x() ,
gf.y() ,
gf.z() + 2.*zsign*
dz() ) ;
62 const double rho (
dR() +
dy() ) ;
63 const double phi (
gf.phi() + fphi ) ;
64 const HepGeom::Point3D<double> gs ( rho*
cos(
phi) ,
68 const HepGeom::Transform3D tr ( lf, lb,
ls,
71 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
73 const HepGeom::Point3D<double> gl ( tr*lc[
i] ) ;
82 s <<
"Center: " << cell.
getPosition() << std::endl ;
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
Sin< T >::type sin(const T &t)
Global3DPoint GlobalPoint
virtual const CornersVec & getCorners() const
const double * param() const
Cos< T >::type cos(const T &t)
CornersVec & setCorners() const
bool uninitialized() const
std::ostream & operator<<(std::ostream &s, const IdealObliquePrism &cell)
const GlobalPoint & getPosition() const
virtual const CornersVec & getCorners() const =0