DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
dd4hep::detail::GeoHandler Class Reference

The base class for all dd4hep geometry crawlers. More...

#include <GeoHandler.h>

Inheritance diagram for dd4hep::detail::GeoHandler:
dd4hep::detail::GeoHandlerTypes dd4hep::detail::DetectorChecksum dd4hep::detail::GeometryTreeDump dd4hep::detail::LCDDConverter dd4hep::detail::PandoraConverter dd4hep::sim::Geant4Converter

Public Member Functions

 GeoHandler ()
 Default constructor. More...
 
 GeoHandler (std::map< int, std::vector< const TGeoNode * > > *ptr, std::map< int, std::set< const TGeoNode * > > *ptr_set, std::map< const TGeoNode *, std::vector< TGeoNode * > > *daus=nullptr)
 Initializing constructor. More...
 
virtual ~GeoHandler ()
 Default destructor. More...
 
bool setPropagateRegions (bool value)
 Propagate regions. Returns the previous value. More...
 
GeoHandlercollect (DetElement top)
 Collect geometry information from traversal. More...
 
GeoHandlercollect (DetElement top, GeometryInfo &info)
 Collect geometry information from traversal with aggregated information. More...
 
std::map< int, std::vector< const TGeoNode * > > * release ()
 Access to collected node list. More...
 

Protected Member Functions

GeoHandleri_collect (const TGeoNode *parent, const TGeoNode *node, int level, Region rg, LimitSet ls)
 Internal helper to collect geometry information from traversal. More...
 

Protected Attributes

bool m_propagateRegions { false }
 
std::map< int, std::vector< const TGeoNode * > > * m_data { nullptr }
 actual container with std::vector (preserves order) More...
 
std::map< int, std::set< const TGeoNode * > > * m_set_data { nullptr }
 redundant container with std::set (for lookup purpose) More...
 
std::map< const TGeoNode *, std::vector< TGeoNode * > > * m_daughters { nullptr }
 

Private Member Functions

 GeoHandler (const GeoHandler &)
 Never call Copy constructor. More...
 
GeoHandleroperator= (const GeoHandler &)
 Never call assignment operator. More...
 

Detailed Description

The base class for all dd4hep geometry crawlers.

Geometry crawlers are used for multiple purposes, whenever entire geometries must be traversed like e.g. to create a new geometry for simulation etc. While analysing the geometry, information is collected, which may be later processed.

Author
M.Frank
Version
1.0

Definition at line 87 of file GeoHandler.h.

Constructor & Destructor Documentation

◆ GeoHandler() [1/3]

dd4hep::detail::GeoHandler::GeoHandler ( const GeoHandler )
inlineprivate

Never call Copy constructor.

Definition at line 105 of file GeoHandler.h.

◆ GeoHandler() [2/3]

detail::GeoHandler::GeoHandler ( )

Default constructor.

Definition at line 56 of file GeoHandler.cpp.

◆ GeoHandler() [3/3]

detail::GeoHandler::GeoHandler ( std::map< int, std::vector< const TGeoNode * > > *  ptr,
std::map< int, std::set< const TGeoNode * > > *  ptr_set,
std::map< const TGeoNode *, std::vector< TGeoNode * > > *  daus = nullptr 
)

Initializing constructor.

Definition at line 62 of file GeoHandler.cpp.

◆ ~GeoHandler()

detail::GeoHandler::~GeoHandler ( )
virtual

Default destructor.

Definition at line 70 of file GeoHandler.cpp.

Member Function Documentation

◆ collect() [1/2]

detail::GeoHandler & detail::GeoHandler::collect ( DetElement  top)

Collect geometry information from traversal.

Definition at line 101 of file GeoHandler.cpp.

◆ collect() [2/2]

detail::GeoHandler & detail::GeoHandler::collect ( DetElement  top,
GeometryInfo info 
)

Collect geometry information from traversal with aggregated information.

Definition at line 109 of file GeoHandler.cpp.

◆ i_collect()

detail::GeoHandler & detail::GeoHandler::i_collect ( const TGeoNode *  parent,
const TGeoNode *  node,
int  level,
Region  rg,
LimitSet  ls 
)
protected

Internal helper to collect geometry information from traversal.

Collect the hierarchy of placements perform lookup using std::set::emplace (faster than std::find for very large number of volumes)

Now collect all the daughters of this volume, so that we can reconnect them in the correct order

Definition at line 148 of file GeoHandler.cpp.

◆ operator=()

GeoHandler& dd4hep::detail::GeoHandler::operator= ( const GeoHandler )
inlineprivate

Never call assignment operator.

Definition at line 108 of file GeoHandler.h.

◆ release()

std::map< int, std::vector< const TGeoNode * > > * detail::GeoHandler::release ( )

Access to collected node list.

release the std::vector geometry container (preserves order)

the std::set container (for lookup purpose) is not needed anymore, so delete it the container is always present since the call of the constructor we never expect to call release() twice (will release nullptr)

Definition at line 80 of file GeoHandler.cpp.

◆ setPropagateRegions()

bool detail::GeoHandler::setPropagateRegions ( bool  value)

Propagate regions. Returns the previous value.

Definition at line 95 of file GeoHandler.cpp.

Member Data Documentation

◆ m_data

std::map<int, std::vector<const TGeoNode*> >* dd4hep::detail::GeoHandler::m_data { nullptr }
protected

actual container with std::vector (preserves order)

Definition at line 93 of file GeoHandler.h.

◆ m_daughters

std::map<const TGeoNode*, std::vector<TGeoNode*> >* dd4hep::detail::GeoHandler::m_daughters { nullptr }
protected

Definition at line 97 of file GeoHandler.h.

◆ m_propagateRegions

bool dd4hep::detail::GeoHandler::m_propagateRegions { false }
protected

Definition at line 90 of file GeoHandler.h.

◆ m_set_data

std::map<int, std::set<const TGeoNode*> >* dd4hep::detail::GeoHandler::m_set_data { nullptr }
protected

redundant container with std::set (for lookup purpose)

Definition at line 95 of file GeoHandler.h.


The documentation for this class was generated from the following files: