CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
FlatHexagon Class Reference

A base class to handle the hexagonal shape of HGCal silicon volumes. More...

#include <FlatHexagon.h>

Inheritance diagram for FlatHexagon:
CaloCellGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
typedef CaloCellGeometry::Tr3D Tr3D
 
- Public Types inherited from CaloCellGeometry
typedef float CCGFloat
 
typedef EZMgrFL< GlobalPointCornersMgr
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D< CCGFloatPt3D
 
typedef std::vector< Pt3DPt3DVec
 
using RepCorners = std::array< RhoEtaPhi, k_cornerSize >
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

const GlobalVectoraxis () const
 
float dz () const
 
float etaPos () const override
 
float etaSpan () const override
 
 FlatHexagon (void)
 
 FlatHexagon (const FlatHexagon &tr)
 
 FlatHexagon (CornersMgr *cMgr, const GlobalPoint &fCtr, const GlobalPoint &bCtr, const GlobalPoint &cor1, const CCGFloat *parV)
 
 FlatHexagon (const CornersVec &corn, const CCGFloat *par)
 
 FlatHexagon (const FlatHexagon &tr, const Pt3D &local)
 
Pt3D getLocal (const GlobalPoint &global) const
 
CCGFloat getPhiAxis () const
 
GlobalPoint const & getPosition () const override
 Returns the position of reference for this cell. More...
 
GlobalPoint getPosition (const Pt3D &local) const override
 
CCGFloat getThetaAxis () const
 
void getTransform (Tr3D &tr, Pt3DVec *lptr) const override
 --------— only needed by specific utility; overloaded when needed -— More...
 
FlatHexagonoperator= (const FlatHexagon &tr)
 
float phiPos () const override
 
float phiSpan () const override
 
void setPosition (const GlobalPoint &p)
 
void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
 
float zPos () const
 
 ~FlatHexagon () override
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
GlobalPoint const & getBackPoint () const
 
CornersVec const & getCorners () const
 Returns the corner points of this cell's volume. More...
 
RepCorners const & getCornersREP () const
 
virtual GlobalPoint getPosition (CCGFloat) const
 
bool inside (const GlobalPoint &point) const
 Returns true if the specified point is inside this cell. More...
 
const CCGFloatparam () const
 
RhoEtaPhi const & repPos () const
 
virtual float rhoPos () const
 
void setBackPoint (const GlobalPoint &pos)
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static void createCorners (const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
 
static void localCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const CCGFloatcheckParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv)
 
static const CCGFloatgetParmPtr (const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Static Public Attributes

static constexpr uint32_t k_dZ = 0
 
static constexpr uint32_t k_r = 1
 
static constexpr uint32_t k_R = 2
 
static constexpr unsigned int ncorner_ = 12
 
static constexpr unsigned int ncornerBy2_ = 6
 
static constexpr double oneBySix_ = 1.0 / 6.0
 
- Static Public Attributes inherited from CaloCellGeometry
static constexpr unsigned int k_cornerSize = 8
 
static const CCGFloat k_ScaleFromDDDtoGeant
 

Private Member Functions

GlobalPoint backCtr (void) const
 
void initCorners (CornersVec &) override
 
GlobalVector makeAxis (void)
 

Private Attributes

GlobalVector m_axis
 
Pt3D m_corOne
 
GlobalPoint m_global
 
Pt3D m_local
 
Tr3D m_tr
 

Additional Inherited Members

- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
void initSpan ()
 
void setCornerVec (const std::vector< GlobalPoint > &cor)
 
void setRefPoint (const GlobalPoint &pos)
 

Detailed Description

A base class to handle the hexagonal shape of HGCal silicon volumes.

Definition at line 20 of file FlatHexagon.h.

Member Typedef Documentation

◆ CCGFloat

Definition at line 22 of file FlatHexagon.h.

◆ Pt3D

Definition at line 23 of file FlatHexagon.h.

◆ Pt3DVec

Definition at line 24 of file FlatHexagon.h.

◆ Tr3D

Definition at line 25 of file FlatHexagon.h.

Constructor & Destructor Documentation

◆ FlatHexagon() [1/5]

FlatHexagon::FlatHexagon ( void  )

Definition at line 25 of file FlatHexagon.cc.

26  : CaloCellGeometry(), m_axis(0., 0., 0.), m_corOne(0., 0., 0.), m_local(0., 0., 0.), m_global(0., 0., 0.) {}
Pt3D m_corOne
Definition: FlatHexagon.h:91
GlobalVector m_axis
Definition: FlatHexagon.h:90
Pt3D m_local
Definition: FlatHexagon.h:91
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ FlatHexagon() [2/5]

FlatHexagon::FlatHexagon ( const FlatHexagon tr)

Definition at line 28 of file FlatHexagon.cc.

28 : CaloCellGeometry(tr) { *this = tr; }

◆ FlatHexagon() [3/5]

FlatHexagon::FlatHexagon ( CornersMgr cMgr,
const GlobalPoint fCtr,
const GlobalPoint bCtr,
const GlobalPoint cor1,
const CCGFloat parV 
)

Definition at line 47 of file FlatHexagon.cc.

References etaPos(), getTransform(), glb, m_global, m_local, m_tr, and phiPos().

49  : CaloCellGeometry(fCtr, cMgr, parV),
50  m_axis((bCtr - fCtr).unit()),
51  m_corOne(cor1.x(), cor1.y(), cor1.z()),
52  m_local(0., 0., 0.) {
53  getTransform(m_tr, nullptr);
54  Pt3D glb = m_tr * m_local;
55  m_global = GlobalPoint(glb.x(), glb.y(), glb.z());
56 #ifdef EDM_ML_DEBUG
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();
60 #endif
61 }
Log< level::Info, true > LogVerbatim
Pt3D m_corOne
Definition: FlatHexagon.h:91
T z() const
Definition: PV3DBase.h:61
double glb
Definition: hdecay.h:103
float phiPos() const override
Definition: FlatHexagon.h:52
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float etaPos() const override
Definition: FlatHexagon.h:51
GlobalVector m_axis
Definition: FlatHexagon.h:90
Pt3D m_local
Definition: FlatHexagon.h:91
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:183
Basic3DVector unit() const
CaloCellGeometry::Pt3D Pt3D
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ FlatHexagon() [4/5]

FlatHexagon::FlatHexagon ( const CornersVec corn,
const CCGFloat par 
)

Definition at line 63 of file FlatHexagon.cc.

References etaPos(), getTransform(), glb, m_axis, m_global, m_local, m_tr, makeAxis(), and phiPos().

64  : CaloCellGeometry(corn, par), m_corOne(corn[0].x(), corn[0].y(), corn[0].z()), m_local(0., 0., 0.) {
65  getTransform(m_tr, nullptr);
66  m_axis = makeAxis();
67  Pt3D glb = m_tr * m_local;
68  m_global = GlobalPoint(glb.x(), glb.y(), glb.z());
69 #ifdef EDM_ML_DEBUG
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();
73 #endif
74 }
Log< level::Info, true > LogVerbatim
Pt3D m_corOne
Definition: FlatHexagon.h:91
double glb
Definition: hdecay.h:103
float phiPos() const override
Definition: FlatHexagon.h:52
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalVector makeAxis(void)
Definition: FlatHexagon.cc:241
float etaPos() const override
Definition: FlatHexagon.h:51
GlobalVector m_axis
Definition: FlatHexagon.h:90
Pt3D m_local
Definition: FlatHexagon.h:91
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:183
CaloCellGeometry::Pt3D Pt3D
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ FlatHexagon() [5/5]

FlatHexagon::FlatHexagon ( const FlatHexagon tr,
const Pt3D local 
)

Definition at line 76 of file FlatHexagon.cc.

References etaPos(), glb, m_global, m_local, m_tr, and phiPos().

77  *this = tr;
78  Pt3D glb = m_tr * m_local;
79  m_global = GlobalPoint(glb.x(), glb.y(), glb.z());
80 #ifdef EDM_ML_DEBUG
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();
84 #endif
85 }
Log< level::Info, true > LogVerbatim
double glb
Definition: hdecay.h:103
float phiPos() const override
Definition: FlatHexagon.h:52
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
float etaPos() const override
Definition: FlatHexagon.h:51
Pt3D m_local
Definition: FlatHexagon.h:91
CaloCellGeometry::Pt3D Pt3D
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ ~FlatHexagon()

FlatHexagon::~FlatHexagon ( )
override

Definition at line 87 of file FlatHexagon.cc.

87 {}

Member Function Documentation

◆ axis()

const GlobalVector & FlatHexagon::axis ( ) const

Definition at line 130 of file FlatHexagon.cc.

References m_axis.

Referenced by getTransform().

130 { return m_axis; }
GlobalVector m_axis
Definition: FlatHexagon.h:90

◆ backCtr()

GlobalPoint FlatHexagon::backCtr ( void  ) const
private

Definition at line 243 of file FlatHexagon.cc.

References dz(), CaloCellGeometry::getCorners(), k_dZ, m_local, m_tr, ncornerBy2_, and CaloCellGeometry::param().

Referenced by makeAxis().

243  {
244  float dz =
246  Pt3D local_b(m_local.x(), m_local.y(), m_local.z() + dz);
247  Pt3D global_b = m_tr * local_b;
248  GlobalPoint global(global_b.x(), global_b.y(), global_b.z());
249  return global;
250 }
Pt3D m_local
Definition: FlatHexagon.h:91
float dz() const
Definition: FlatHexagon.h:56
CaloCellGeometry::Pt3D Pt3D
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:82
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
CornersVec const & getCorners() const
Returns the corner points of this cell&#39;s volume.
const CCGFloat * param() const

◆ createCorners()

void FlatHexagon::createCorners ( const std::vector< CCGFloat > &  pv,
const Tr3D tr,
std::vector< GlobalPoint > &  co 
)
static

Definition at line 134 of file FlatHexagon.cc.

References cms::cuda::assert(), cms::cuda::co, mps_fire::i, localCorners(), ncorner_, AlCaHLTBitMon_ParallelJobs::p, MetAnalyzer::pv(), and createJobs::tmp.

Referenced by HGCalGeometryLoader::buildGeom(), and CaloGeometryDBEP< T, U >::produceAligned().

134  {
135  assert(3 == pv.size());
136  assert(ncorner_ == co.size());
137 
138  Pt3DVec ko(ncorner_, Pt3D(0, 0, 0));
139 
140  Pt3D tmp;
141  Pt3DVec to(ncorner_, Pt3D(0, 0, 0));
142  localCorners(to, &pv.front(), tmp);
143 
144  for (unsigned int i(0); i != ncorner_; ++i) {
145  ko[i] = tr * to[i]; // apply transformation
146  const Pt3D& p(ko[i]);
147  co[i] = GlobalPoint(p.x(), p.y(), p.z());
148 #ifdef EDM_ML_DEBUG
149  edm::LogVerbatim("CaloGeometry") << "Corner[" << i << "] = " << co[i];
150 #endif
151  }
152 }
Log< level::Info, true > LogVerbatim
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
assert(be >=bs)
__host__ __device__ VT * co
Definition: prefixScan.h:47
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
tmp
align.sh
Definition: createJobs.py:716

◆ dz()

float FlatHexagon::dz ( ) const
inline

Definition at line 56 of file FlatHexagon.h.

References k_dZ, and CaloCellGeometry::param().

Referenced by backCtr(), Electron.Electron::cutBasedId(), ntupleDataFormat.Track::dzPull(), and localCorners().

56 { return param()[k_dZ]; }
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
const CCGFloat * param() const

◆ etaPos()

float FlatHexagon::etaPos ( ) const
inlineoverridevirtual

Reimplemented from CaloCellGeometry.

Definition at line 51 of file FlatHexagon.h.

References PV3DBase< T, PVType, FrameType >::eta(), and m_global.

Referenced by FlatHexagon(), operator<<(), and operator=().

51 { return m_global.eta(); }
T eta() const
Definition: PV3DBase.h:73
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ etaSpan()

float FlatHexagon::etaSpan ( ) const
overridevirtual

Reimplemented from CaloCellGeometry.

Definition at line 101 of file FlatHexagon.cc.

References funct::abs(), cms::cuda::assert(), HLT_2022v12_cff::dEta, HLT_2022v12_cff::eta1, HLT_2022v12_cff::eta2, k_R, dqm-mbProfile::log, m_global, SiStripPI::max, CaloCellGeometry::param(), PV3DBase< T, PVType, FrameType >::perp(), funct::tan(), tolmin, and PV3DBase< T, PVType, FrameType >::z().

101  {
102  assert(param() != nullptr);
103  float eta1 =
104  -std::log(std::tan(0.5 * std::atan((m_global.perp() + param()[k_R]) / std::max(tolmin, std::abs(m_global.z())))));
105  float eta2 =
106  -std::log(std::tan(0.5 * std::atan((m_global.perp() - param()[k_R]) / std::max(tolmin, std::abs(m_global.z())))));
107  float dEta = std::abs(eta1 - eta2);
108  return dEta;
109 }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
assert(be >=bs)
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
static const float tolmin
Definition: FlatHexagon.cc:21
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const CCGFloat * param() const
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ getLocal()

Pt3D FlatHexagon::getLocal ( const GlobalPoint global) const

Definition at line 117 of file FlatHexagon.cc.

References DTRecHitClients_cfi::local, m_tr, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

117  {
118  Pt3D local = m_tr.inverse() * Pt3D(global.x(), global.y(), global.z());
119 #ifdef EDM_ML_DEBUG
120  edm::LogVerbatim("CaloGeometry") << "FlatHexagon::Global " << global.x() << ":" << global.y() << ":" << global.z()
121  << " Local " << local.x() << ":" << local.y() << ":" << local.z();
122 #endif
123  return local;
124 }
Log< level::Info, true > LogVerbatim
T z() const
Definition: PV3DBase.h:61
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
CaloCellGeometry::Pt3D Pt3D

◆ getPhiAxis()

CCGFloat FlatHexagon::getPhiAxis ( ) const

Definition at line 128 of file FlatHexagon.cc.

References m_axis, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by operator<<().

128 { return m_axis.phi(); }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalVector m_axis
Definition: FlatHexagon.h:90

◆ getPosition() [1/2]

GlobalPoint const& FlatHexagon::getPosition ( ) const
inlineoverridevirtual

Returns the position of reference for this cell.

Reimplemented from CaloCellGeometry.

Definition at line 49 of file FlatHexagon.h.

References m_global.

Referenced by makeAxis(), and operator<<().

49 { return m_global; }
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ getPosition() [2/2]

GlobalPoint FlatHexagon::getPosition ( const Pt3D local) const
overridevirtual

Reimplemented from CaloCellGeometry.

Definition at line 89 of file FlatHexagon.cc.

References glb, DTRecHitClients_cfi::local, and m_tr.

89  {
90  Pt3D glb = m_tr * local;
91 #ifdef EDM_ML_DEBUG
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();
97 #endif
98  return GlobalPoint(glb.x(), glb.y(), glb.z());
99 }
Log< level::Info, true > LogVerbatim
double glb
Definition: hdecay.h:103
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CaloCellGeometry::Pt3D Pt3D

◆ getThetaAxis()

CCGFloat FlatHexagon::getThetaAxis ( ) const

Definition at line 126 of file FlatHexagon.cc.

References m_axis, and PV3DBase< T, PVType, FrameType >::theta().

Referenced by operator<<().

126 { return m_axis.theta(); }
GlobalVector m_axis
Definition: FlatHexagon.h:90
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72

◆ getTransform()

void FlatHexagon::getTransform ( Tr3D tr,
Pt3DVec lptr 
) const
overridevirtual

--------— only needed by specific utility; overloaded when needed -—

Reimplemented from CaloCellGeometry.

Definition at line 183 of file FlatHexagon.cc.

References angle(), cms::cuda::assert(), axis(), MillePedeFileConverter_cfg::e, CaloCellGeometry::getPosition(), localCorners(), m_corOne, mag(), ncorner_, AlCaHLTBitMon_ParallelJobs::p, CaloCellGeometry::param(), unit(), x, y, and z.

Referenced by FlatHexagon(), and initCorners().

183  {
185  const Pt3D gFront(p.x(), p.y(), p.z());
186  const DPt3D dgFront(p.x(), p.y(), p.z());
187 
188  Pt3D lFront;
189  assert(nullptr != param());
190  std::vector<Pt3D> lc(ncorner_, Pt3D(0, 0, 0));
191  localCorners(lc, param(), lFront);
192 
193  // figure out if reflction volume or not
194 
195  Pt3D lBack((lc[6] + lc[7] + lc[8] + lc[9] + lc[10] + lc[11]) / 6.0);
196 
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());
200 
201  const FVec3D dgAxis(axis().x(), axis().y(), axis().z());
202 
203  const DPt3D dmOne(m_corOne.x(), m_corOne.y(), m_corOne.z());
204 
205  const DPt3D dgBack(dgFront + (dlBack - dlFront).mag() * dgAxis);
206  DPt3D dgOne(dgFront + (dlOne - dlFront).mag() * (dmOne - dgFront).unit());
207 
208  const double dlangle((dlBack - dlFront).angle(dlOne - dlFront));
209  const double dgangle((dgBack - dgFront).angle(dgOne - dgFront));
210  const double dangle(dlangle - dgangle);
211 
212  if (1.e-6 < fabs(dangle)) { //guard against precision problems
213  const DPlane3D dgPl(dgFront, dgOne, dgBack);
214  const DPt3D dp2(dgFront + dgPl.normal().unit());
215 
216  DPt3D dgOld(dgOne);
217 
218  dgOne = (dgFront + HepGeom::Rotate3D(-dangle, dgFront, dp2) * DVec3D(dgOld - dgFront));
219  }
220 
221  tr = Tr3D(dlFront, dlBack, dlOne, dgFront, dgBack, dgOne);
222 
223  if (nullptr != lptr)
224  (*lptr) = lc;
225 }
Pt3D m_corOne
Definition: FlatHexagon.h:91
HepGeom::Point3D< double > DPt3D
CaloCellGeometry::Tr3D Tr3D
Definition: FlatHexagon.h:25
assert(be >=bs)
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
const GlobalVector & axis() const
Definition: FlatHexagon.cc:130
Basic3DVector unit() const
HepGeom::Vector3D< double > DVec3D
Definition: FlatHexagon.cc:17
CaloCellGeometry::Pt3D Pt3D
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
HepGeom::Plane3D< double > DPlane3D
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
HepGeom::Vector3D< CCGFloat > FVec3D
const CCGFloat * param() const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ initCorners()

void FlatHexagon::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 227 of file FlatHexagon.cc.

References cms::cuda::co, getTransform(), mps_fire::i, and ncorner_.

227  {
228  if (co.uninitialized()) {
229  CornersVec& corners(co);
230  Pt3DVec lc;
231  Tr3D tr;
232  getTransform(tr, &lc);
233 
234  for (unsigned int i(0); i != ncorner_; ++i) {
235  const Pt3D corn(tr * lc[i]);
236  corners[i] = GlobalPoint(corn.x(), corn.y(), corn.z());
237  }
238  }
239 }
EZArrayFL< GlobalPoint > CornersVec
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
__host__ __device__ VT * co
Definition: prefixScan.h:47
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:183
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::Pt3DVec Pt3DVec
CaloCellGeometry::Tr3D Tr3D

◆ localCorners()

void FlatHexagon::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 154 of file FlatHexagon.cc.

References cms::cuda::assert(), dz(), k_dZ, k_r, k_R, ncorner_, oneBySix_, MetAnalyzer::pv(), dttmaxenums::R, and alignCSCRings::r.

Referenced by createCorners(), getTransform(), HGCalGeometry::localCorners(), and vocalCorners().

154  {
155  assert(nullptr != pv);
156  assert(ncorner_ == lc.size());
157 
159  const CCGFloat r(pv[FlatHexagon::k_r]);
160  const CCGFloat R(pv[FlatHexagon::k_R]);
161 
162  lc[0] = Pt3D(0, -2 * R, -dz); // (0,-,-)
163  lc[1] = Pt3D(-r, -R, -dz); // (-,-,-)
164  lc[2] = Pt3D(-r, R, -dz); // (-,+,-)
165  lc[3] = Pt3D(0, 2 * R, -dz); // (0,+,-)
166  lc[4] = Pt3D(r, R, -dz); // (+,+,-)
167  lc[5] = Pt3D(r, -R, -dz); // (+,-,-)
168  lc[6] = Pt3D(0, -2 * R, dz); // (0,-,+)
169  lc[7] = Pt3D(-r, -R, dz); // (-,-,+)
170  lc[8] = Pt3D(-r, R, dz); // (-,+,+)
171  lc[9] = Pt3D(0, 2 * R, dz); // (0,+,+)
172  lc[10] = Pt3D(r, R, dz); // (+,+,+)
173  lc[11] = Pt3D(r, -R, dz); // (+,-,+)
174 
175  ref = oneBySix_ * (lc[0] + lc[1] + lc[2] + lc[3] + lc[4] + lc[5]);
176 #ifdef EDM_ML_DEBUG
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];
180 #endif
181 }
Log< level::Info, true > LogVerbatim
assert(be >=bs)
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
float dz() const
Definition: FlatHexagon.h:56
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::CCGFloat CCGFloat
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
static constexpr double oneBySix_
Definition: FlatHexagon.h:80

◆ makeAxis()

GlobalVector FlatHexagon::makeAxis ( void  )
private

Definition at line 241 of file FlatHexagon.cc.

References backCtr(), getPosition(), and Vector3DBase< T, FrameTag >::unit().

Referenced by FlatHexagon().

241 { return GlobalVector(backCtr() - getPosition()).unit(); }
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatHexagon.h:49
GlobalPoint backCtr(void) const
Definition: FlatHexagon.cc:243
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ operator=()

FlatHexagon & FlatHexagon::operator= ( const FlatHexagon tr)

Definition at line 30 of file FlatHexagon.cc.

References etaPos(), m_axis, m_corOne, m_global, m_local, m_tr, and phiPos().

30  {
31  CaloCellGeometry::operator=(tr);
32  if (this != &tr) {
33  m_axis = tr.m_axis;
34  m_corOne = tr.m_corOne;
35  m_local = tr.m_local;
36  m_global = tr.m_global;
37  m_tr = tr.m_tr;
38  }
39 #ifdef EDM_ML_DEBUG
40  edm::LogVerbatim("CaloGeometry") << "FlatHexagon(Copy): Local " << m_local << " Global " << m_global << " eta "
41  << etaPos() << " phi " << phiPos() << " Translation " << m_tr.getTranslation()
42  << " and rotation " << m_tr.getRotation();
43 #endif
44  return *this;
45 }
Log< level::Info, true > LogVerbatim
Pt3D m_corOne
Definition: FlatHexagon.h:91
float phiPos() const override
Definition: FlatHexagon.h:52
float etaPos() const override
Definition: FlatHexagon.h:51
GlobalVector m_axis
Definition: FlatHexagon.h:90
Pt3D m_local
Definition: FlatHexagon.h:91
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ phiPos()

float FlatHexagon::phiPos ( ) const
inlineoverridevirtual

Reimplemented from CaloCellGeometry.

Definition at line 52 of file FlatHexagon.h.

References m_global, and PV3DBase< T, PVType, FrameType >::phi().

Referenced by FlatHexagon(), operator<<(), and operator=().

52 { return m_global.phi(); }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ phiSpan()

float FlatHexagon::phiSpan ( ) const
overridevirtual

Reimplemented from CaloCellGeometry.

Definition at line 111 of file FlatHexagon.cc.

References cms::cuda::assert(), HLT_2022v12_cff::dPhi, k_r, m_global, SiStripPI::max, CaloCellGeometry::param(), PV3DBase< T, PVType, FrameType >::perp(), and tolmin.

111  {
112  assert(param() != nullptr);
113  float dPhi = 2.0 * std::atan(param()[k_r] / std::max(tolmin, m_global.perp()));
114  return dPhi;
115 }
T perp() const
Definition: PV3DBase.h:69
assert(be >=bs)
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
static const float tolmin
Definition: FlatHexagon.cc:21
const CCGFloat * param() const
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ setPosition()

void FlatHexagon::setPosition ( const GlobalPoint p)
inline

Definition at line 75 of file FlatHexagon.h.

References m_global, AlCaHLTBitMon_ParallelJobs::p, and CaloCellGeometry::setRefPoint().

75  {
76  m_global = p;
77  setRefPoint(p);
78  }
void setRefPoint(const GlobalPoint &pos)
GlobalPoint m_global
Definition: FlatHexagon.h:92

◆ vocalCorners()

void FlatHexagon::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 132 of file FlatHexagon.cc.

References localCorners(), and MetAnalyzer::pv().

132 { localCorners(vec, pv, ref); }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
def pv(vc)
Definition: MetAnalyzer.py:7

◆ zPos()

float FlatHexagon::zPos ( ) const
inline

Definition at line 55 of file FlatHexagon.h.

References m_global, and PV3DBase< T, PVType, FrameType >::z().

55 { return m_global.z(); }
T z() const
Definition: PV3DBase.h:61
GlobalPoint m_global
Definition: FlatHexagon.h:92

Member Data Documentation

◆ k_dZ

constexpr uint32_t FlatHexagon::k_dZ = 0
static

◆ k_r

constexpr uint32_t FlatHexagon::k_r = 1
static

◆ k_R

constexpr uint32_t FlatHexagon::k_R = 2
static

◆ m_axis

GlobalVector FlatHexagon::m_axis
private

Definition at line 90 of file FlatHexagon.h.

Referenced by axis(), FlatHexagon(), getPhiAxis(), getThetaAxis(), and operator=().

◆ m_corOne

Pt3D FlatHexagon::m_corOne
private

Definition at line 91 of file FlatHexagon.h.

Referenced by getTransform(), and operator=().

◆ m_global

GlobalPoint FlatHexagon::m_global
private

◆ m_local

Pt3D FlatHexagon::m_local
private

Definition at line 91 of file FlatHexagon.h.

Referenced by backCtr(), FlatHexagon(), and operator=().

◆ m_tr

Tr3D FlatHexagon::m_tr
private

Definition at line 93 of file FlatHexagon.h.

Referenced by backCtr(), FlatHexagon(), getLocal(), getPosition(), and operator=().

◆ ncorner_

constexpr unsigned int FlatHexagon::ncorner_ = 12
static

◆ ncornerBy2_

constexpr unsigned int FlatHexagon::ncornerBy2_ = 6
static

◆ oneBySix_

constexpr double FlatHexagon::oneBySix_ = 1.0 / 6.0
static