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  virtual float etaPos() const { return m_global.eta(); }
69  virtual float phiPos() const { return m_global.phi(); }
70  Pt3D getLocal(const GlobalPoint& global) const;
71 
72  // Return thetaAxis polar angle of axis of the crystal
73  CCGFloat getThetaAxis() const;
74 
75  // Return phiAxis azimuthal angle of axis of the crystal
76  CCGFloat getPhiAxis() const;
77 
78  void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const override;
79 
80  const GlobalVector& axis() const;
81 
82  static void createCorners(const std::vector<CCGFloat>& pv, const Tr3D& tr, std::vector<GlobalPoint>& co);
83 
84  static void localCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
85 
86  void getTransform(Tr3D& tr, Pt3DVec* lptr) const override;
87 
88  void setPosition(const GlobalPoint& p) {
89  m_global = p;
90  setRefPoint(p);
91  }
92 
93  static constexpr unsigned int ncorner_ = 8;
94  static constexpr unsigned int ncornerBy2_ = 4;
95 
96 private:
97  void initCorners(CornersVec&) override;
98 
99  GlobalVector makeAxis(void);
100 
101  GlobalPoint backCtr(void) const;
105  Tr3D m_tr;
106 };
107 
108 std::ostream& operator<<(std::ostream& s, const FlatTrd& cell);
109 
110 #endif
const GlobalVector & axis() const
Definition: FlatTrd.cc:112
A base class to handle the particular shape of HGCal volumes.
Definition: FlatTrd.h:19
FlatTrd & operator=(const FlatTrd &tr)
Definition: FlatTrd.cc:28
static constexpr unsigned int ncornerBy2_
Definition: FlatTrd.h:94
CaloCellGeometry::Pt3D Pt3D
Definition: FlatTrd.h:22
void setRefPoint(const GlobalPoint &pos)
GlobalPoint const & getPosition() const override
Returns the position of reference for this cell.
Definition: FlatTrd.h:66
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
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:105
void setPosition(const GlobalPoint &p)
Definition: FlatTrd.h:88
std::ostream & operator<<(std::ostream &s, const FlatTrd &cell)
Definition: FlatTrd.cc:235
static constexpr unsigned int ncorner_
Definition: FlatTrd.h:93
Pt3D m_local
Definition: FlatTrd.h:103
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: FlatTrd.cc:114
CaloCellGeometry::CCGFloat CCGFloat
Definition: FlatTrd.h:21
static constexpr uint32_t k_dX1
Definition: FlatTrd.h:32
def pv(vc)
Definition: MetAnalyzer.py:7
static constexpr uint32_t k_dY2
Definition: FlatTrd.h:38
GlobalPoint backCtr(void) const
Definition: FlatTrd.cc:224
static constexpr uint32_t k_dX4
Definition: FlatTrd.h:41
Pt3D m_corOne
Definition: FlatTrd.h:103
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: FlatTrd.cc:136
void getTransform(Tr3D &tr, Pt3DVec *lptr) const override
--------— only needed by specific utility; overloaded when needed -—
Definition: FlatTrd.cc:164
~FlatTrd() override
Definition: FlatTrd.cc:85
Pt3D getLocal(const GlobalPoint &global) const
Definition: FlatTrd.cc:99
GlobalVector makeAxis(void)
Definition: FlatTrd.cc:222
static constexpr uint32_t k_Phi
Definition: FlatTrd.h:29
void initCorners(CornersVec &) override
Definition: FlatTrd.cc:208
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:116
T eta() const
Definition: PV3DBase.h:73
GlobalPoint m_global
Definition: FlatTrd.h:104
static constexpr uint32_t k_dZ
Definition: FlatTrd.h:26
CaloCellGeometry::Tr3D Tr3D
Definition: FlatTrd.h:24
CCGFloat getThetaAxis() const
Definition: FlatTrd.cc:108
virtual float phiPos() const
Definition: FlatTrd.h:69
static constexpr uint32_t k_Alp1
Definition: FlatTrd.h:36
virtual float etaPos() const
Definition: FlatTrd.h:68
static constexpr uint32_t k_dX3
Definition: FlatTrd.h:39
FlatTrd(void)
Definition: FlatTrd.cc:23
CCGFloat getPhiAxis() const
Definition: FlatTrd.cc:110
#define constexpr
static constexpr uint32_t k_dX2
Definition: FlatTrd.h:34
GlobalVector m_axis
Definition: FlatTrd.h:102
static constexpr uint32_t k_Alp2
Definition: FlatTrd.h:43