CMS 3D CMS Logo

FlatHexagon.h
Go to the documentation of this file.
1 #ifndef GeometryCaloGeometryFlatHexagon_h
2 #define GeometryCaloGeometryFlatHexagon_h
3 
5 #include <CLHEP/Geometry/Point3D.h>
6 #include <CLHEP/Geometry/Plane3D.h>
7 #include <CLHEP/Geometry/Vector3D.h>
8 #include <CLHEP/Geometry/Transform3D.h>
9 #include <cmath>
10 #include <vector>
11 
20 class FlatHexagon : public CaloCellGeometry {
21 public:
26 
27  static constexpr uint32_t k_dZ = 0; //Half-length along the z-axis
28  static constexpr uint32_t k_r = 1; //Half length along x-axis
29  static constexpr uint32_t k_R = 2; //Quarter of maximum dimension along y
30 
31  FlatHexagon(void);
32 
33  FlatHexagon(const FlatHexagon& tr);
34 
35  FlatHexagon& operator=(const FlatHexagon& tr);
36 
37  FlatHexagon(CornersMgr* cMgr,
38  const GlobalPoint& fCtr,
39  const GlobalPoint& bCtr,
40  const GlobalPoint& cor1,
41  const CCGFloat* parV);
42 
43  FlatHexagon(const CornersVec& corn, const CCGFloat* par);
44 
45  FlatHexagon(const FlatHexagon& tr, const Pt3D& local);
46 
47  ~FlatHexagon() override;
48 
49  GlobalPoint const& getPosition() const override { return m_global; }
50  GlobalPoint getPosition(const Pt3D& local) const override;
51  float etaPos() const override { return m_global.eta(); }
52  float phiPos() const override { return m_global.phi(); }
53  float etaSpan() const override;
54  float phiSpan() const override;
55  float zPos() const { return m_global.z(); }
56  float dz() const { return param()[k_dZ]; }
57  Pt3D getLocal(const GlobalPoint& global) const;
58 
59  // Return thetaAxis polar angle of axis of the crystal
60  CCGFloat getThetaAxis() const;
61 
62  // Return phiAxis azimuthal angle of axis of the crystal
63  CCGFloat getPhiAxis() const;
64 
65  void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const override;
66 
67  const GlobalVector& axis() const;
68 
69  static void createCorners(const std::vector<CCGFloat>& pv, const Tr3D& tr, std::vector<GlobalPoint>& co);
70 
71  static void localCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
72 
73  void getTransform(Tr3D& tr, Pt3DVec* lptr) const override;
74 
75  void setPosition(const GlobalPoint& p) {
76  m_global = p;
77  setRefPoint(p);
78  }
79 
80  static constexpr double oneBySix_ = 1.0 / 6.0;
81  static constexpr unsigned int ncorner_ = 12;
82  static constexpr unsigned int ncornerBy2_ = 6;
83 
84 private:
85  void initCorners(CornersVec&) override;
86 
87  GlobalVector makeAxis(void);
88 
89  GlobalPoint backCtr(void) const;
94 };
95 
96 std::ostream& operator<<(std::ostream& s, const FlatHexagon& cell);
97 
98 #endif
CaloCellGeometry::Tr3D
HepGeom::Transform3D Tr3D
Definition: CaloCellGeometry.h:53
Vector3DBase
Definition: Vector3DBase.h:8
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
FlatHexagon::getLocal
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatHexagon.cc:117
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
FlatHexagon::~FlatHexagon
~FlatHexagon() override
Definition: FlatHexagon.cc:87
FlatHexagon::Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: FlatHexagon.h:25
FlatHexagon::m_global
GlobalPoint m_global
Definition: FlatHexagon.h:92
FlatHexagon::phiPos
float phiPos() const override
Definition: FlatHexagon.h:52
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FlatHexagon::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:154
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
FlatHexagon::m_tr
Tr3D m_tr
Definition: FlatHexagon.h:93
FlatHexagon::m_corOne
Pt3D m_corOne
Definition: FlatHexagon.h:91
FlatHexagon::m_local
Pt3D m_local
Definition: FlatHexagon.h:91
EZArrayFL< GlobalPoint >
FlatHexagon::etaPos
float etaPos() const override
Definition: FlatHexagon.h:51
FlatHexagon::getTransform
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:183
FlatHexagon::k_r
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
FlatHexagon::vocalCorners
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatHexagon.cc:132
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: CaloCellGeometry.cc:5
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FlatHexagon::makeAxis
GlobalVector makeAxis(void)
Definition: FlatHexagon.cc:241
FlatHexagon::etaSpan
float etaSpan() const override
Definition: FlatHexagon.cc:101
cms::cuda::co
__host__ __device__ VT * co
Definition: prefixScan.h:47
FlatHexagon::setPosition
void setPosition(const GlobalPoint &p)
Definition: FlatHexagon.h:75
FlatHexagon::ncorner_
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
FlatHexagon::getPhiAxis
CCGFloat getPhiAxis() const
Definition: FlatHexagon.cc:128
FlatHexagon::dz
float dz() const
Definition: FlatHexagon.h:56
FlatHexagon::m_axis
GlobalVector m_axis
Definition: FlatHexagon.h:90
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
FlatHexagon
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
Point3DBase< float, GlobalTag >
FlatHexagon::k_R
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
FlatHexagon::ncornerBy2_
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:82
FlatHexagon::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
FlatHexagon::initCorners
void initCorners(CornersVec &) override
Definition: FlatHexagon.cc:227
FlatHexagon::operator=
FlatHexagon & operator=(const FlatHexagon &tr)
Definition: FlatHexagon.cc:30
FlatHexagon::axis
const GlobalVector & axis() const
Definition: FlatHexagon.cc:130
FlatHexagon::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatHexagon.h:22
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
FlatHexagon::FlatHexagon
FlatHexagon(void)
Definition: FlatHexagon.cc:25
FlatHexagon::getPosition
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatHexagon.h:49
FlatHexagon::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: FlatHexagon.h:24
CaloCellGeometry.h
FlatHexagon::k_dZ
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
CaloCellGeometry::setRefPoint
void setRefPoint(const GlobalPoint &pos)
Definition: CaloCellGeometry.h:130
FlatHexagon::backCtr
GlobalPoint backCtr(void) const
Definition: FlatHexagon.cc:243
FlatHexagon::zPos
float zPos() const
Definition: FlatHexagon.h:55
operator<<
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
Definition: FlatHexagon.cc:255
FlatHexagon::oneBySix_
static constexpr double oneBySix_
Definition: FlatHexagon.h:80
FlatHexagon::createCorners
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatHexagon.cc:134
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
FlatHexagon::phiSpan
float phiSpan() const override
Definition: FlatHexagon.cc:111
EZMgrFL
Definition: EZMgrFL.h:8
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
FlatHexagon::getThetaAxis
CCGFloat getThetaAxis() const
Definition: FlatHexagon.cc:126