00001 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" 00002 00003 const float CaloCellGeometry::k_ScaleFromDDDtoGeant ( 0.1 ) ; 00004 00005 const CaloCellGeometry::CornersVec& 00006 CaloCellGeometry::getCorners() const 00007 { 00008 return m_corners ; 00009 } 00010 00011 std::ostream& operator<<( std::ostream& s, const CaloCellGeometry& cell ) 00012 { 00013 s << ", Center: " << cell.getPosition() << std::endl; 00014 00015 if( cell.emptyCorners() ) 00016 { 00017 s << "Corners vector is empty." << std::endl ; 00018 } 00019 else 00020 { 00021 const CaloCellGeometry::CornersVec& corners ( cell.getCorners() ) ; 00022 for ( unsigned int i ( 0 ) ; i != corners.size() ; ++i ) 00023 { 00024 s << "Corner: " << corners[ i ] << std::endl; 00025 } 00026 } 00027 return s ; 00028 } 00029 00030 const float* 00031 CaloCellGeometry::getParmPtr( 00032 const std::vector<float>& vv , 00033 CaloCellGeometry::ParMgr* mgr , 00034 CaloCellGeometry::ParVecVec& pvv ) 00035 { 00036 const float* pP ( 0 ) ; 00037 00038 for( unsigned int ii ( 0 ) ; ii != pvv.size() ; ++ii ) 00039 { 00040 const ParVec& v ( pvv[ii] ) ; 00041 assert( v.size() == vv.size() ) ; 00042 00043 bool same ( true ) ; 00044 for( unsigned int j ( 0 ) ; j != vv.size() ; ++j ) 00045 { 00046 same = same && ( vv[j] == v[j] ) ; 00047 if( !same ) break ; 00048 } 00049 if( same ) 00050 { 00051 pP = &(*v.begin()) ; 00052 break ; 00053 } 00054 } 00055 if( 0 == pP ) 00056 { 00057 pvv.push_back( ParVec( mgr ) ) ; 00058 ParVec& back ( pvv.back() ) ; 00059 for( unsigned int i ( 0 ) ; i != vv.size() ; ++i ) 00060 { 00061 back[i] = vv[i] ; 00062 } 00063 pP = &(*back.begin()) ; 00064 } 00065 return pP ; 00066 }