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
float phiSpan() const override
Definition: FlatHexagon.cc:111
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatHexagon.cc:134
Pt3D m_corOne
Definition: FlatHexagon.h:91
void setRefPoint(const GlobalPoint &pos)
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatHexagon.cc:132
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
float phiPos() const override
Definition: FlatHexagon.h:52
GlobalVector makeAxis(void)
Definition: FlatHexagon.cc:241
float etaSpan() const override
Definition: FlatHexagon.cc:101
float etaPos() const override
Definition: FlatHexagon.h:51
CaloCellGeometry::Tr3D Tr3D
Definition: FlatHexagon.h:25
HepGeom::Transform3D Tr3D
GlobalVector m_axis
Definition: FlatHexagon.h:90
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
Definition: FlatHexagon.cc:255
std::vector< Pt3D > Pt3DVec
__host__ __device__ VT * co
Definition: prefixScan.h:47
Pt3D m_local
Definition: FlatHexagon.h:91
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
void setPosition(const GlobalPoint &p)
Definition: FlatHexagon.h:75
static constexpr uint32_t k_R
Definition: FlatHexagon.h:29
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatHexagon.h:22
static constexpr uint32_t k_r
Definition: FlatHexagon.h:28
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:183
CCGFloat getPhiAxis() const
Definition: FlatHexagon.cc:128
float dz() const
Definition: FlatHexagon.h:56
FlatHexagon(void)
Definition: FlatHexagon.cc:25
FlatHexagon & operator=(const FlatHexagon &tr)
Definition: FlatHexagon.cc:30
const GlobalVector & axis() const
Definition: FlatHexagon.cc:130
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: FlatHexagon.h:24
void initCorners(CornersVec &) override
Definition: FlatHexagon.cc:227
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
CaloCellGeometry::Pt3D Pt3D
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:82
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
CaloCellGeometry::Tr3D Tr3D
float zPos() const
Definition: FlatHexagon.h:55
CCGFloat getThetaAxis() const
Definition: FlatHexagon.cc:126
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatHexagon.cc:117
~FlatHexagon() override
Definition: FlatHexagon.cc:87
const CCGFloat * param() const
static constexpr double oneBySix_
Definition: FlatHexagon.h:80
GlobalPoint m_global
Definition: FlatHexagon.h:92