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  FlatHexagon( void );
29 
30  FlatHexagon( const FlatHexagon& tr ) ;
31 
32  FlatHexagon& operator=( const FlatHexagon& tr ) ;
33 
34  FlatHexagon( CornersMgr* cMgr ,
35  const GlobalPoint& fCtr ,
36  const GlobalPoint& bCtr ,
37  const GlobalPoint& cor1 ,
38  const CCGFloat* parV ) ;
39 
40  FlatHexagon( const CornersVec& corn ,
41  const CCGFloat* par ) ;
42 
43  FlatHexagon( const FlatHexagon& tr, const Pt3D& local) ;
44 
45  ~FlatHexagon() override ;
46 
47  GlobalPoint const & getPosition() const override { return m_global; }
48  GlobalPoint getPosition( const Pt3D& local ) const override;
49  virtual float etaPos() const { return m_global.eta(); }
50  virtual float phiPos() const { return m_global.phi(); }
51  Pt3D getLocal( const GlobalPoint& global ) const;
52 
53  // Return thetaAxis polar angle of axis of the crystal
54  CCGFloat getThetaAxis() const ;
55 
56  // Return phiAxis azimuthal angle of axis of the crystal
57  CCGFloat getPhiAxis() const ;
58 
59  void vocalCorners( Pt3DVec& vec ,
60  const CCGFloat* pv ,
61  Pt3D& ref ) const override;
62 
63  const GlobalVector& axis() const ;
64 
65  static void createCorners( const std::vector<CCGFloat>& pv ,
66  const Tr3D& tr ,
67  std::vector<GlobalPoint>& co ) ;
68 
69  static void localCorners( Pt3DVec& vec ,
70  const CCGFloat* pv ,
71  Pt3D& ref ) ;
72 
73  void getTransform( Tr3D& tr, Pt3DVec* lptr ) const override;
74 
75  void setPosition ( const GlobalPoint& p ) { m_global = p; setRefPoint(p); }
76 
77  static constexpr double oneBySix_ = 1.0/6.0;
78  static constexpr unsigned int ncorner_ = 12;
79  static constexpr unsigned int ncornerBy2_ = 6;
80 
81 private:
82 
83  void initCorners(CornersVec& ) override;
84 
85  GlobalVector makeAxis( void );
86 
87  GlobalPoint backCtr( void ) const;
91  Tr3D m_tr;
92 };
93 
94 std::ostream& operator<<( std::ostream& s, const FlatHexagon& cell ) ;
95 
96 #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:89
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:88
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:89
#define constexpr
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatHexagon.cc:175
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:78
CaloCellGeometry::Pt3D Pt3D
Definition: FlatHexagon.h:24
void setPosition(const GlobalPoint &p)
Definition: FlatHexagon.h:75
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatHexagon.h:23
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatHexagon.cc:146
virtual float phiPos() const
Definition: FlatHexagon.h:50
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:6
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatHexagon.h:47
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:49
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:79
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:77
GlobalPoint m_global
Definition: FlatHexagon.h:90
CCGFloat getThetaAxis() const
Definition: FlatHexagon.cc:134