Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:14:16

0001 #ifndef TruncatedPyramid_h
0002 #define TruncatedPyramid_h
0003 
0004 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0005 #include <CLHEP/Geometry/Point3D.h>
0006 #include <CLHEP/Geometry/Plane3D.h>
0007 #include <CLHEP/Geometry/Vector3D.h>
0008 #include <CLHEP/Geometry/Transform3D.h>
0009 #include <vector>
0010 #include <cstdint>
0011 
0012 /**
0013 
0014    \class TruncatedPyramid
0015 
0016    \brief A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code
0017    
0018 */
0019 
0020 class TruncatedPyramid final : public CaloCellGeometry {
0021 public:
0022   typedef CaloCellGeometry::CCGFloat CCGFloat;
0023   typedef CaloCellGeometry::Pt3D Pt3D;
0024   typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0025   typedef CaloCellGeometry::Tr3D Tr3D;
0026 
0027   static constexpr uint32_t k_Dz = 0;     //Half-length along the z-axis
0028   static constexpr uint32_t k_Theta = 1;  //Polar angle of the line joining the
0029                                           //centres of the faces at -/+ Dz
0030   static constexpr uint32_t k_Phi = 2;    //Azimuthal angle of the line joing the
0031                                           //centres of the faces at -/+ Dz
0032   static constexpr uint32_t k_Dy1 = 3;    //Half-length along y of the face at -Dz
0033   static constexpr uint32_t k_Dx1 = 4;    //Half-length along x of the side at
0034                                           //y=-Dy1 of the face at -Dz
0035   static constexpr uint32_t k_Dx2 = 5;    //Half-length along x of the side at
0036                                           //y=+Dy1 of the face at -Dz
0037   static constexpr uint32_t k_Alp1 = 6;   //Angle w.r.t the y axis from the center
0038                                           //of the sides at y=-Dy1 to at y=+Dy1
0039   static constexpr uint32_t k_Dy2 = 7;    //Half-length along y of the face at +Dz
0040   static constexpr uint32_t k_Dx3 = 8;    //Half-length along x of the side at
0041                                           //y=-Dy2 of the face at +Dz
0042   static constexpr uint32_t k_Dx4 = 9;    //Half-length along x of the side at
0043                                           //y=+Dy2 of the face at +Dz
0044   static constexpr uint32_t k_Alp2 = 10;  //Angle w.r.t the y axis from the center
0045                                           //of the sides at y=-Dy2 to at y=+Dy2
0046 
0047   TruncatedPyramid(void);
0048 
0049   TruncatedPyramid(const TruncatedPyramid& tr);
0050 
0051   TruncatedPyramid& operator=(const TruncatedPyramid& tr);
0052 
0053   TruncatedPyramid(CornersMgr* cMgr,
0054                    const GlobalPoint& fCtr,
0055                    const GlobalPoint& bCtr,
0056                    const GlobalPoint& cor1,
0057                    const CCGFloat* parV);
0058 
0059   TruncatedPyramid(const CornersVec& corn, const CCGFloat* par);
0060 
0061   ~TruncatedPyramid() override;
0062 
0063   GlobalPoint getPosition(CCGFloat depth) const override;
0064 
0065   // Return thetaAxis polar angle of axis of the crystal
0066   CCGFloat getThetaAxis() const;
0067 
0068   // Return phiAxis azimuthal angle of axis of the crystal
0069   CCGFloat getPhiAxis() const;
0070 
0071   const GlobalVector& axis() const;
0072 
0073   // for geometry creation in other classes
0074   static void createCorners(const std::vector<CCGFloat>& pv, const Tr3D& tr, std::vector<GlobalPoint>& co);
0075 
0076   void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const override;
0077 
0078   static void localCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
0079 
0080   static void localCornersReflection(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
0081 
0082   static void localCornersSwap(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
0083 
0084   void getTransform(Tr3D& tr, Pt3DVec* lptr) const override;
0085 
0086 private:
0087   void initCorners(CornersVec&) override;
0088 
0089   GlobalVector makeAxis(void);
0090 
0091   const GlobalPoint backCtr(void) const;
0092   GlobalVector m_axis;
0093   Pt3D m_corOne;
0094 };
0095 
0096 std::ostream& operator<<(std::ostream& s, const TruncatedPyramid& cell);
0097 
0098 #endif