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