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:
22 
27 
28  static constexpr uint32_t k_dZ = 0;//Half-length along the z-axis
29  static constexpr uint32_t k_r = 1;//Half length along x-axis
30  static constexpr uint32_t k_R = 2;//Quarter of maximum dimension along y
31 
32  FlatHexagon( void );
33 
34  FlatHexagon( const FlatHexagon& tr ) ;
35 
36  FlatHexagon& operator=( const FlatHexagon& tr ) ;
37 
38  FlatHexagon( CornersMgr* cMgr ,
39  const GlobalPoint& fCtr ,
40  const GlobalPoint& bCtr ,
41  const GlobalPoint& cor1 ,
42  const CCGFloat* parV ) ;
43 
44  FlatHexagon( const CornersVec& corn ,
45  const CCGFloat* par ) ;
46 
47  FlatHexagon( const FlatHexagon& tr, const Pt3D& local) ;
48 
49  ~FlatHexagon() override ;
50 
51  GlobalPoint const & getPosition() const override { return m_global; }
52  GlobalPoint getPosition( const Pt3D& local ) const override;
53  virtual float etaPos() const { return m_global.eta(); }
54  virtual float phiPos() const { return m_global.phi(); }
55  Pt3D getLocal( const GlobalPoint& global ) const;
56 
57  // Return thetaAxis polar angle of axis of the crystal
58  CCGFloat getThetaAxis() const ;
59 
60  // Return phiAxis azimuthal angle of axis of the crystal
61  CCGFloat getPhiAxis() const ;
62 
63  void vocalCorners( Pt3DVec& vec ,
64  const CCGFloat* pv ,
65  Pt3D& ref ) const override;
66 
67  const GlobalVector& axis() const ;
68 
69  static void createCorners( const std::vector<CCGFloat>& pv ,
70  const Tr3D& tr ,
71  std::vector<GlobalPoint>& co ) ;
72 
73  static void localCorners( Pt3DVec& vec ,
74  const CCGFloat* pv ,
75  Pt3D& ref ) ;
76 
77  void getTransform( Tr3D& tr, Pt3DVec* lptr ) const override;
78 
79  void setPosition ( const GlobalPoint& p ) { m_global = p; setRefPoint(p); }
80 
81  static constexpr double oneBySix_ = 1.0/6.0;
82  static constexpr unsigned int ncorner_ = 12;
83  static constexpr unsigned int ncornerBy2_ = 6;
84 
85 private:
86 
87  void initCorners(CornersVec& ) override;
88 
89  GlobalVector makeAxis( void );
90 
91  GlobalPoint backCtr( void ) const;
95  Tr3D m_tr;
96 };
97 
98 std::ostream& operator<<( std::ostream& s, const FlatHexagon& cell ) ;
99 
100 #endif
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatHexagon.cc:152
Pt3D m_corOne
Definition: FlatHexagon.h:93
void setRefPoint(const GlobalPoint &pos)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalVector makeAxis(void)
Definition: FlatHexagon.cc:269
CaloCellGeometry::Tr3D Tr3D
Definition: FlatHexagon.h:26
HepGeom::Transform3D Tr3D
GlobalVector m_axis
Definition: FlatHexagon.h:92
std::ostream & operator<<(std::ostream &s, const FlatHexagon &cell)
Definition: FlatHexagon.cc:285
std::vector< Pt3D > Pt3DVec
const GlobalVector & axis() const
Definition: FlatHexagon.cc:142
Pt3D m_local
Definition: FlatHexagon.h:93
#define constexpr
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:175
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:82
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:24
void setPosition(const GlobalPoint &p)
Definition: FlatHexagon.h:79
static constexpr uint32_t k_R
Definition: FlatHexagon.h:30
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatHexagon.h:23
static constexpr uint32_t k_r
Definition: FlatHexagon.h:29
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatHexagon.cc:146
virtual float phiPos() const
Definition: FlatHexagon.h:54
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatHexagon.cc:209
FlatHexagon(void)
Definition: FlatHexagon.cc:23
FlatHexagon & operator=(const FlatHexagon &tr)
Definition: FlatHexagon.cc:32
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:51
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: FlatHexagon.h:25
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatHexagon.cc:123
void initCorners(CornersVec &) override
Definition: FlatHexagon.cc:254
virtual float etaPos() const
Definition: FlatHexagon.h:53
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:83
static constexpr uint32_t k_dZ
Definition: FlatHexagon.h:28
CCGFloat getPhiAxis() const
Definition: FlatHexagon.cc:138
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
T eta() const
Definition: PV3DBase.h:76
GlobalPoint backCtr(void) const
Definition: FlatHexagon.cc:273
~FlatHexagon() override
Definition: FlatHexagon.cc:104
static constexpr double oneBySix_
Definition: FlatHexagon.h:81
GlobalPoint m_global
Definition: FlatHexagon.h:94
CCGFloat getThetaAxis() const
Definition: FlatHexagon.cc:134