11 typedef HepGeom::Vector3D<CCGFloat>
FVec3D ;
12 typedef HepGeom::Plane3D<CCGFloat>
Plane3D ;
14 typedef HepGeom::Vector3D<double>
DVec3D ;
16 typedef HepGeom::Point3D<double>
DPt3D ;
22 m_axis ( 0., 0., 0. ),
23 m_corOne ( 0., 0., 0. )
35 CaloCellGeometry::operator=( tr ) ;
117 const Pt3D gFront ( p.
x(), p.
y(), p.
z() ) ;
118 const DPt3D dgFront ( p.
x(), p.
y(), p.
z() ) ;
120 const double dz (
param()[0] ) ;
123 assert(
nullptr !=
param() ) ;
124 std::vector<Pt3D > lc( 8,
Pt3D(0,0,0) ) ;
136 Pt3D lBack ( 0.25*(lc[4]+lc[5]+lc[6]+lc[7]) ) ;
138 const double disl ( ( lFront - lc[0] ).
mag() ) ;
139 const double disr ( ( lFront - lc[3] ).
mag() ) ;
140 const double disg ( ( gFront -
m_corOne ).
mag() ) ;
142 const double dell ( fabs( disg - disl ) ) ;
143 const double delr ( fabs( disg - disr ) ) ;
149 lBack = 0.25*( lc[4] + lc[5] + lc[6] + lc[7] ) ;
152 const DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
153 const DPt3D dlBack ( lBack.x() , lBack.y() , lBack.z() ) ;
154 const DPt3D dlOne ( lc[0].
x() , lc[0].
y() , lc[0].
z() ) ;
160 const DPt3D dgBack ( dgFront + ( dlBack - dlFront ).
mag()*dgAxis ) ;
161 DPt3D dgOne ( dgFront + ( dlOne - dlFront ).
mag()*( dmOne - dgFront ).
unit() ) ;
163 const double dlangle ( ( dlBack - dlFront).
angle( dlOne - dlFront ) ) ;
164 const double dgangle ( ( dgBack - dgFront).
angle( dgOne - dgFront ) ) ;
165 const double dangle ( dlangle - dgangle ) ;
167 if( 1.
e-6 < fabs(dangle) )
169 const DPlane3D dgPl ( dgFront, dgOne, dgBack ) ;
170 const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
172 DPt3D dgOld ( dgOne ) ;
174 dgOne = ( dgFront + HepGeom::Rotate3D( -dangle, dgFront, dp2 )*
175 DVec3D( dgOld - dgFront ) ) ;
178 tr =
Tr3D( dlFront , dlBack , dlOne ,
179 dgFront , dgBack , dgOne ) ;
181 if(
nullptr != lptr ) (*lptr) = lc ;
194 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
196 const Pt3D corn ( tr*lc[
i] ) ;
197 corners[
i] =
GlobalPoint( corn.x(), corn.y(), corn.z() ) ;
206 return Pt3D ( -p.x(), p.y(), p.z() ) ;
241 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
249 assert(
nullptr != pv ) ;
250 assert( 8 == lc.size() ) ;
271 const unsigned int off ( h1<h2 ? 0 : 4 ) ;
273 lc[0+off] =
Pt3D ( -dz*tthcp - h1*ta1 - b1, -dz*tthsp - h1 , -dz );
274 lc[1+off] =
Pt3D ( -dz*tthcp + h1*ta1 - t1, -dz*tthsp + h1 , -dz );
275 lc[2+off] =
Pt3D ( -dz*tthcp + h1*ta1 + t1, -dz*tthsp + h1 , -dz );
276 lc[3+off] =
Pt3D ( -dz*tthcp - h1*ta1 + b1, -dz*tthsp - h1 , -dz );
277 lc[4-off] =
Pt3D ( dz*tthcp - h2*ta2 - b2, dz*tthsp - h2 , dz );
278 lc[5-off] =
Pt3D ( dz*tthcp + h2*ta2 - t2, dz*tthsp + h2 , dz );
279 lc[6-off] =
Pt3D ( dz*tthcp + h2*ta2 + t2, dz*tthsp + h2 , dz );
280 lc[7-off] =
Pt3D ( dz*tthcp - h2*ta2 + b2, dz*tthsp - h2 , dz );
282 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
306 ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
316 std::vector<GlobalPoint>& co )
318 assert( 11 == pv.size() ) ;
319 assert( 8 == co.size() ) ;
329 static const FVec3D x ( 1, 0, 0 ) ;
330 static const FVec3D y ( 0, 1, 0 ) ;
331 static const FVec3D z ( 0, 0, 1 ) ;
332 const bool refl ( ( ( tr*x ).
cross( tr*y ) ).
dot( tr*z ) < 0 ) ;
338 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
382 copy( to.begin(), to.end(), ko.begin() ) ;
384 for(
unsigned int i ( 0 ) ;
i != 8 ; ++
i )
386 const Pt3D &
p ( ko[
i] ) ;
395 s <<
"Center: " << ( (
const CaloCellGeometry&) cell).getPosition() << std::endl;
398 s <<
"Axis: " << thetaaxis <<
" " << phiaxis << std::endl ;
400 for (
unsigned int i=0 ;
i != corners.size() ; ++
i )
402 s <<
"Corner: " << corners[
i] << std::endl;
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::Tr3D Tr3D
HepGeom::Point3D< double > DPt3D
TruncatedPyramid::Pt3D Pt3D
HepGeom::Point3D< double > DPt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Sin< T >::type sin(const T &t)
CaloCellGeometry::Pt3D Pt3D
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
CCGFloat getPhiAxis() const
TruncatedPyramid::Pt3DVec Pt3DVec
Geom::Theta< T > theta() const
static void localCornersSwap(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
const CCGFloat * param() const
HepGeom::Vector3D< double > DVec3D
CaloCellGeometry::Pt3DVec Pt3DVec
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
CCGFloat getThetaAxis() const
TruncatedPyramid & operator=(const TruncatedPyramid &tr)
GlobalVector makeAxis(void)
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::CCGFloat CCGFloat
void initCorners(CornersVec &) override
Vector3DBase unit() const
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
HepGeom::Plane3D< double > DPlane3D
TruncatedPyramid::CCGFloat CCGFloat
HepGeom::Point3D< CCGFloat > Pt3D
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
std::vector< std::vector< double > > tmp
const GlobalVector & axis() const
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
TruncatedPyramid::Tr3D Tr3D
bool uninitialized() const
std::ostream & operator<<(std::ostream &s, const TruncatedPyramid &cell)
HepGeom::Plane3D< double > DPlane3D
HepGeom::Plane3D< CCGFloat > Plane3D
~TruncatedPyramid() override
const GlobalPoint backCtr(void) const
static void localCornersReflection(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
HepGeom::Vector3D< CCGFloat > FVec3D
HepGeom::Vector3D< CCGFloat > FVec3D
Global3DVector GlobalVector
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)