Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-25 23:57:06

0001 #ifndef Geometry_ForwardGeometry_ZdcGeometry_h
0002 #define Geometry_ForwardGeometry_ZdcGeometry_h
0003 
0004 #include "CondFormats/AlignmentRecord/interface/ZDCAlignmentRcd.h"
0005 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0006 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0007 #include "Geometry/ForwardGeometry/interface/IdealZDCTrapezoid.h"
0008 #include "Geometry/ForwardGeometry/interface/ZdcTopology.h"
0009 #include "Geometry/Records/interface/ZDCGeometryRecord.h"
0010 #include "Geometry/Records/interface/PZdcRcd.h"
0011 
0012 class ZdcGeometry : public CaloSubdetectorGeometry {
0013 public:
0014   typedef std::vector<IdealZDCTrapezoid> CellVec;
0015 
0016   typedef CaloCellGeometry::CCGFloat CCGFloat;
0017   typedef CaloCellGeometry::Pt3D Pt3D;
0018   typedef CaloCellGeometry::Pt3DVec Pt3DVec;
0019   typedef CaloCellGeometry::Tr3D Tr3D;
0020 
0021   typedef ZDCAlignmentRcd AlignmentRecord;
0022   typedef ZDCGeometryRecord AlignedRecord;
0023   typedef PZdcRcd PGeometryRecord;
0024   typedef HcalZDCDetId DetIdType;
0025 
0026   static constexpr int k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing;
0027   uint32_t k_NumberOfCellsForCornersN;
0028 
0029   static constexpr int k_NumberOfShapes = 3;
0030 
0031   static constexpr int k_NumberOfParametersPerShape = 4;
0032 
0033   static std::string dbString() { return "PZdcRcd"; }
0034 
0035   unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
0036   unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
0037 
0038   ZdcGeometry();
0039 
0040   explicit ZdcGeometry(const ZdcTopology* topology);
0041   ~ZdcGeometry() override;
0042 
0043   //      virtual DetId getClosestCell(const GlobalPoint& r) const ;
0044 
0045   static std::string producerTag() { return "ZDC"; }
0046 
0047   static unsigned int numberOfAlignments() { return 2; }
0048 
0049   static unsigned int alignmentTransformIndexLocal(const DetId& id);
0050 
0051   static unsigned int alignmentTransformIndexGlobal(const DetId& id);
0052 
0053   static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
0054 
0055   void newCell(const GlobalPoint& f1,
0056                const GlobalPoint& f2,
0057                const GlobalPoint& f3,
0058                const CCGFloat* parm,
0059                const DetId& detId) override;
0060 
0061   void getSummary(CaloSubdetectorGeometry::TrVec& tVec,
0062                   CaloSubdetectorGeometry::IVec& iVec,
0063                   CaloSubdetectorGeometry::DimVec& dVec,
0064                   CaloSubdetectorGeometry::IVec& dins) const override;
0065 
0066 protected:
0067   unsigned int indexFor(const DetId& id) const override { return theTopology->detId2DenseIndex(id); }
0068 
0069   // Modify the RawPtr class
0070   CaloCellGeometryPtr getGeometryRawPtr(uint32_t index) const override;
0071 
0072 private:
0073   const ZdcTopology* theTopology;
0074   mutable DetId::Detector lastReqDet_;
0075   mutable int lastReqSubdet_;
0076   bool m_ownsTopology;
0077 
0078   CellVec m_cellVec;
0079 };
0080 
0081 #endif  // Geometry_ForwardGeometry_ZdcGeometry_h