CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H
00002 #define GEOMETRY_CALOGEOMETRY_CALOSUBDETECTORGEOMETRY_H 1
00003 
00004 #include <vector>
00005 #include <set>
00006 #include "DataFormats/DetId/interface/DetId.h"
00007 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00008 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00009 #include "DataFormats/Math/interface/deltaR.h"
00010 
00021 class CaloSubdetectorGeometry {
00022 
00023    public:
00024 
00025       typedef CaloCellGeometry::CCGFloat CCGFloat ;
00026 
00027       typedef std::set<DetId>       DetIdSet;
00028 
00029       typedef CaloCellGeometry::ParMgr    ParMgr ;
00030       typedef CaloCellGeometry::ParVec    ParVec ;
00031       typedef CaloCellGeometry::ParVecVec ParVecVec ;
00032 
00033       typedef std::vector<CCGFloat>     TrVec  ;
00034       typedef std::vector<unsigned int> IVec   ;
00035       typedef std::vector<CCGFloat>     DimVec ;
00036 
00037       CaloSubdetectorGeometry() ;
00038 
00040       virtual ~CaloSubdetectorGeometry();
00041 
00042       virtual void newCell( const GlobalPoint& f1 ,
00043                             const GlobalPoint& f2 ,
00044                             const GlobalPoint& f3 ,
00045                             const CCGFloat*    parm ,
00046                             const DetId&       detId ) = 0 ;
00047 
00049       virtual bool present( const DetId& id ) const;
00050 
00052       virtual const CaloCellGeometry* getGeometry( const DetId& id ) const ;
00053 
00058       virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det    = DetId::Detector(0) , 
00059                                                         int             subdet = 0                   ) const ;
00060 
00061       // Get closest cell, etc...
00062       virtual DetId getClosestCell( const GlobalPoint& r ) const ;
00063 
00070       virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const ;
00071 
00072       CCGFloat deltaPhi( const DetId& detId ) const ;
00073 
00074       CCGFloat deltaEta( const DetId& detId ) const ;
00075 
00076       void allocateCorners( CaloCellGeometry::CornersVec::size_type n ) ;
00077 
00078       CaloCellGeometry::CornersMgr* cornersMgr() { return m_cmgr ; }
00079 
00080       void allocatePar( ParVec::size_type n, unsigned int m ) ;
00081 
00082       ParMgr* parMgr() { return m_parMgr ; }
00083       const ParMgr* parMgrConst() const { return m_parMgr ; }
00084 
00085       ParVecVec&       parVecVec()       { return m_parVecVec ; }
00086       const ParVecVec& parVecVec() const { return m_parVecVec ; }
00087       
00088       virtual unsigned int numberOfShapes() const { return 1 ; }
00089       virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
00090       virtual unsigned int numberOfTransformParms() const { return 6 ; }
00091 
00092       virtual void fillDefaultNamedParameters() const { return ; }
00093       
00094       void getSummary( TrVec&  trVector,
00095                        IVec&   iVector,
00096                        DimVec& dimVector   ) const ;
00097 
00098       virtual void initializeParms() { return ; } 
00099 
00100    protected:
00101 
00102       virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const = 0 ;
00103 
00104       ParVecVec m_parVecVec ;
00105 
00106       static CCGFloat deltaR( const GlobalPoint& p1,
00107                               const GlobalPoint& p2  ) 
00108       { return reco::deltaR( p1, p2 ) ; }
00109 
00110       mutable std::vector<DetId> m_validIds ;
00111 
00112    private:
00113 
00114       ParMgr*   m_parMgr ;
00115 
00116       CaloCellGeometry::CornersMgr* m_cmgr ;
00117 
00119       CaloSubdetectorGeometry(            const CaloSubdetectorGeometry& ) ;
00120       CaloSubdetectorGeometry& operator=( const CaloSubdetectorGeometry& ) ;
00121 
00122       mutable bool m_sortedIds ;
00123 
00124       mutable std::vector<CCGFloat>*  m_deltaPhi ;
00125       mutable std::vector<CCGFloat>*  m_deltaEta ;
00126 };
00127 
00128 
00129 #endif