Go to the documentation of this file.00001 #include "Geometry/CaloGeometry/interface/CaloGenericDetId.h"
00002 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00003 #include "Geometry/ForwardGeometry/interface/ZdcGeometry.h"
00004 #include "Geometry/ForwardGeometry/interface/IdealZDCTrapezoid.h"
00005 #include "ZdcHardcodeGeometryData.h"
00006 #include <algorithm>
00007
00008 typedef CaloCellGeometry::CCGFloat CCGFloat ;
00009 typedef CaloCellGeometry::Pt3D Pt3D ;
00010 typedef CaloCellGeometry::Pt3DVec Pt3DVec ;
00011
00012 ZdcGeometry::ZdcGeometry() :
00013 theTopology( new ZdcTopology ),
00014 lastReqDet_(DetId::Detector(0)),
00015 lastReqSubdet_(0),
00016 m_ownsTopology ( true ),
00017 m_cellVec ( k_NumberOfCellsForCorners )
00018 {
00019 }
00020
00021 ZdcGeometry::ZdcGeometry( const ZdcTopology* topology) :
00022 theTopology(topology),
00023 lastReqDet_(DetId::Detector(0)),
00024 lastReqSubdet_(0),
00025 m_ownsTopology ( false ),
00026 m_cellVec ( k_NumberOfCellsForCorners )
00027 {
00028 }
00029
00030 ZdcGeometry::~ZdcGeometry()
00031 {
00032 if( m_ownsTopology ) delete theTopology ;
00033 }
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 unsigned int
00054 ZdcGeometry::alignmentTransformIndexLocal( const DetId& id )
00055 {
00056 const CaloGenericDetId gid ( id ) ;
00057
00058 assert( gid.isZDC() ) ;
00059
00060 return ( 0 > HcalZDCDetId( id ).zside() ? 0 : 1 ) ;
00061 }
00062
00063 unsigned int
00064 ZdcGeometry::alignmentTransformIndexGlobal( const DetId& id )
00065 {
00066 return (unsigned int)DetId::Calo - 1 ;
00067 }
00068
00069 void
00070 ZdcGeometry::localCorners( Pt3DVec& lc ,
00071 const CCGFloat* pv ,
00072 unsigned int i ,
00073 Pt3D& ref )
00074 {
00075 IdealZDCTrapezoid::localCorners( lc, pv, ref ) ;
00076 }
00077
00078 void
00079 ZdcGeometry::newCell( const GlobalPoint& f1 ,
00080 const GlobalPoint& f2 ,
00081 const GlobalPoint& f3 ,
00082 const CCGFloat* parm ,
00083 const DetId& detId )
00084 {
00085 const CaloGenericDetId cgid ( detId ) ;
00086
00087 assert( cgid.isZDC() ) ;
00088
00089 const unsigned int di ( cgid.denseIndex() ) ;
00090
00091 m_cellVec[ di ] = IdealZDCTrapezoid( f1, cornersMgr(), parm ) ;
00092 m_validIds.push_back( detId ) ;
00093 }
00094
00095 const CaloCellGeometry*
00096 ZdcGeometry::cellGeomPtr( uint32_t index ) const
00097 {
00098 const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
00099 return ( m_cellVec.size() < index ||
00100 0 == cell->param() ? 0 : cell ) ;
00101 }
00102