00001 #ifndef Geometry_ForwardGeometry_ZdcGeometry_h 00002 #define Geometry_ForwardGeometry_ZDcGeometry_h 00003 00004 #include "CondFormats/AlignmentRecord/interface/ZDCAlignmentRcd.h" 00005 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h" 00006 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" 00007 #include "Geometry/ForwardGeometry/interface/IdealZDCTrapezoid.h" 00008 #include "Geometry/ForwardGeometry/interface/ZdcTopology.h" 00009 #include "Geometry/Records/interface/ZDCGeometryRecord.h" 00010 #include "Geometry/Records/interface/PZdcRcd.h" 00011 00012 class ZdcGeometry : public CaloSubdetectorGeometry 00013 { 00014 public: 00015 00016 typedef std::vector<IdealZDCTrapezoid> CellVec ; 00017 00018 typedef CaloCellGeometry::CCGFloat CCGFloat ; 00019 typedef CaloCellGeometry::Pt3D Pt3D ; 00020 typedef CaloCellGeometry::Pt3DVec Pt3DVec ; 00021 typedef CaloCellGeometry::Tr3D Tr3D ; 00022 00023 typedef ZDCAlignmentRcd AlignmentRecord ; 00024 typedef ZDCGeometryRecord AlignedRecord ; 00025 typedef PZdcRcd PGeometryRecord ; 00026 typedef HcalZDCDetId DetIdType ; 00027 00028 enum { k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing } ; 00029 00030 enum { k_NumberOfShapes = 3 } ; 00031 00032 enum { k_NumberOfParametersPerShape = 4 } ; 00033 00034 static std::string dbString() { return "PZdcRcd" ; } 00035 00036 virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; } 00037 virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; } 00038 00039 ZdcGeometry() ; 00040 00041 explicit ZdcGeometry(const ZdcTopology * topology); 00042 virtual ~ZdcGeometry(); 00043 00044 // virtual DetId getClosestCell(const GlobalPoint& r) const ; 00045 00046 static std::string producerTag() { return "ZDC" ; } 00047 00048 static unsigned int numberOfAlignments() { return 2 ; } 00049 00050 static unsigned int alignmentTransformIndexLocal( const DetId& id ) ; 00051 00052 static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ; 00053 00054 static void localCorners( Pt3DVec& lc , 00055 const CCGFloat* pv , 00056 unsigned int i , 00057 Pt3D& ref ) ; 00058 00059 virtual void newCell( const GlobalPoint& f1 , 00060 const GlobalPoint& f2 , 00061 const GlobalPoint& f3 , 00062 const CCGFloat* parm, 00063 const DetId& detId ) ; 00064 00065 protected: 00066 00067 virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const ; 00068 00069 private: 00070 00071 const ZdcTopology * theTopology; 00072 mutable DetId::Detector lastReqDet_; 00073 mutable int lastReqSubdet_; 00074 bool m_ownsTopology ; 00075 00076 CellVec m_cellVec ; 00077 }; 00078 00079 00080 #endif 00081