2 #include <CLHEP/Geometry/Plane3D.h>
14 s <<
", Center: " << cell.
getPosition() << std::endl;
18 s <<
"Corners vector is empty." << std::endl ;
23 for (
unsigned int i ( 0 ) ;
i != corners.size() ; ++
i )
25 s <<
"Corner: " << corners[
i ] << std::endl;
35 const HepGeom::Point3D<double> gFront ( p.
x(), p.
y(), p.
z() ) ;
37 HepGeom::Point3D<double> lFront ;
38 assert( 0 !=
param() ) ;
41 HepGeom::Point3D<double> lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
43 const HepGeom::Point3D<double> lOne ( lc[0] ) ;
46 std::vector<HepGeom::Point3D<double> > kor ( 8, HepGeom::Point3D<double> (0,0,0) ) ;
47 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
49 kor[
i] = HepGeom::Point3D<double> ( cor[
i].x(), cor[
i].y(), cor[
i].z() ) ;
52 HepGeom::Point3D<double> gBack ( 0.25*( kor[4]+kor[5]+kor[6]+kor[7] ) ) ;
54 const HepGeom::Vector3D<double> gAxis ( (gBack-gFront).
unit() ) ;
56 gBack = ( gFront + (lBack-lFront).
mag()*gAxis ) ;
57 const HepGeom::Point3D<double> gOneT ( gFront + ( lOne - lFront ).
mag()*( kor[0] - gFront ).
unit() ) ;
59 const double langle ( ( lBack - lFront).
angle( lOne - lFront ) ) ;
60 const double gangle ( ( gBack - gFront).
angle( gOneT- gFront ) ) ;
61 const double dangle ( langle - gangle ) ;
63 const HepGeom::Plane3D<double> gPl ( gFront, gOneT, gBack ) ;
64 const HepGeom::Point3D<double>
p2 ( gFront + gPl.normal().unit() ) ;
66 const HepGeom::Point3D<double> gOne ( gFront + HepGeom::Rotate3D( -dangle, gFront,
p2 )*
67 HepGeom::Vector3D<double> ( gOneT - gFront ) ) ;
69 const HepGeom::Transform3D tr ( lFront , lBack , lOne ,
70 gFront , gBack , gOne ) ;
72 if( 0 != lptr ) (*lptr) = lc ;
79 const std::vector<double>& vv ,
82 const double* pP ( 0 ) ;
84 for(
unsigned int ii ( 0 ) ; ii != pvv.size() ; ++ii )
87 assert( v.
size() == vv.size() ) ;
90 for(
unsigned int j ( 0 ) ;
j != vv.size() ; ++
j )
92 same = same && ( fabs( vv[
j] - v[
j] )<1.e-6 ) ;
106 const std::vector<double>& vv ,
114 pvv.push_back(
ParVec( mgr ) ) ;
116 for(
unsigned int i ( 0 ) ;
i != vv.size() ; ++
i )
120 pP = &(*
back.begin()) ;
129 const HepGeom::Point3D<double>
p ( point.
x(), point.
y(), point.
z() ) ;
131 HepGeom::Point3D<double> co[8] ;
132 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
134 co[
i] = HepGeom::Point3D<double> ( cog[
i].x(), cog[
i].y(), cog[
i].z() ) ;
137 const HepGeom::Plane3D<double> AA ( co[0], co[1], co[2] ) ;
138 const HepGeom::Plane3D<double> BB ( co[6], co[5], co[4] ) ;
140 if( AA.distance(
p)*BB.distance(
p) >= 0 )
142 const HepGeom::Plane3D<double> CC ( co[0], co[4], co[5] ) ;
143 const HepGeom::Plane3D<double> DD ( co[2], co[6], co[7] ) ;
144 if( CC.distance(
p)*DD.distance(
p) >= 0 )
146 const HepGeom::Plane3D<double> EE ( co[3], co[7], co[4] ) ;
147 const HepGeom::Plane3D<double> FF ( co[1], co[5], co[6] ) ;
148 if( EE.distance(
p)*FF.distance(
p) >= 0 )
bool emptyCorners() const
std::vector< ParVec > ParVecVec
EZArrayFL< double > ParVec
virtual std::vector< HepGeom::Point3D< double > > vocalCorners(const double *pv, HepGeom::Point3D< double > &ref) const =0
const double * param() const
const_iterator begin() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
virtual HepGeom::Transform3D getTransform(std::vector< HepGeom::Point3D< double > > *lptr) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
static const float k_ScaleFromDDDtoGeant
bool inside(const GlobalPoint &point) const
static const double * getParmPtr(const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
static const double * checkParmPtr(const std::vector< double > &vd, ParVecVec &pvv)
const GlobalPoint & getPosition() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
virtual const CornersVec & getCorners() const =0
T angle(T x1, T y1, T z1, T x2, T y2, T z2)