CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Geometry/HcalTowerAlgo/interface/HcalGeometry.h

Go to the documentation of this file.
00001 #ifndef HcalGeometry_h
00002 #define HcalGeometry_h
00003 
00004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00005 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00006 #include "Geometry/CaloGeometry/interface/IdealObliquePrism.h"
00007 #include "Geometry/CaloGeometry/interface/IdealZPrism.h"
00008 #include "Geometry/CaloTopology/interface/HcalTopology.h"
00009 #include "CondFormats/AlignmentRecord/interface/HcalAlignmentRcd.h"
00010 #include "Geometry/Records/interface/HcalGeometryRecord.h"
00011 
00012 class HcalGeometry : public CaloSubdetectorGeometry 
00013 {
00014    public:
00015 
00016       typedef std::vector<IdealObliquePrism> HBCellVec ;
00017       typedef std::vector<IdealObliquePrism> HECellVec ;
00018       typedef std::vector<IdealObliquePrism> HOCellVec ;
00019       typedef std::vector<IdealZPrism>       HFCellVec ;
00020 
00021       typedef CaloCellGeometry::CCGFloat CCGFloat ;
00022       typedef CaloCellGeometry::Pt3D     Pt3D     ;
00023       typedef CaloCellGeometry::Pt3DVec  Pt3DVec  ;
00024 
00025       typedef HcalAlignmentRcd   AlignmentRecord ;
00026       typedef HcalGeometryRecord AlignedRecord   ;
00027       typedef PHcalRcd           PGeometryRecord ;
00028       typedef HcalDetId          DetIdType       ;
00029 
00030       enum { k_NumberOfCellsForCorners = HcalDetId::kSizeForDenseIndexing } ;
00031 
00032       enum { k_NumberOfShapes = 87 } ;
00033 
00034       enum { k_NumberOfParametersPerShape = 5 } ;
00035 
00036       static std::string dbString() { return "PHcalRcd" ; }
00037 
00038       virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; }
00039       virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; }
00040 
00041 
00042       HcalGeometry();
00043 
00044       HcalGeometry(const HcalTopology * topology);
00045 
00047       virtual ~HcalGeometry();
00048   
00049       virtual const std::vector<DetId>& getValidDetIds(
00050          DetId::Detector det    = DetId::Detector ( 0 ), 
00051          int             subdet = 0 ) const;
00052 
00053       virtual DetId getClosestCell(const GlobalPoint& r) const ;
00054       
00055       virtual CaloSubdetectorGeometry::DetIdSet getCells( const GlobalPoint& r,
00056                                                           double             dR ) const ;
00057 
00058 
00059       static std::string producerTag() { return "HCAL" ; }
00060 
00061       static unsigned int numberOfBarrelAlignments() { return 36 ; }
00062 
00063       static unsigned int numberOfEndcapAlignments() { return 36 ; }
00064 
00065       static unsigned int numberOfOuterAlignments() { return 36 ; }
00066 
00067       static unsigned int numberOfForwardAlignments() { return 60 ; }
00068 
00069       static unsigned int numberOfAlignments() 
00070       { return ( numberOfBarrelAlignments() +
00071                  numberOfEndcapAlignments() +
00072                  numberOfOuterAlignments() +
00073                  numberOfForwardAlignments() ) ; }
00074 
00075       static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
00076 
00077       static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
00078 
00079       static void localCorners( Pt3DVec&        lc  ,
00080                                 const CCGFloat* pv  , 
00081                                 unsigned int    i   ,
00082                                 Pt3D&           ref   ) ;
00083 
00084       virtual void newCell( const GlobalPoint& f1 ,
00085                             const GlobalPoint& f2 ,
00086                             const GlobalPoint& f3 ,
00087                             const CCGFloat*    parm,
00088                             const DetId&       detId     ) ;
00089    protected:
00090 
00091       virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const ;
00092 
00093    private:
00094 
00095       void fillDetIds() const ;
00096 
00097       void init() ;
00098 
00100       int etaRing(HcalSubdetector bc, double abseta) const;
00101       int phiBin(double phi, int etaring) const;
00102 
00103 
00104       const HcalTopology * theTopology;
00105 
00106       mutable std::vector<DetId> m_hbIds ;
00107       mutable std::vector<DetId> m_heIds ;
00108       mutable std::vector<DetId> m_hoIds ;
00109       mutable std::vector<DetId> m_hfIds ;
00110       mutable std::vector<DetId> m_emptyIds ;
00111       bool m_ownsTopology ;
00112 
00113       HBCellVec m_hbCellVec ;
00114       HECellVec m_heCellVec ;
00115       HOCellVec m_hoCellVec ;
00116       HFCellVec m_hfCellVec ;
00117 };
00118 
00119 
00120 #endif
00121