23 using namespace detail ;
28 SurfaceManager::SurfaceManager(
const Detector& theDetector){
35 initialize(theDetector) ;
38 SurfaceManager::~SurfaceManager(){
43 const SurfaceMap* SurfaceManager::map(
const std::string name )
const {
45 SurfaceMapsMap::const_iterator it = _map.find( name ) ;
47 if( it != _map.end() ){
55 void SurfaceManager::initialize(
const Detector& description) {
57 const std::vector<std::string>& types = description.
detectorTypes() ;
59 for(
unsigned i=0,N=types.size();i<N;++i){
61 const std::vector<DetElement>& dets = description.
detectors( types[i] ) ;
63 for(
unsigned j=0,M=dets.size();j<M;++j){
65 std::string name = dets[j].name() ;
74 for( SurfaceList::const_iterator it = detSL.begin() ; it != detSL.end() ; ++it ){
78 _map[ name ].emplace(surf->
id(), surf );
81 _map[ types[i] ].emplace(surf->
id(), surf );
84 _map[
"world" ].emplace(surf->
id(), surf );
94 std::stringstream sstr ;
96 sstr <<
"-------- SurfaceManager contains the following maps : --------- " << std::endl ;
98 for( SurfaceMapsMap::const_iterator mi = _map.begin() ; mi != _map.end() ; ++mi ) {
100 sstr <<
" key: " << mi->first <<
" \t number of surfaces : " << mi->second.size() << std::endl ;
102 sstr <<
"---------------------------------------------------------------- " << std::endl ;