CMS 3D CMS Logo

CaloCellGeometry.h

Go to the documentation of this file.
00001 #ifndef GEOMETRY_CALOGEOMETRY_CALOCELLGEOMETRY_H
00002 #define GEOMETRY_CALOGEOMETRY_CALOCELLGEOMETRY_H 1
00003 
00004 #include "Geometry/CaloGeometry/interface/EZArrayFL.h"
00005 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00006 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00007 #include <vector>
00008 #include <string>
00009 
00019 class CaloCellGeometry 
00020 {
00021    public:
00022 
00023       typedef EZArrayFL< GlobalPoint > CornersVec ;
00024       typedef EZMgrFL< GlobalPoint >   CornersMgr ;
00025 
00026       typedef EZArrayFL<float>    ParVec ;
00027       typedef std::vector<ParVec> ParVecVec ;
00028       typedef EZMgrFL< float >    ParMgr ;
00029 
00030       enum CornersSize { k_cornerSize = 8 };
00031 
00032       static const float k_ScaleFromDDDtoGeant ;
00033 
00034       virtual ~CaloCellGeometry() {}
00035       
00036       // Returns the corner points of this cell's volume
00037       virtual const CornersVec& getCorners() const = 0 ;
00038 
00039       // Returns the position of reference for this cell 
00040       const GlobalPoint& getPosition() const { return m_refPoint ; }
00041 
00042       // Returns true if the specified point is inside this cell
00043       virtual bool inside( const GlobalPoint & point ) const = 0 ;  
00044 
00045       bool emptyCorners() const { return m_corners.empty() ; }
00046 
00047 
00048       static const float* getParmPtr( const std::vector<float>& vd  ,
00049                                       ParMgr*                   mgr ,
00050                                       ParVecVec&                pvv ) ;
00051 
00052    protected:
00053 
00054       CaloCellGeometry( CornersVec::const_reference gp ,
00055                         const CornersMgr*           mgr  ) :
00056          m_refPoint ( gp  ),
00057          m_corners  ( mgr ) {}
00058 
00059       CaloCellGeometry( const CornersVec& cv ) : 
00060          m_refPoint ( GlobalPoint( 0.25*( cv[0].x() + cv[1].x() + cv[2].x() + cv[3].x() ),
00061                                    0.25*( cv[0].y() + cv[1].y() + cv[2].y() + cv[3].y() ),
00062                                    0.25*( cv[0].z() + cv[1].z() + cv[2].z() + cv[3].z() )  ) ), 
00063          m_corners  ( cv ) {}
00064 
00065       CornersVec& setCorners() const { return m_corners ; }
00066 
00067    private:
00068 
00069       const   GlobalPoint m_refPoint ;
00070 
00071       mutable CornersVec  m_corners ;
00072 };
00073 
00074 std::ostream& operator<<( std::ostream& s, const CaloCellGeometry& cell ) ;
00075 
00076 #endif

Generated on Tue Jun 9 17:37:11 2009 for CMSSW by  doxygen 1.5.4