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