CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Geometry/CaloGeometry/interface/CaloGeometry.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_CALOGEOMETRY_CALOGEOMETRY_H
00002 #define GEOMETRY_CALOGEOMETRY_CALOGEOMETRY_H 1
00003 
00004 #include "DataFormats/DetId/interface/DetId.h"
00005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00006 #include <vector>
00007 
00008 class CaloSubdetectorGeometry;
00009 class CaloCellGeometry;
00010 
00021 class CaloGeometry 
00022 {
00023    public:
00024 
00025       CaloGeometry() ;
00026     
00028       void setSubdetGeometry( DetId::Detector                det    , 
00029                               int                            subdet , 
00030                               const CaloSubdetectorGeometry* geom    ) ;
00031     
00033       const GlobalPoint& getPosition( const DetId& id ) const ;
00034 
00036       const CaloCellGeometry* getGeometry( const DetId& id ) const ;
00037 
00039       std::vector<DetId> getValidDetIds() const ;
00040     
00042       const std::vector<DetId>& getValidDetIds( DetId::Detector det, int subdet ) const;
00043 
00045       bool present( const DetId& id ) const ;
00046 
00048       const CaloSubdetectorGeometry* getSubdetectorGeometry( const DetId& id ) const ;
00049     
00051       const CaloSubdetectorGeometry* getSubdetectorGeometry( DetId::Detector det    , 
00052                                                              int             subdet   ) const ;
00053 
00054       // Get closest cell, etc...
00055 //not implemented      const DetId getClosestCell( const GlobalPoint& r ) const ;
00056 
00057    private:
00058 
00059       static const std::vector<DetId> k_emptyVec ;
00060 
00061       std::vector< const CaloSubdetectorGeometry* > m_geos ;
00062 
00063       unsigned int makeIndex( DetId::Detector det,
00064                               int             subdet,
00065                               bool&           ok      ) const ;
00066 
00067       enum { kMaxDet = 5 ,
00068              kMinDet = 3 ,
00069              kNDets  = kMaxDet - kMinDet + 1 ,
00070              kMaxSub = 4 ,
00071              kLength = kNDets*kMaxSub } ;
00072 };
00073 
00074 
00075 
00076 #endif