14 typedef HepGeom::Vector3D<CCGFloat>
FVec3D ;
15 typedef HepGeom::Plane3D<CCGFloat>
Plane3D ;
17 typedef HepGeom::Vector3D<double>
DVec3D ;
19 typedef HepGeom::Point3D<double>
DPt3D ;
24 m_corOne ( 0., 0., 0. ), m_local (0., 0., 0.),
25 m_global ( 0., 0., 0. ) {
33 CaloCellGeometry::operator=( tr ) ;
45 <<
" Translation " <<
m_tr.getTranslation()
46 <<
" and rotation " <<
m_tr.getRotation();
65 <<
" Global " << glb <<
" eta " 67 <<
" Translation " <<
m_tr.getTranslation()
68 <<
" and rotation " <<
m_tr.getRotation();
83 <<
" Global " << glb <<
" eta " 85 <<
" Translation " <<
m_tr.getTranslation()
86 <<
" and rotation " <<
m_tr.getRotation();
97 <<
" Global " << glb <<
" eta " 99 <<
" Translation " <<
m_tr.getTranslation()
100 <<
" and rotation " <<
m_tr.getRotation();
109 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon::Local " << local.x() <<
":" 110 << local.y() <<
":" << local.z()
111 <<
" Global " << glb.x() <<
":" << glb.y()
112 <<
":" << glb.z() <<
" TR " <<
m_tr.xx()
113 <<
":" <<
m_tr.xy() <<
":" <<
m_tr.xz()
114 <<
":" <<
m_tr.yx() <<
":" <<
m_tr.yy()
115 <<
":" <<
m_tr.yz() <<
":" <<
m_tr.zx()
116 <<
":" <<
m_tr.zy() <<
":" <<
m_tr.zz()
117 <<
":" <<
m_tr.dx() <<
":" <<
m_tr.dy()
127 <<
":" << global.
y() <<
":" << global.
z()
128 <<
" Local " << local.x() <<
":" 129 << local.y() <<
":" << local.z();
154 std::vector<GlobalPoint>& co ) {
156 assert( 3 == pv.size() ) ;
165 for(
unsigned int i ( 0 ) ;
i !=
ncorner_ ; ++
i ) {
167 const Pt3D &
p ( ko[
i] ) ;
178 assert(
nullptr != pv ) ;
185 lc[0] =
Pt3D ( 0 , - 2*R , -dz );
186 lc[1] =
Pt3D ( - r , - R , -dz );
187 lc[2] =
Pt3D ( - r , R , -dz );
188 lc[3] =
Pt3D ( 0 , 2*R , -dz );
189 lc[4] =
Pt3D ( r , R , -dz );
190 lc[5] =
Pt3D ( r , - R , -dz );
191 lc[6] =
Pt3D ( 0 , - 2*R , dz );
192 lc[7] =
Pt3D ( - r , - R , dz );
193 lc[8] =
Pt3D ( - r , R , dz );
194 lc[9] =
Pt3D ( 0 , 2*R , dz );
195 lc[10]=
Pt3D ( r , R , dz );
196 lc[11]=
Pt3D ( r , - R , dz );
198 ref =
oneBySix_ * ( lc[0] + lc[1] + lc[2] + lc[3] + lc[4] + lc[5] );
201 << lc[0] <<
"|" << lc[1] <<
"|" << lc[2]
202 <<
"|" << lc[3] <<
"|" << lc[4] <<
"|" 203 << lc[5] <<
"|" << lc[6] <<
"|" << lc[7]
204 <<
"|" << lc[8] <<
"|" << lc[9] <<
"|" 205 << lc[10] <<
"|" << lc[11];
211 const Pt3D gFront ( p.
x(), p.
y(), p.
z() ) ;
212 const DPt3D dgFront ( p.
x(), p.
y(), p.
z() ) ;
215 assert(
nullptr !=
param() ) ;
221 Pt3D lBack ( (lc[6]+lc[7]+lc[8]+lc[9]+lc[10]+lc[11]) / 6.0 ) ;
223 const DPt3D dlFront ( lFront.x(), lFront.y(), lFront.z() ) ;
224 const DPt3D dlBack ( lBack.x() , lBack.y() , lBack.z() ) ;
225 const DPt3D dlOne ( lc[0].
x() , lc[0].
y() , lc[0].
z() ) ;
231 const DPt3D dgBack ( dgFront + ( dlBack - dlFront ).
mag()*dgAxis ) ;
232 DPt3D dgOne ( dgFront + ( dlOne - dlFront ).
mag()*( dmOne - dgFront ).
unit() ) ;
234 const double dlangle ( ( dlBack - dlFront).
angle( dlOne - dlFront ) ) ;
235 const double dgangle ( ( dgBack - dgFront).
angle( dgOne - dgFront ) ) ;
236 const double dangle ( dlangle - dgangle ) ;
238 if( 1.
e-6 < fabs(dangle) ) {
239 const DPlane3D dgPl ( dgFront, dgOne, dgBack ) ;
240 const DPt3D dp2 ( dgFront + dgPl.normal().unit() ) ;
242 DPt3D dgOld ( dgOne ) ;
244 dgOne = ( dgFront + HepGeom::Rotate3D( -dangle, dgFront, dp2 )*
245 DVec3D( dgOld - dgFront ) ) ;
248 tr =
Tr3D( dlFront , dlBack , dlOne ,
249 dgFront , dgBack , dgOne ) ;
251 if(
nullptr != lptr ) (*lptr) = lc ;
262 for (
unsigned int i ( 0 ) ;
i !=
ncorner_ ; ++
i ) {
263 const Pt3D corn ( tr*lc[
i] ) ;
264 corners[
i] =
GlobalPoint( corn.x(), corn.y(), corn.z() ) ;
278 GlobalPoint global(global_b.x(),global_b.y(),global_b.z());
287 <<
" phi " << cell.
phiPos() << std::endl;
290 for (
unsigned int i=0 ;
i != corners.size() ; ++
i ) {
291 s <<
"Corner: " << corners[
i] << std::endl;
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
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.
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
GlobalVector makeAxis(void)
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
FlatHexagon::CCGFloat CCGFloat
CaloCellGeometry::Tr3D Tr3D
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
const GlobalVector & axis() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static constexpr unsigned int ncorner_
CaloCellGeometry::Pt3D Pt3D
Geom::Theta< T > theta() const
HepGeom::Plane3D< double > DPlane3D
static constexpr uint32_t k_R
CaloCellGeometry::CCGFloat CCGFloat
const CCGFloat * param() const
static constexpr uint32_t k_r
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
virtual float phiPos() const
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
FlatHexagon & operator=(const FlatHexagon &tr)
A base class to handle the hexagonal shape of HGCal silicon volumes.
HepGeom::Plane3D< CCGFloat > Plane3D
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
CaloCellGeometry::Pt3DVec Pt3DVec
Pt3D getLocal(const GlobalPoint &global) const
void initCorners(CornersVec &) override
virtual float etaPos() const
HepGeom::Vector3D< double > DVec3D
Vector3DBase unit() const
static constexpr unsigned int ncornerBy2_
static constexpr uint32_t k_dZ
HepGeom::Plane3D< double > DPlane3D
CCGFloat getPhiAxis() const
HepGeom::Point3D< CCGFloat > Pt3D
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
std::vector< std::vector< double > > tmp
FlatHexagon::Pt3DVec Pt3DVec
bool uninitialized() const
GlobalPoint backCtr(void) const
HepGeom::Vector3D< CCGFloat > FVec3D
HepGeom::Point3D< double > DPt3D
HepGeom::Vector3D< CCGFloat > FVec3D
static constexpr double oneBySix_
Global3DVector GlobalVector
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
CCGFloat getThetaAxis() const