14 typedef HepGeom::Vector3D<CCGFloat>
FVec3D;
15 typedef HepGeom::Plane3D<CCGFloat>
Plane3D;
17 typedef HepGeom::Vector3D<double>
DVec3D;
19 typedef HepGeom::Point3D<double>
DPt3D;
25 :
CaloCellGeometry(), m_axis(0., 0., 0.), m_corOne(0., 0., 0.), m_local(0., 0., 0.), m_global(0., 0., 0.) {}
30 CaloCellGeometry::operator=(tr);
40 <<
etaPos() <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
41 <<
" and rotation " <<
m_tr.getRotation();
49 m_axis((bCtr - fCtr).
unit()),
50 m_corOne(cor1.
x(), cor1.
y(), cor1.
z()),
57 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
58 <<
" and rotation " <<
m_tr.getRotation();
63 :
CaloCellGeometry(corn, par), m_corOne(corn[0].
x(), corn[0].
y(), corn[0].
z()), m_local(0., 0., 0.) {
70 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
71 <<
" and rotation " <<
m_tr.getRotation();
81 <<
" phi " <<
phiPos() <<
" Translation " <<
m_tr.getTranslation()
82 <<
" and rotation " <<
m_tr.getRotation();
92 <<
" Global " <<
glb.x() <<
":" <<
glb.y() <<
":" <<
glb.z() <<
" TR " <<
m_tr.xx()
93 <<
":" <<
m_tr.xy() <<
":" <<
m_tr.xz() <<
":" <<
m_tr.yx() <<
":" <<
m_tr.yy()
94 <<
":" <<
m_tr.yz() <<
":" <<
m_tr.zx() <<
":" <<
m_tr.zy() <<
":" <<
m_tr.zz()
95 <<
":" <<
m_tr.dx() <<
":" <<
m_tr.dy() <<
":" <<
m_tr.dz();
119 edm::LogVerbatim(
"CaloGeometry") <<
"FlatTrd::Global " << global.
x() <<
":" << global.
y() <<
":" << global.
z()
165 lc[0] =
Pt3D(-
h * ta1 - bl, -
h, -
dz);
166 lc[1] =
Pt3D(+
h * ta1 - tl, +
h, -
dz);
167 lc[2] =
Pt3D(+
h * ta1 + tl, +
h, -
dz);
168 lc[3] =
Pt3D(-
h * ta1 + bl, -
h, -
dz);
169 lc[4] =
Pt3D(-
h * ta1 - bl, -
h,
dz);
170 lc[5] =
Pt3D(+
h * ta1 - tl, +
h,
dz);
171 lc[6] =
Pt3D(+
h * ta1 + tl, +
h,
dz);
172 lc[7] =
Pt3D(-
h * ta1 + bl, -
h,
dz);
174 ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
176 edm::LogVerbatim(
"CaloGeometry") <<
"Ref " << ref <<
" Local Corners " << lc[0] <<
"|" << lc[1] <<
"|" << lc[2] <<
"|" 177 << lc[3] <<
"|" << lc[4] <<
"|" << lc[5] <<
"|" << lc[6] <<
"|" << lc[7];
183 const Pt3D gFront(
p.x(),
p.y(),
p.z());
184 const DPt3D dgFront(
p.x(),
p.y(),
p.z());
193 Pt3D lBack(0.25 * (lc[4] + lc[5] + lc[6] + lc[7]));
195 const DPt3D dlFront(lFront.x(), lFront.y(), lFront.z());
196 const DPt3D dlBack(lBack.x(), lBack.y(), lBack.z());
197 const DPt3D dlOne(lc[0].
x(), lc[0].
y(), lc[0].
z());
203 const DPt3D dgBack(dgFront + (dlBack - dlFront).
mag() * dgAxis);
204 DPt3D dgOne(dgFront + (dlOne - dlFront).
mag() * (dmOne - dgFront).
unit());
206 const double dlangle((dlBack - dlFront).
angle(dlOne - dlFront));
207 const double dgangle((dgBack - dgFront).
angle(dgOne - dgFront));
208 const double dangle(dlangle - dgangle);
210 if (1.
e-6 < fabs(dangle)) {
211 const DPlane3D dgPl(dgFront, dgOne, dgBack);
212 const DPt3D dp2(dgFront + dgPl.normal().unit());
216 dgOne = (dgFront + HepGeom::Rotate3D(-dangle, dgFront, dp2) *
DVec3D(dgOld - dgFront));
219 tr =
Tr3D(dlFront, dlBack, dlOne, dgFront, dgBack, dgOne);
226 if (
co.uninitialized()) {
233 const Pt3D corn(tr * lc[
i]);
245 GlobalPoint global(global_b.x(), global_b.y(), global_b.z());
256 for (
unsigned int i = 0;
i != corners.size(); ++
i) {
257 s <<
"Corner: " << corners[
i] << std::endl;
Log< level::Info, true > LogVerbatim
const GlobalVector & axis() const
A base class to handle the particular shape of HGCal volumes.
HepGeom::Point3D< double > DPt3D
FlatTrd & operator=(const FlatTrd &tr)
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
static constexpr unsigned int ncornerBy2_
CaloCellGeometry::Pt3D Pt3D
float etaPos() const override
HepGeom::Point3D< double > DPt3D
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
static constexpr uint32_t k_dY1
__host__ __device__ VT * co
FlatTrd::CCGFloat CCGFloat
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
float etaSpan() const override
HepGeom::Plane3D< CCGFloat > Plane3D
static constexpr unsigned int ncorner_
CaloCellGeometry::CCGFloat CCGFloat
CCGFloat getThetaAxis() const
static const float tolmin
static constexpr uint32_t k_dX1
HepGeom::Vector3D< CCGFloat > FVec3D
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
float phiSpan() const override
HepGeom::Vector3D< double > DVec3D
Basic3DVector unit() const
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
HepGeom::Plane3D< double > DPlane3D
float phiPos() const override
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint backCtr(void) const
GlobalVector makeAxis(void)
HepGeom::Plane3D< double > DPlane3D
void initCorners(CornersVec &) override
HepGeom::Point3D< CCGFloat > Pt3D
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
static constexpr uint32_t k_dZ
CaloCellGeometry::Tr3D Tr3D
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
static constexpr uint32_t k_Alp1
std::ostream & operator<<(std::ostream &s, const FlatTrd &cell)
Vector3DBase unit() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Pt3D getLocal(const GlobalPoint &global) const
HepGeom::Vector3D< CCGFloat > FVec3D
const CCGFloat * param() const
static constexpr uint32_t k_dX2
CCGFloat getPhiAxis() const
Global3DVector GlobalVector
Geom::Theta< T > theta() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)