CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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 
00011 #include "FWCore/Utilities/interface/GCC11Compatibility.h"
00012 
00013 
00024 class CaloSubdetectorGeometry {
00025 
00026    public:
00027       typedef std::vector<CaloCellGeometry const *> CellSet;
00028       typedef CaloCellGeometry::CCGFloat CCGFloat ;
00029 
00030       typedef std::set<DetId>       DetIdSet;
00031 
00032 
00033       typedef CaloCellGeometry::ParMgr    ParMgr ;
00034       typedef CaloCellGeometry::ParVec    ParVec ;
00035       typedef CaloCellGeometry::ParVecVec ParVecVec ;
00036 
00037       typedef std::vector<CCGFloat>     TrVec  ;
00038       typedef std::vector<unsigned int> IVec   ;
00039       typedef std::vector<CCGFloat>     DimVec ;
00040 
00041       CaloSubdetectorGeometry() ;
00042 
00044       virtual ~CaloSubdetectorGeometry();
00045 
00046       virtual void newCell( const GlobalPoint& f1 ,
00047                             const GlobalPoint& f2 ,
00048                             const GlobalPoint& f3 ,
00049                             const CCGFloat*    parm ,
00050                             const DetId&       detId ) = 0 ;
00051 
00053       virtual bool present( const DetId& id ) const;
00054 
00056       virtual const CaloCellGeometry* getGeometry( const DetId& id ) const ;
00057 
00062       virtual const std::vector<DetId>& getValidDetIds( DetId::Detector det    = DetId::Detector(0) , 
00063                                                         int             subdet = 0                   ) const ;
00064 
00065       // Get closest cell, etc...
00066       virtual DetId getClosestCell( const GlobalPoint& r ) const ;
00067 
00074       virtual DetIdSet getCells( const GlobalPoint& r, double dR ) const ;
00075       virtual CellSet getCellSet( const GlobalPoint& r, double dR ) const ;
00076 
00077       CCGFloat deltaPhi( const DetId& detId ) const ;
00078 
00079       CCGFloat deltaEta( const DetId& detId ) const ;
00080 
00081       void allocateCorners( CaloCellGeometry::CornersVec::size_type n ) ;
00082 
00083       CaloCellGeometry::CornersMgr* cornersMgr() { return m_cmgr ; }
00084 
00085       void allocatePar( ParVec::size_type n, unsigned int m ) ;
00086 
00087       ParMgr* parMgr() { return m_parMgr ; }
00088       const ParMgr* parMgrConst() const { return m_parMgr ; }
00089 
00090       ParVecVec&       parVecVec()       { return m_parVecVec ; }
00091       const ParVecVec& parVecVec() const { return m_parVecVec ; }
00092       
00093       virtual unsigned int numberOfShapes() const { return 1 ; }
00094       virtual unsigned int numberOfParametersPerShape() const { return 1 ; }
00095       virtual unsigned int numberOfTransformParms() const { return 6 ; }
00096 
00097       virtual void fillDefaultNamedParameters() const { return ; }
00098       
00099       virtual void getSummary( TrVec&  trVector,
00100                                IVec&   iVector,
00101                                DimVec& dimVector,
00102                                IVec&   dinsVector ) const ;
00103 
00104       virtual void initializeParms() { return ; } 
00105 
00106    protected:
00107 
00108       virtual unsigned int indexFor(const DetId& id) const;
00109       virtual unsigned int sizeForDenseIndex(const DetId& id) const;
00110 
00111       virtual const CaloCellGeometry* cellGeomPtr( uint32_t index ) const = 0 ;
00112 
00113       ParVecVec m_parVecVec ;
00114 
00115       static CCGFloat deltaR( const GlobalPoint& p1,
00116                               const GlobalPoint& p2  ) 
00117       { return reco::deltaR( p1, p2 ) ; }
00118 
00119       mutable std::vector<DetId> m_validIds ;
00120 
00121    private:
00122 
00123       ParMgr*   m_parMgr ;
00124 
00125       CaloCellGeometry::CornersMgr* m_cmgr ;
00126 
00128       CaloSubdetectorGeometry(            const CaloSubdetectorGeometry& ) ;
00129       CaloSubdetectorGeometry& operator=( const CaloSubdetectorGeometry& ) ;
00130 
00131       mutable bool m_sortedIds ;
00132 
00133       mutable std::vector<CCGFloat>*  m_deltaPhi ;
00134       mutable std::vector<CCGFloat>*  m_deltaEta ;
00135 };
00136 
00137 
00138 #endif