DD4hep  1.34.0
Detector Description Toolkit for High Energy Physics
SurfaceManager.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : F.Gaede
11 //
12 //==========================================================================
13 #ifndef DDREC_SURFACEMANAGER_H
14 #define DDREC_SURFACEMANAGER_H
15 
16 #include "DDRec/ISurface.h"
17 #include "DD4hep/Detector.h"
18 #include <string>
19 #include <map>
20 
21 namespace dd4hep {
22  namespace rec {
23 
25  typedef std::multimap< unsigned long, ISurface*> SurfaceMap ;
26 
36 
37  typedef std::map< std::string, SurfaceMap > SurfaceMapsMap ;
38 
39  public:
41  SurfaceManager(const Detector& theDetector);
42 
44  SurfaceManager() = delete ;
45 
46  ~SurfaceManager() = default;
47  SurfaceManager(const SurfaceManager&) = delete;
51 
52 
57  const SurfaceMap* map( const std::string& name ) const ;
58 
59 
61  std::string toString() const ;
62 
63  private :
64 
65 
67  void initialize(const Detector& theDetector) const;
68 
69  mutable SurfaceMapsMap _map{} ;
71  mutable std::once_flag _initializedFlag{} ;
72  };
73 
74  } /* namespace rec */
75 } /* namespace dd4hep */
76 
77 
78 
79 #endif // DDREC_SURFACEMANAGER_H
ISurface.h
dd4hep::rec::SurfaceManager::map
const SurfaceMap * map(const std::string &name) const
Definition: SurfaceManager.cpp:35
Detector.h
dd4hep::rec::SurfaceManager::initialize
void initialize(const Detector &theDetector) const
initialize all known surface maps
Definition: SurfaceManager.cpp:49
dd4hep::rec::SurfaceManager::toString
std::string toString() const
create a string with all available maps and their size (number of surfaces)
Definition: SurfaceManager.cpp:84
dd4hep::rec::SurfaceManager::~SurfaceManager
~SurfaceManager()=default
dd4hep::rec::SurfaceManager::SurfaceManager
SurfaceManager(const SurfaceManager &)=delete
dd4hep::rec::SurfaceMap
std::multimap< unsigned long, ISurface * > SurfaceMap
typedef for surface maps, keyed by the cellID
Definition: SurfaceManager.h:25
SurfaceManager
Plugin that creates a SurfaceManager object and attaches it to description as a user extension object...
dd4hep::rec::SurfaceManager::_theDetector
const Detector & _theDetector
Definition: SurfaceManager.h:70
dd4hep::rec::SurfaceManager::_initializedFlag
std::once_flag _initializedFlag
Definition: SurfaceManager.h:71
dd4hep::rec::SurfaceManager::operator=
SurfaceManager & operator=(const SurfaceManager &)=delete
dd4hep::rec::SurfaceManager::SurfaceMapsMap
std::map< std::string, SurfaceMap > SurfaceMapsMap
Definition: SurfaceManager.h:37
dd4hep::rec::SurfaceManager::_map
SurfaceMapsMap _map
Definition: SurfaceManager.h:69
dd4hep::rec::SurfaceManager::SurfaceManager
SurfaceManager()=delete
No default constructor.
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::Detector
The main interface to the dd4hep detector description package.
Definition: Detector.h:90
dd4hep::rec::SurfaceManager::SurfaceManager
SurfaceManager(SurfaceManager &&)=delete
dd4hep::rec::SurfaceManager::operator=
SurfaceManager & operator=(SurfaceManager &&)=delete