Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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   enum { k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing };
0027 
0028   enum { k_NumberOfShapes = 3 };
0029 
0030   enum { k_NumberOfParametersPerShape = 4 };
0031 
0032   static std::string dbString() { return "PZdcRcd"; }
0033 
0034   unsigned int numberOfShapes() const override { return k_NumberOfShapes; }
0035   unsigned int numberOfParametersPerShape() const override { return k_NumberOfParametersPerShape; }
0036 
0037   ZdcGeometry();
0038 
0039   explicit ZdcGeometry(const ZdcTopology* topology);
0040   ~ZdcGeometry() override;
0041 
0042   //      virtual DetId getClosestCell(const GlobalPoint& r) const ;
0043 
0044   static std::string producerTag() { return "ZDC"; }
0045 
0046   static unsigned int numberOfAlignments() { return 2; }
0047 
0048   static unsigned int alignmentTransformIndexLocal(const DetId& id);
0049 
0050   static unsigned int alignmentTransformIndexGlobal(const DetId& id);
0051 
0052   static void localCorners(Pt3DVec& lc, const CCGFloat* pv, unsigned int i, Pt3D& ref);
0053 
0054   void newCell(const GlobalPoint& f1,
0055                const GlobalPoint& f2,
0056                const GlobalPoint& f3,
0057                const CCGFloat* parm,
0058                const DetId& detId) override;
0059 
0060 protected:
0061   // Modify the RawPtr class
0062   const CaloCellGeometry* getGeometryRawPtr(uint32_t index) const override;
0063 
0064 private:
0065   const ZdcTopology* theTopology;
0066   mutable DetId::Detector lastReqDet_;
0067   mutable int lastReqSubdet_;
0068   bool m_ownsTopology;
0069 
0070   CellVec m_cellVec;
0071 };
0072 
0073 #endif  // Geometry_ForwardGeometry_ZdcGeometry_h