2 #include <CLHEP/Geometry/Plane3D.h>
9 typedef HepGeom::Vector3D<CCGFloat>
FVec3D ;
10 typedef HepGeom::Plane3D<CCGFloat>
Plane3D ;
12 typedef HepGeom::Vector3D<double>
DVec3D ;
14 typedef HepGeom::Point3D<double>
DPt3D ;
20 m_refPoint ( 0., 0., 0. ),
22 m_parms ( (
CCGFloat*) 0 ), m_eta(0), m_phi(0)
37 m_eta(gp.
eta()), m_phi(gp.
phi())
42 m_refPoint ( 0.25*( cv[0].
x() + cv[1].
x() + cv[2].
x() + cv[3].
x() ),
43 0.25*( cv[0].
y() + cv[1].
y() + cv[2].
y() + cv[3].
y() ),
44 0.25*( cv[0].
z() + cv[1].
z() + cv[2].
z() + cv[3].
z() ) ),
47 m_eta( m_refPoint.
eta()), m_phi(m_refPoint.
phi())
64 s <<
", Center: " << cell.
getPosition() << std::endl;
68 s <<
"Corners vector is empty." << std::endl ;
73 for (
unsigned int i ( 0 ) ;
i != corners.size() ; ++
i )
75 s <<
"Corner: " << corners[
i ] << std::endl;
85 const Pt3D gFront ( p.
x(), p.
y(), p.
z() ) ;
86 const DPt3D dgFront ( p.
x(), p.
y(), p.
z() ) ;
89 assert( 0 !=
param() ) ;
93 DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
95 const Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
96 const DPt3D dlBack ( lBack.x(), lBack.y(), lBack.z() ) ;
98 const Pt3D dlOne ( lc[0].
x(), lc[0].
y(), lc[0].
z() ) ;
102 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
104 dkor[
i] =
DPt3D ( cor[
i].
x(), cor[
i].
y(), cor[
i].
z() ) ;
107 DPt3D dgBack ( 0.25*( dkor[4]+dkor[5]+dkor[6]+dkor[7] ) ) ;
109 const DVec3D dgAxis ( (dgBack-dgFront).
unit() ) ;
111 dgBack = ( dgFront + (dlBack-dlFront).
mag()*dgAxis ) ;
112 const DPt3D dgOneT ( dgFront + ( dlOne - dlFront ).
mag()*( dkor[0] - dgFront ).
unit() ) ;
114 const double dlangle ( ( dlBack - dlFront).
angle( dlOne - dlFront ) ) ;
115 const double dgangle ( ( dgBack - dgFront).
angle( dgOneT- dgFront ) ) ;
116 const double ddangle ( dlangle - dgangle ) ;
118 const DPlane3D dgPl ( dgFront, dgOneT, dgBack ) ;
119 const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
121 const DPt3D dgOne ( dgFront + HepGeom::Rotate3D( -ddangle, dgFront, dp2 )*
122 DVec3D ( dgOneT - dgFront ) ) ;
124 tr =
Tr3D( dlFront , dlBack , dlOne ,
125 dgFront , dgBack , dgOne ) ;
127 if( 0 != lptr ) (*lptr) = lc ;
132 const std::vector<float>& vv ,
135 const float* pP ( 0 ) ;
137 for(
unsigned int ii ( 0 ) ;
ii != pvv.size() ; ++
ii )
140 assert( v.
size() == vv.size() ) ;
143 for(
unsigned int j ( 0 ) ;
j != vv.size() ; ++
j )
145 same = same && ( fabs( vv[
j] - v[
j] )<1.e-6 ) ;
159 const std::vector<float>& vv ,
167 pvv.push_back(
ParVec( mgr ) ) ;
169 for(
unsigned int i ( 0 ) ;
i != vv.size() ; ++
i )
173 pP = &(*
back.begin()) ;
182 const Pt3D p ( point.
x(), point.
y(), point.
z() ) ;
185 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
187 co[
i] =
Pt3D ( cog[
i].
x(), cog[
i].
y(), cog[
i].
z() ) ;
190 const Plane3D AA ( co[0], co[1], co[2] ) ;
191 const Plane3D BB ( co[6], co[5], co[4] ) ;
193 if( AA.distance(
p)*BB.distance(
p) >= 0 )
195 const Plane3D CC ( co[0], co[4], co[5] ) ;
196 const Plane3D DD ( co[2], co[6], co[7] ) ;
197 if( CC.distance(
p)*DD.distance(
p) >= 0 )
199 const Plane3D EE ( co[3], co[7], co[4] ) ;
200 const Plane3D FF ( co[1], co[5], co[6] ) ;
201 if( EE.distance(
p)*FF.distance(
p) >= 0 )
bool emptyCorners() const
EZArrayFL< CCGFloat > ParVec
std::vector< ParVec > ParVecVec
HepGeom::Point3D< double > DPt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
const_iterator begin() const
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
std::ostream & operator<<(std::ostream &out, const ALILine &li)
MgrType::const_reference const_reference
const CCGFloat * param() const
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
virtual ~CaloCellGeometry()
HepGeom::Vector3D< double > DVec3D
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
static const CCGFloat k_ScaleFromDDDtoGeant
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0
CaloCellGeometry::Pt3D Pt3D
bool inside(const GlobalPoint &point) const
Returns true if the specified point is inside this cell.
HepGeom::Plane3D< double > DPlane3D
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
CaloCellGeometry::Tr3D Tr3D
CornersVec & setCorners() const
std::vector< DPt3D > DPt3DVec
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
HepGeom::Vector3D< CCGFloat > FVec3D
ROOT::Math::Plane3D Plane3D
*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
Returns the corner points of this cell's volume.
static const CCGFloat * checkParmPtr(const std::vector< CCGFloat > &vd, ParVecVec &pvv)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)