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