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  virtual float etaPos() const { return m_global.eta(); }
52  virtual float phiPos() const { return m_global.phi(); }
53  Pt3D getLocal(const GlobalPoint& global) const;
54 
55  // Return thetaAxis polar angle of axis of the crystal
56  CCGFloat getThetaAxis() const;
57 
58  // Return phiAxis azimuthal angle of axis of the crystal
59  CCGFloat getPhiAxis() const;
60 
61  void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const override;
62 
63  const GlobalVector& axis() const;
64 
65  static void createCorners(const std::vector<CCGFloat>& pv, const Tr3D& tr, std::vector<GlobalPoint>& co);
66 
67  static void localCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
68 
69  void getTransform(Tr3D& tr, Pt3DVec* lptr) const override;
70 
71  void setPosition(const GlobalPoint& p) {
72  m_global = p;
73  setRefPoint(p);
74  }
75 
76  static constexpr double oneBySix_ = 1.0 / 6.0;
77  static constexpr unsigned int ncorner_ = 12;
78  static constexpr unsigned int ncornerBy2_ = 6;
79 
80 private:
81  void initCorners(CornersVec&) override;
82 
83  GlobalVector makeAxis(void);
84 
85  GlobalPoint backCtr(void) const;
89  Tr3D m_tr;
90 };
91 
92 std::ostream& operator<<(std::ostream& s, const FlatHexagon& cell);
93 
94 #endif
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatHexagon.cc:116
Pt3D m_corOne
Definition: FlatHexagon.h:87
void setRefPoint(const GlobalPoint &pos)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
GlobalVector makeAxis(void)
Definition: FlatHexagon.cc:223
CaloCellGeometry::Tr3D Tr3D
Definition: FlatHexagon.h:25
HepGeom::Transform3D Tr3D
GlobalVector m_axis
Definition: FlatHexagon.h:86
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
Definition: FlatHexagon.cc:237
std::vector< Pt3D > Pt3DVec
const GlobalVector & axis() const
Definition: FlatHexagon.cc:112
Pt3D m_local
Definition: FlatHexagon.h:87
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:136
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:77
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:23
void setPosition(const GlobalPoint &p)
Definition: FlatHexagon.h:71
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 vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatHexagon.cc:114
virtual float phiPos() const
Definition: FlatHexagon.h:52
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:165
FlatHexagon(void)
Definition: FlatHexagon.cc:23
FlatHexagon & operator=(const FlatHexagon &tr)
Definition: FlatHexagon.cc:28
A base class to handle the hexagonal shape of HGCal silicon volumes.
Definition: FlatHexagon.h:20
def pv(vc)
Definition: MetAnalyzer.py:7
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatHexagon.h:49
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: FlatHexagon.h:24
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatHexagon.cc:99
void initCorners(CornersVec &) override
Definition: FlatHexagon.cc:209
virtual float etaPos() const
Definition: FlatHexagon.h:51
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:78
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:27
CCGFloat getPhiAxis() const
Definition: FlatHexagon.cc:110
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
T eta() const
Definition: PV3DBase.h:73
GlobalPoint backCtr(void) const
Definition: FlatHexagon.cc:225
~FlatHexagon() override
Definition: FlatHexagon.cc:85
#define constexpr
static constexpr double oneBySix_
Definition: FlatHexagon.h:76
GlobalPoint m_global
Definition: FlatHexagon.h:88
CCGFloat getThetaAxis() const
Definition: FlatHexagon.cc:108