10 using namespace Geometry ;
11 using namespace DDSurfaces ;
16 SurfaceManager::SurfaceManager(){
21 SurfaceManager::~SurfaceManager(){
26 const SurfaceMap* SurfaceManager::map(
const std::string name )
const {
28 SurfaceMapsMap::const_iterator it = _map.find( name ) ;
30 if( it != _map.end() ){
38 void SurfaceManager::initialize() {
42 const std::vector<std::string>& types = lcdd.
detectorTypes() ;
44 for(
unsigned i=0,N=types.size();i<N;++i){
46 const std::vector<DetElement>& dets = lcdd.
detectors( types[i] ) ;
48 for(
unsigned j=0,M=dets.size();j<M;++j){
50 std::string name = dets[j].name() ;
57 _map.insert( std::make_pair( name ,
SurfaceMap() ) ) ;
59 for( SurfaceList::const_iterator it = detSL.begin() ; it != detSL.end() ; ++it ){
63 _map[ name ].insert( std::make_pair( surf->
id(), surf ) ) ;
66 _map[ types[i] ].insert( std::make_pair( surf->
id(), surf ) ) ;
69 _map[
"world" ].insert( std::make_pair( surf->
id(), surf ) ) ;
79 std::stringstream sstr ;
81 sstr <<
"-------- SurfaceManager contains the following maps : --------- " << std::endl ;
83 for( SurfaceMapsMap::const_iterator mi = _map.begin() ; mi != _map.end() ; ++mi ) {
85 sstr <<
" key: " << mi->first <<
" \t number of surfaces : " << mi->second.size() << std::endl ;
87 sstr <<
"---------------------------------------------------------------- " << std::endl ;
virtual const HandleMap & detectors() const =0
Accessor to the map of sub-detectors.
static LCDD & getInstance(void)
—Factory method----—
virtual std::vector< std::string > detectorTypes() const =0
Access the availible detector types.
std::multimap< unsigned long, DDSurfaces::ISurface * > SurfaceMap
typedef for surface maps, keyed by the cellID
virtual long64 id() const =0
The id of this surface - corresponds to DetElement id ( or'ed with the placement ids ) ...
The main interface to the DD4hep detector description package.
const SurfaceList & surfaceList()