Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:39

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