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.) {}
31 CaloCellGeometry::operator=(tr);
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()),
57 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon: Local " << m_local <<
" Global " << glb <<
" eta " <<
etaPos()
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.) {
70 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon: Local " << m_local <<
" Global " << glb <<
" eta " <<
etaPos()
71 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
72 <<
" and rotation " <<
m_tr.getRotation();
81 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon: Local " << m_local <<
" Global " << glb <<
" eta " <<
etaPos()
82 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
83 <<
" and rotation " <<
m_tr.getRotation();
92 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon::Local " << local.x() <<
":" << local.y() <<
":" << local.z()
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();
118 Pt3D local =
m_tr.inverse() *
Pt3D(global.
x(), global.
y(), global.
z());
120 edm::LogVerbatim(
"CaloGeometry") <<
"FlatHexagon::Global " << global.
x() <<
":" << global.
y() <<
":" << global.
z()
121 <<
" Local " << local.x() <<
":" << local.y() <<
":" << local.z();
162 lc[0] =
Pt3D(0, -2 * R, -dz);
163 lc[1] =
Pt3D(-r, -R, -dz);
164 lc[2] =
Pt3D(-r, R, -dz);
165 lc[3] =
Pt3D(0, 2 * R, -dz);
166 lc[4] =
Pt3D(r, R, -dz);
167 lc[5] =
Pt3D(r, -R, -dz);
168 lc[6] =
Pt3D(0, -2 * R, dz);
169 lc[7] =
Pt3D(-r, -R, dz);
170 lc[8] =
Pt3D(-r, R, dz);
171 lc[9] =
Pt3D(0, 2 * R, dz);
172 lc[10] =
Pt3D(r, R, dz);
173 lc[11] =
Pt3D(r, -R, dz);
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);
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
static std::vector< std::string > checklist log
HepGeom::Point3D< double > DPt3D
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
float phiPos() const override
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
GlobalVector makeAxis(void)
float etaSpan() const override
float etaPos() const override
CaloCellGeometry::Tr3D Tr3D
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
std::ostream & operator<<(std::ostream &out, const ALILine &li)
const GlobalVector & axis() const
__host__ __device__ VT * co
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static constexpr unsigned int ncorner_
CaloCellGeometry::Pt3D Pt3D
Geom::Theta< T > theta() const
static constexpr uint32_t k_R
CaloCellGeometry::CCGFloat CCGFloat
const CCGFloat * param() const
static constexpr uint32_t k_r
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
static const float tolmin
FlatHexagon & operator=(const FlatHexagon &tr)
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::Vector3D< double > DVec3D
uint16_t const *__restrict__ x
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3DVec Pt3DVec
Pt3D getLocal(const GlobalPoint &global) const
void initCorners(CornersVec &) override
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
CaloCellGeometry::Pt3D Pt3D
Vector3DBase unit() const
static constexpr unsigned int ncornerBy2_
static constexpr uint32_t k_dZ
HepGeom::Plane3D< double > DPlane3D
CCGFloat getPhiAxis() const
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
CaloCellGeometry::Tr3D Tr3D
bool uninitialized() const
GlobalPoint backCtr(void) const
HepGeom::Vector3D< CCGFloat > FVec3D
ROOT::Math::Plane3D Plane3D
static constexpr double oneBySix_
Global3DVector GlobalVector
Basic3DVector unit() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
CCGFloat getThetaAxis() const