|
|
Go to the documentation of this file.
10 typedef HepGeom::Vector3D<CCGFloat>
FVec3D;
11 typedef HepGeom::Plane3D<CCGFloat>
Plane3D;
13 typedef HepGeom::Vector3D<double>
DVec3D;
15 typedef HepGeom::Point3D<double>
DPt3D;
24 CaloCellGeometry::operator=(tr);
39 :
CaloCellGeometry(corn, par), m_axis(makeAxis()), m_corOne(corn[0].
x(), corn[0].
y(), corn[0].
z()) {
67 const Pt3D gFront(
p.x(),
p.y(),
p.z());
68 const DPt3D dgFront(
p.x(),
p.y(),
p.z());
74 std::vector<Pt3D> lc(8,
Pt3D(0, 0, 0));
83 Pt3D lBack(0.25 * (lc[4] + lc[5] + lc[6] + lc[7]));
85 const double disl((lFront - lc[0]).
mag());
86 const double disr((lFront - lc[3]).
mag());
89 const double dell(fabs(disg - disl));
90 const double delr(fabs(disg - disr));
92 if (11.2 <
dz && delr < dell)
95 lBack = 0.25 * (lc[4] + lc[5] + lc[6] + lc[7]);
98 const DPt3D dlFront(lFront.x(), lFront.y(), lFront.z());
99 const DPt3D dlBack(lBack.x(), lBack.y(), lBack.z());
100 const DPt3D dlOne(lc[0].
x(), lc[0].
y(), lc[0].
z());
106 const DPt3D dgBack(dgFront + (dlBack - dlFront).
mag() * dgAxis);
107 DPt3D dgOne(dgFront + (dlOne - dlFront).
mag() * (dmOne - dgFront).
unit());
109 const double dlangle((dlBack - dlFront).
angle(dlOne - dlFront));
110 const double dgangle((dgBack - dgFront).
angle(dgOne - dgFront));
111 const double dangle(dlangle - dgangle);
113 if (1.
e-6 < fabs(dangle))
115 const DPlane3D dgPl(dgFront, dgOne, dgBack);
116 const DPt3D dp2(dgFront + dgPl.normal().unit());
120 dgOne = (dgFront + HepGeom::Rotate3D(-dangle, dgFront, dp2) *
DVec3D(dgOld - dgFront));
123 tr =
Tr3D(dlFront, dlBack, dlOne, dgFront, dgBack, dgOne);
136 for (
unsigned int i(0);
i != 8; ++
i) {
137 const Pt3D corn(tr * lc[
i]);
174 ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
200 const unsigned int off(h1 < h2 ? 0 : 4);
202 lc[0 + off] =
Pt3D(-
dz * tthcp - h1 * ta1 -
b1, -
dz * tthsp - h1, -
dz);
203 lc[1 + off] =
Pt3D(-
dz * tthcp + h1 * ta1 -
t1, -
dz * tthsp + h1, -
dz);
204 lc[2 + off] =
Pt3D(-
dz * tthcp + h1 * ta1 +
t1, -
dz * tthsp + h1, -
dz);
205 lc[3 + off] =
Pt3D(-
dz * tthcp - h1 * ta1 +
b1, -
dz * tthsp - h1, -
dz);
206 lc[4 - off] =
Pt3D(
dz * tthcp - h2 * ta2 -
b2,
dz * tthsp - h2,
dz);
207 lc[5 - off] =
Pt3D(
dz * tthcp + h2 * ta2 -
t2,
dz * tthsp + h2,
dz);
208 lc[6 - off] =
Pt3D(
dz * tthcp + h2 * ta2 +
t2,
dz * tthsp + h2,
dz);
209 lc[7 - off] =
Pt3D(
dz * tthcp - h2 * ta2 +
b2,
dz * tthsp - h2,
dz);
211 ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
231 ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
249 static const FVec3D x(1, 0, 0);
250 static const FVec3D y(0, 1, 0);
251 static const FVec3D z(0, 0, 1);
258 for (
unsigned int i(0);
i != 8; ++
i) {
262 if (
refl || h1 > h2) {
295 copy(
to.begin(),
to.end(), ko.begin());
297 for (
unsigned int i(0);
i != 8; ++
i) {
309 s <<
"Axis: " << thetaaxis <<
" " << phiaxis << std::endl;
311 for (
unsigned int i = 0;
i != corners.size(); ++
i) {
312 s <<
"Corner: " << corners[
i] << std::endl;
HepGeom::Transform3D Tr3D
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
std::vector< Pt3D > Pt3DVec
void initCorners(CornersVec &) override
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
static constexpr uint32_t k_Alp1
static constexpr uint32_t k_Dy1
Geom::Theta< T > theta() const
static constexpr uint32_t k_Dx3
static constexpr uint32_t k_Dx1
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
CaloCellGeometry::Pt3DVec Pt3DVec
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code.
const GlobalVector & axis() const
Global3DVector GlobalVector
static constexpr float b2
static void localCornersReflection(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::CCGFloat CCGFloat
TruncatedPyramid::CCGFloat CCGFloat
Sin< T >::type sin(const T &t)
TruncatedPyramid & operator=(const TruncatedPyramid &tr)
CaloCellGeometry::Pt3D Pt3D
static constexpr float b1
Vector3DBase unit() const
Cos< T >::type cos(const T &t)
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
__host__ __device__ VT * co
HepGeom::Plane3D< double > DPlane3D
static constexpr uint32_t k_Theta
TruncatedPyramid::Tr3D Tr3D
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Global3DPoint GlobalPoint
HepGeom::Point3D< CCGFloat > Pt3D
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
HepGeom::Point3D< double > DPt3D
HepGeom::Plane3D< double > DPlane3D
TruncatedPyramid::Pt3D Pt3D
HepGeom::Vector3D< CCGFloat > FVec3D
static constexpr uint32_t k_Dz
const CCGFloat * param() const
Tan< T >::type tan(const T &t)
CCGFloat getThetaAxis() const
HepGeom::Vector3D< CCGFloat > FVec3D
~TruncatedPyramid() override
std::ostream & operator<<(std::ostream &s, const TruncatedPyramid &cell)
Basic3DVector unit() const
static constexpr uint32_t k_Phi
HepGeom::Vector3D< double > DVec3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
CaloCellGeometry::Tr3D Tr3D
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static void localCornersSwap(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
static constexpr uint32_t k_Dx2
HepGeom::Point3D< double > DPt3D
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
HepGeom::Plane3D< CCGFloat > Plane3D
GlobalVector makeAxis(void)
CCGFloat getPhiAxis() const
static constexpr uint32_t k_Alp2
static constexpr uint32_t k_Dx4
CaloCellGeometry::Pt3D Pt3D
static constexpr uint32_t k_Dy2
Geom::Phi< T > phi() const
bool uninitialized() const
TruncatedPyramid::Pt3DVec Pt3DVec
const GlobalPoint backCtr(void) const