CMS 3D CMS Logo

FlatTrd.h
Go to the documentation of this file.
1 #ifndef GeometryCaloGeometryFlatTrd_h
2 #define GeometryCaloGeometryFlatTrd_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 <vector>
10 
19 class FlatTrd : public CaloCellGeometry {
20 public:
21 
26 
27  static constexpr uint32_t k_dZ = 0;//Half-length along the z-axis
28  static constexpr uint32_t k_Theta= 1;//Polar angle of the line joining the
29  //centres of the faces at -/+ dZ
30  static constexpr uint32_t k_Phi = 2;//Azimuthal angle of the line joing the
31  //centres of the faces at -/+ dZ
32  static constexpr uint32_t k_dY1 = 3;//Half-length along y of the face at -dZ
33  static constexpr uint32_t k_dX1 = 4;//Half-length along x of the side at
34  //y=-dY1 of the face at -dZ
35  static constexpr uint32_t k_dX2 = 5;//Half-length along x of the side at
36  //y=+dY1 of the face at -dZ
37  static constexpr uint32_t k_Alp1 = 6;//Angle w.r.t the y axis from the center
38  //of the sides at y=-dY1 to at y=+dY1
39  static constexpr uint32_t k_dY2 = 7;//Half-length along y of the face at +dZ
40  static constexpr uint32_t k_dX3 = 8;//Half-length along x of the side at
41  //y=-dY2 of the face at +dZ
42  static constexpr uint32_t k_dX4 = 9;//Half-length along x of the side at
43  //y=+dY2 of the face at +dZ
44  static constexpr uint32_t k_Alp2 =10;//Angle w.r.t the y axis from the center
45  //of the sides at y=-dY2 to at y=+dY2
46  static constexpr uint32_t k_Cell =11;//Cell size
47  //Assumes dY2=dY1; dX3=dX1; dX4=dX2; Alp2=Alp1=Theta=Phi=0
48 
49  FlatTrd( void );
50 
51  FlatTrd( const FlatTrd& tr ) ;
52 
53  FlatTrd& operator=( const FlatTrd& tr ) ;
54 
55  FlatTrd( CornersMgr* cMgr ,
56  const GlobalPoint& fCtr ,
57  const GlobalPoint& bCtr ,
58  const GlobalPoint& cor1 ,
59  const CCGFloat* parV ) ;
60 
61  FlatTrd( const CornersVec& corn ,
62  const CCGFloat* par ) ;
63 
64  FlatTrd( const FlatTrd& tr, const Pt3D& local) ;
65 
66  ~FlatTrd() override ;
67 
68  GlobalPoint const & getPosition() const override { return m_global; }
69  GlobalPoint getPosition( const Pt3D& local ) const override;
70  virtual float etaPos() const { return m_global.eta(); }
71  virtual float phiPos() const { return m_global.phi(); }
72  Pt3D getLocal( const GlobalPoint& global ) const;
73 
74  // Return thetaAxis polar angle of axis of the crystal
75  CCGFloat getThetaAxis() const ;
76 
77  // Return phiAxis azimuthal angle of axis of the crystal
78  CCGFloat getPhiAxis() const ;
79 
80  void vocalCorners( Pt3DVec& vec ,
81  const CCGFloat* pv ,
82  Pt3D& ref ) const override;
83 
84  const GlobalVector& axis() const ;
85 
86  static void createCorners( const std::vector<CCGFloat>& pv ,
87  const Tr3D& tr ,
88  std::vector<GlobalPoint>& co ) ;
89 
90  static void localCorners( Pt3DVec& vec ,
91  const CCGFloat* pv ,
92  Pt3D& ref ) ;
93 
94  void getTransform( Tr3D& tr, Pt3DVec* lptr ) const override;
95 
96  void setPosition ( const GlobalPoint& p ) { m_global = p; setRefPoint(p); }
97 
98  static constexpr unsigned int ncorner_ = 8;
99  static constexpr unsigned int ncornerBy2_ = 4;
100 
101 private:
102 
103  void initCorners(CornersVec& ) override;
104 
105  GlobalVector makeAxis( void );
106 
107  GlobalPoint backCtr( void ) const;
111  Tr3D m_tr;
112 };
113 
114 std::ostream& operator<<( std::ostream& s, const FlatTrd& cell ) ;
115 
116 #endif
const GlobalVector & axis() const
Definition: FlatTrd.cc:142
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
FlatTrd & operator=(const FlatTrd &tr)
Definition: FlatTrd.cc:32
static constexpr unsigned int ncornerBy2_
Definition: FlatTrd.h:99
CaloCellGeometry::Pt3D Pt3D
Definition: FlatTrd.h:23
void setRefPoint(const GlobalPoint &pos)
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatTrd.h:68
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
static constexpr uint32_t k_Theta
Definition: FlatTrd.h:28
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: FlatTrd.h:24
HepGeom::Transform3D Tr3D
static constexpr uint32_t k_Cell
Definition: FlatTrd.h:46
std::vector< Pt3D > Pt3DVec
static constexpr uint32_t k_dY1
Definition: FlatTrd.h:32
Tr3D m_tr
Definition: FlatTrd.h:111
void setPosition(const GlobalPoint &p)
Definition: FlatTrd.h:96
std::ostream & operator<<(std::ostream &s, const FlatTrd &cell)
Definition: FlatTrd.cc:283
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:98
Pt3D m_local
Definition: FlatTrd.h:109
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatTrd.cc:146
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatTrd.h:22
static constexpr uint32_t k_dX1
Definition: FlatTrd.h:33
def pv(vc)
Definition: MetAnalyzer.py:7
static constexpr uint32_t k_dY2
Definition: FlatTrd.h:39
GlobalPoint backCtr(void) const
Definition: FlatTrd.cc:271
static constexpr uint32_t k_dX4
Definition: FlatTrd.h:42
Pt3D m_corOne
Definition: FlatTrd.h:109
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:175
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatTrd.cc:207
~FlatTrd() override
Definition: FlatTrd.cc:104
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatTrd.cc:123
GlobalVector makeAxis(void)
Definition: FlatTrd.cc:267
static constexpr uint32_t k_Phi
Definition: FlatTrd.h:30
void initCorners(CornersVec &) override
Definition: FlatTrd.cc:252
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatTrd.cc:152
T eta() const
Definition: PV3DBase.h:76
GlobalPoint m_global
Definition: FlatTrd.h:110
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:27
CaloCellGeometry::Tr3D Tr3D
Definition: FlatTrd.h:25
CCGFloat getThetaAxis() const
Definition: FlatTrd.cc:134
virtual float phiPos() const
Definition: FlatTrd.h:71
static constexpr uint32_t k_Alp1
Definition: FlatTrd.h:37
virtual float etaPos() const
Definition: FlatTrd.h:70
static constexpr uint32_t k_dX3
Definition: FlatTrd.h:40
FlatTrd(void)
Definition: FlatTrd.cc:23
CCGFloat getPhiAxis() const
Definition: FlatTrd.cc:138
#define constexpr
static constexpr uint32_t k_dX2
Definition: FlatTrd.h:35
GlobalVector m_axis
Definition: FlatTrd.h:108
static constexpr uint32_t k_Alp2
Definition: FlatTrd.h:44