14 typedef HepGeom::Vector3D<CCGFloat>
FVec3D;
15 typedef HepGeom::Plane3D<CCGFloat>
Plane3D;
17 typedef HepGeom::Vector3D<double>
DVec3D;
19 typedef HepGeom::Point3D<double>
DPt3D;
26 :
CaloCellGeometry(), m_axis(0., 0., 0.), m_corOne(0., 0., 0.), m_local(0., 0., 0.), m_global(0., 0., 0.) {}
41 <<
etaPos() <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
42 <<
" and rotation " <<
m_tr.getRotation();
50 m_axis((bCtr - fCtr).
unit()),
51 m_corOne(cor1.
x(), cor1.
y(), cor1.
z()),
58 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
59 <<
" and rotation " <<
m_tr.getRotation();
64 :
CaloCellGeometry(corn, par), m_corOne(corn[0].
x(), corn[0].
y(), corn[0].
z()), m_local(0., 0., 0.) {
71 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
72 <<
" and rotation " <<
m_tr.getRotation();
82 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
83 <<
" and rotation " <<
m_tr.getRotation();
93 <<
" Global " <<
glb.x() <<
":" <<
glb.y() <<
":" <<
glb.z() <<
" TR " <<
m_tr.xx()
94 <<
":" <<
m_tr.xy() <<
":" <<
m_tr.xz() <<
":" <<
m_tr.yx() <<
":" <<
m_tr.yy()
95 <<
":" <<
m_tr.yz() <<
":" <<
m_tr.zx() <<
":" <<
m_tr.zy() <<
":" <<
m_tr.zz()
96 <<
":" <<
m_tr.dx() <<
":" <<
m_tr.dy() <<
":" <<
m_tr.dz();
120 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon::Global " << global.
x() <<
":" << global.
y() <<
":" << global.
z()
175 ref =
oneBySix_ * (lc[0] + lc[1] + lc[2] + lc[3] + lc[4] + lc[5]);
177 edm::LogVerbatim(
"CaloGeometry") <<
"Ref " << ref <<
" Local Corners " << lc[0] <<
"|" << lc[1] <<
"|" << lc[2] <<
"|" 178 << lc[3] <<
"|" << lc[4] <<
"|" << lc[5] <<
"|" << lc[6] <<
"|" << lc[7] <<
"|" 179 << lc[8] <<
"|" << lc[9] <<
"|" << lc[10] <<
"|" << lc[11];
185 const Pt3D gFront(
p.x(),
p.y(),
p.z());
186 const DPt3D dgFront(
p.x(),
p.y(),
p.z());
195 Pt3D lBack((lc[6] + lc[7] + lc[8] + lc[9] + lc[10] + lc[11]) / 6.0);
197 const DPt3D dlFront(lFront.x(), lFront.y(), lFront.z());
198 const DPt3D dlBack(lBack.x(), lBack.y(), lBack.z());
199 const DPt3D dlOne(lc[0].
x(), lc[0].
y(), lc[0].
z());
205 const DPt3D dgBack(dgFront + (dlBack - dlFront).
mag() * dgAxis);
206 DPt3D dgOne(dgFront + (dlOne - dlFront).
mag() * (dmOne - dgFront).
unit());
208 const double dlangle((dlBack - dlFront).
angle(dlOne - dlFront));
209 const double dgangle((dgBack - dgFront).
angle(dgOne - dgFront));
210 const double dangle(dlangle - dgangle);
212 if (1.
e-6 < fabs(dangle)) {
213 const DPlane3D dgPl(dgFront, dgOne, dgBack);
214 const DPt3D dp2(dgFront + dgPl.normal().unit());
218 dgOne = (dgFront + HepGeom::Rotate3D(-dangle, dgFront, dp2) *
DVec3D(dgOld - dgFront));
221 tr =
Tr3D(dlFront, dlBack, dlOne, dgFront, dgBack, dgOne);
228 if (
co.uninitialized()) {
235 const Pt3D corn(tr * lc[
i]);
248 GlobalPoint global(global_b.x(), global_b.y(), global_b.z());
259 for (
unsigned int i = 0;
i != corners.size(); ++
i) {
260 s <<
"Corner: " << corners[
i] << std::endl;
float phiSpan() const override
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Log< level::Info, true > LogVerbatim
Basic3DVector & operator=(const Basic3DVector &)=default
Assignment operator.
HepGeom::Point3D< double > DPt3D
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Geom::Phi< T > phi() const
float phiPos() const override
Global3DPoint GlobalPoint
GlobalVector makeAxis(void)
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
float etaSpan() const override
float etaPos() const override
FlatHexagon::CCGFloat CCGFloat
CaloCellGeometry::Tr3D Tr3D
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
__host__ __device__ VT * co
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static constexpr unsigned int ncorner_
CaloCellGeometry::Pt3D Pt3D
HepGeom::Plane3D< double > DPlane3D
static constexpr uint32_t k_R
CaloCellGeometry::CCGFloat CCGFloat
static constexpr uint32_t k_r
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
CCGFloat getPhiAxis() const
static const float tolmin
FlatHexagon & operator=(const FlatHexagon &tr)
const GlobalVector & axis() const
Tan< T >::type tan(const T &t)
A base class to handle the hexagonal shape of HGCal silicon volumes.
Abs< T >::type abs(const T &t)
HepGeom::Plane3D< CCGFloat > Plane3D
CaloCellGeometry::Pt3DVec Pt3DVec
void initCorners(CornersVec &) override
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Basic3DVector unit() const
HepGeom::Vector3D< double > DVec3D
GlobalPoint backCtr(void) const
static constexpr unsigned int ncornerBy2_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
static constexpr uint32_t k_dZ
HepGeom::Plane3D< double > DPlane3D
HepGeom::Point3D< CCGFloat > Pt3D
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
FlatHexagon::Pt3DVec Pt3DVec
CCGFloat getThetaAxis() const
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
HepGeom::Vector3D< CCGFloat > FVec3D
Vector3DBase unit() const
Pt3D getLocal(const GlobalPoint &global) const
HepGeom::Point3D< double > DPt3D
HepGeom::Vector3D< CCGFloat > FVec3D
const CCGFloat * param() const
static constexpr double oneBySix_
Global3DVector GlobalVector
Geom::Theta< T > theta() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)