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 <CLHEP/Geometry/Point3D.h>
00008 #include <CLHEP/Geometry/Transform3D.h>
00009 #include <vector>
00010 #include <string>
00011
00025 class CaloCellGeometry
00026 {
00027 public:
00028
00029 typedef EZArrayFL< GlobalPoint > CornersVec ;
00030 typedef EZMgrFL< GlobalPoint > CornersMgr ;
00031
00032 typedef EZArrayFL<double> ParVec ;
00033 typedef std::vector<ParVec> ParVecVec ;
00034 typedef EZMgrFL< double > ParMgr ;
00035
00036 enum CornersSize { k_cornerSize = 8 };
00037
00038 static const float k_ScaleFromDDDtoGeant ;
00039
00040 virtual ~CaloCellGeometry() {}
00041
00042
00043 virtual const CornersVec& getCorners() const = 0 ;
00044
00045
00046 const GlobalPoint& getPosition() const { return m_refPoint ; }
00047
00048
00049 bool inside( const GlobalPoint & point ) const ;
00050
00051 bool emptyCorners() const { return m_corners.empty() ; }
00052
00053 const double* param() const { return m_parms ; }
00054
00055 static const double* checkParmPtr( const std::vector<double>& vd ,
00056 ParVecVec& pvv ) ;
00057
00058 static const double* getParmPtr( const std::vector<double>& vd ,
00059 ParMgr* mgr ,
00060 ParVecVec& pvv ) ;
00061
00062
00063
00064 virtual HepGeom::Transform3D getTransform( std::vector<HepGeom::Point3D<double> >* lptr ) const ;
00065
00066
00067 virtual std::vector<HepGeom::Point3D<double> > vocalCorners( const double* pv,
00068 HepGeom::Point3D<double> & ref ) const = 0 ;
00069
00070 protected:
00071
00072 CaloCellGeometry( CornersVec::const_reference gp ,
00073 const CornersMgr* mgr,
00074 const double* par ) :
00075 m_refPoint ( gp ),
00076 m_corners ( mgr ),
00077 m_parms ( par ) {}
00078
00079 CaloCellGeometry( const CornersVec& cv,
00080 const double* par ) :
00081 m_refPoint ( GlobalPoint( 0.25*( cv[0].x() + cv[1].x() + cv[2].x() + cv[3].x() ),
00082 0.25*( cv[0].y() + cv[1].y() + cv[2].y() + cv[3].y() ),
00083 0.25*( cv[0].z() + cv[1].z() + cv[2].z() + cv[3].z() ) ) ),
00084 m_corners ( cv ),
00085 m_parms ( par ) {}
00086
00087 CornersVec& setCorners() const { return m_corners ; }
00088
00089 private:
00090
00091 const GlobalPoint m_refPoint ;
00092
00093 mutable CornersVec m_corners ;
00094
00095 const double* m_parms ;
00096 };
00097
00098 std::ostream& operator<<( std::ostream& s, const CaloCellGeometry& cell ) ;
00099
00100 #endif