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/ZdcTopology.h" 00008 #include "Geometry/Records/interface/ZDCGeometryRecord.h" 00009 #include "Geometry/Records/interface/PZdcRcd.h" 00010 00011 class ZdcGeometry : public CaloSubdetectorGeometry 00012 { 00013 public: 00014 00015 typedef ZDCAlignmentRcd AlignmentRecord ; 00016 typedef ZDCGeometryRecord AlignedRecord ; 00017 typedef PZdcRcd PGeometryRecord ; 00018 typedef HcalZDCDetId DetIdType ; 00019 00020 enum { k_NumberOfCellsForCorners = HcalZDCDetId::kSizeForDenseIndexing } ; 00021 00022 enum { k_NumberOfShapes = 3 } ; 00023 00024 enum { k_NumberOfParametersPerShape = 4 } ; 00025 00026 static std::string dbString() { return "PZdcRcd" ; } 00027 00028 virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; } 00029 virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; } 00030 00031 ZdcGeometry() ; 00032 00033 explicit ZdcGeometry(const ZdcTopology * topology); 00034 virtual ~ZdcGeometry(); 00035 00036 virtual const std::vector<DetId>& getValidDetIds( 00037 DetId::Detector det = DetId::Detector ( 0 ) , 00038 int subdet = 0 ) const; 00039 00040 virtual DetId getClosestCell(const GlobalPoint& r) const ; 00041 00042 static std::string producerTag() { return "ZDC" ; } 00043 00044 static unsigned int numberOfAlignments() { return 2 ; } 00045 00046 static unsigned int alignmentTransformIndexLocal( const DetId& id ) ; 00047 00048 static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ; 00049 00050 static std::vector<HepGeom::Point3D<double> > localCorners( const double* pv, 00051 unsigned int i, 00052 HepGeom::Point3D<double> & ref ) ; 00053 00054 static CaloCellGeometry* newCell( const GlobalPoint& f1 , 00055 const GlobalPoint& f2 , 00056 const GlobalPoint& f3 , 00057 CaloCellGeometry::CornersMgr* mgr, 00058 const double* parm, 00059 const DetId& detId ) ; 00060 00061 private: 00062 00063 const ZdcTopology * theTopology; 00064 mutable DetId::Detector lastReqDet_; 00065 mutable int lastReqSubdet_; 00066 mutable std::vector<DetId> m_validIds; 00067 bool m_ownsTopology ; 00068 }; 00069 00070 00071 #endif 00072