CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/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  std::vector< const CaloCellGeometry * > CellCont;
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<double>         TrVec  ;
00034       typedef std::vector<unsigned int>   IVec   ;
00035       typedef std::vector<double>         DimVec ;
00036 
00037       CaloSubdetectorGeometry() ;
00038 
00040       virtual ~CaloSubdetectorGeometry();
00041 
00043       const CellCont& cellGeometries() const { return m_cellG ; }  
00044 
00046       void addCell( const DetId&      id, 
00047                     CaloCellGeometry* ccg ) ;
00048 
00050       virtual bool present( const DetId& id ) const;
00051 
00053       virtual const CaloCellGeometry* getGeometry( const DetId& id ) const ;
00054 
00059       virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det    = DetId::Detector(0) , 
00060                                                         int             subdet = 0                   ) const ;
00061 
00062       // Get closest cell, etc...
00063       virtual DetId getClosestCell( const GlobalPoint& r ) const ;
00064 
00071       virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const ;
00072 
00073 
00074       double deltaPhi( const DetId& detId ) const ;
00075 
00076       double deltaEta( const DetId& detId ) const ;
00077 
00078 
00079 
00080       void allocateCorners( CaloCellGeometry::CornersVec::size_type n ) ;
00081 
00082       CaloCellGeometry::CornersMgr* cornersMgr() { return m_cmgr ; }
00083 
00084       void allocatePar( ParVec::size_type n, unsigned int m ) ;
00085 
00086       ParMgr* parMgr() { return m_parMgr ; }
00087       const ParMgr* parMgrConst() const { return m_parMgr ; }
00088 
00089       ParVecVec&       parVecVec()       { return m_parVecVec ; }
00090       const ParVecVec& parVecVec() const { return m_parVecVec ; }
00091       
00092       virtual unsigned int numberOfShapes() const { return 1 ; }
00093       virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
00094       virtual unsigned int numberOfTransformParms() const { return 6 ; }
00095 
00096       virtual void fillDefaultNamedParameters() const { return ; }
00097       
00098       void getSummary( TrVec&  trVector,
00099                        IVec&   iVector,
00100                        DimVec& dimVector   ) const ;
00101 
00102       virtual void initializeParms() { return ; } 
00103 
00104    protected:
00105 
00106       ParVecVec m_parVecVec ;
00107 
00108       static double deltaR( const GlobalPoint& p1,
00109                             const GlobalPoint& p2  ) 
00110       { return reco::deltaR( p1, p2 ) ; }
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       CellCont m_cellG ;    
00123 
00124       mutable bool m_sortedIds ;
00125 
00126       mutable std::vector<DetId> m_validIds ;
00127 
00128       mutable std::vector<double>*  m_deltaPhi ;
00129       mutable std::vector<double>*  m_deltaEta ;
00130 };
00131 
00132 
00133 #endif