Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef GEOMETRY_CALOGEOMETRY_IDEALZPRISM_H
0002 #define GEOMETRY_CALOGEOMETRY_IDEALZPRISM_H 1
0003 
0004 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0005 #include <memory>
0006 
0007 /** \class IdealZPrism
0008     
0009 Prism class used for HF volumes.  HF volumes are prisms with axes along the Z direction whose
0010 face shapes are set by 
0011 
0012 Required parameters for an ideal Z prism:
0013 
0014 - eta, phi of axis
0015 - Z location of front and back faces
0016 - eta width and phi width of frontface
0017 
0018 Total: 6 parameters
0019 
0020 Internally, the "point of reference" is the center (eta/phi) of the
0021 front face of the prism.  Therefore, the only internally stored
0022 parameters are eta and phi HALF-widths and the tower z thickness.
0023 
0024 \author J. Mans - Minnesota
0025 */
0026 class IdealZPrism final : public CaloCellGeometry {
0027 public:
0028   enum DEPTH { None, EM, HADR };
0029 
0030   typedef CaloCellGeometry::CCGFloat CCGFloat;
0031   typedef CaloCellGeometry::Pt3D Pt3D;
0032   typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0033 
0034   static constexpr uint32_t k_dEta = 0;  //Eta-width
0035   static constexpr uint32_t k_dPhi = 1;  //Phi-width
0036   static constexpr uint32_t k_dZ = 2;    //Signed thickness
0037   static constexpr uint32_t k_Eta = 3;   //Eta of the reference point
0038   static constexpr uint32_t k_Z = 4;     //Z   of the reference point
0039 
0040   IdealZPrism();
0041 
0042   IdealZPrism(const IdealZPrism& idzp);
0043 
0044   IdealZPrism& operator=(const IdealZPrism& idzp);
0045 
0046   IdealZPrism(const GlobalPoint& faceCenter, CornersMgr* mgr, const CCGFloat* parm, IdealZPrism::DEPTH depth);
0047 
0048   ~IdealZPrism() override;
0049 
0050   CCGFloat dEta() const;
0051   CCGFloat dPhi() const;
0052   CCGFloat dz() const;
0053   CCGFloat eta() const;
0054   CCGFloat z() const;
0055 
0056   static void localCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref);
0057 
0058   void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const override;
0059 
0060   // corrected geom for PF
0061   std::shared_ptr<const IdealZPrism> forPF() const {
0062     static const auto do_not_delete = [](const void*) {};
0063     auto cell = std::shared_ptr<const IdealZPrism>(m_geoForPF.get(), do_not_delete);
0064     return cell;
0065   }
0066 
0067 private:
0068   void initCorners(CornersVec&) override;
0069 
0070   static GlobalPoint etaPhiR(float eta, float phi, float rad);
0071 
0072   static GlobalPoint etaPhiPerp(float eta, float phi, float perp);
0073 
0074   static GlobalPoint etaPhiZ(float eta, float phi, float z);
0075 
0076 private:
0077   // corrected geom for PF
0078   std::unique_ptr<IdealZPrism> m_geoForPF;
0079 };
0080 
0081 std::ostream& operator<<(std::ostream& s, const IdealZPrism& cell);
0082 
0083 #endif