CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/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/CaloTopology/interface/HcalTopology.h"
00007 #include "CondFormats/AlignmentRecord/interface/HcalAlignmentRcd.h"
00008 #include "Geometry/Records/interface/HcalGeometryRecord.h"
00009 
00010 class HcalGeometry : public CaloSubdetectorGeometry 
00011 {
00012    public:
00013 
00014       typedef HcalAlignmentRcd   AlignmentRecord ;
00015       typedef HcalGeometryRecord AlignedRecord   ;
00016       typedef PHcalRcd           PGeometryRecord ;
00017       typedef HcalDetId          DetIdType       ;
00018 
00019       enum { k_NumberOfCellsForCorners = HcalDetId::kSizeForDenseIndexing } ;
00020 
00021       enum { k_NumberOfShapes = 87 } ;
00022 
00023       enum { k_NumberOfParametersPerShape = 5 } ;
00024 
00025       static std::string dbString() { return "PHcalRcd" ; }
00026 
00027       virtual unsigned int numberOfShapes() const { return k_NumberOfShapes ; }
00028       virtual unsigned int numberOfParametersPerShape() const { return k_NumberOfParametersPerShape ; }
00029 
00030 
00031       HcalGeometry();
00032 
00033       HcalGeometry(const HcalTopology * topology);
00034 
00036       virtual ~HcalGeometry();
00037   
00038       virtual const std::vector<DetId>& getValidDetIds(
00039          DetId::Detector det    = DetId::Detector ( 0 ), 
00040          int             subdet = 0 ) const;
00041 
00042       virtual DetId getClosestCell(const GlobalPoint& r) const ;
00043       
00044       virtual CaloSubdetectorGeometry::DetIdSet getCells( const GlobalPoint& r,
00045                                                           double             dR ) const ;
00046 
00047 
00048       static std::string producerTag() { return "HCAL" ; }
00049 
00050       static unsigned int numberOfBarrelAlignments() { return 36 ; }
00051 
00052       static unsigned int numberOfEndcapAlignments() { return 36 ; }
00053 
00054       static unsigned int numberOfOuterAlignments() { return 36 ; }
00055 
00056       static unsigned int numberOfForwardAlignments() { return 60 ; }
00057 
00058       static unsigned int numberOfAlignments() 
00059       { return ( numberOfBarrelAlignments() +
00060                  numberOfEndcapAlignments() +
00061                  numberOfOuterAlignments() +
00062                  numberOfForwardAlignments() ) ; }
00063 
00064       static unsigned int alignmentTransformIndexLocal( const DetId& id ) ;
00065 
00066       static unsigned int alignmentTransformIndexGlobal( const DetId& id ) ;
00067 
00068       static std::vector<HepGeom::Point3D<double> > localCorners( const double* pv, 
00069                                                    unsigned int  i,
00070                                                    HepGeom::Point3D<double> &   ref ) ;
00071 
00072       static CaloCellGeometry* newCell( const GlobalPoint& f1 ,
00073                                         const GlobalPoint& f2 ,
00074                                         const GlobalPoint& f3 ,
00075                                         CaloCellGeometry::CornersMgr* mgr,
00076                                         const double*      parm,
00077                                         const DetId&       detId     ) ;
00078                                         
00079 
00080    private:
00081 
00082       void fillDetIds() const ;
00083 
00085       int etaRing(HcalSubdetector bc, double abseta) const;
00086       int phiBin(double phi, int etaring) const;
00087 
00088 
00089       const HcalTopology * theTopology;
00090 
00091       mutable std::vector<DetId> m_hbIds ;
00092       mutable std::vector<DetId> m_heIds ;
00093       mutable std::vector<DetId> m_hoIds ;
00094       mutable std::vector<DetId> m_hfIds ;
00095       mutable std::vector<DetId> m_emptyIds ;
00096       bool m_ownsTopology ;
00097 };
00098 
00099 
00100 #endif
00101