DD4hep  1.38.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
dd4hep::detail::VolumeManager_Populator Class Reference

Helper class to populate the volume manager. More...

Public Member Functions

 VolumeManager_Populator (const Detector &description, VolumeManager vm)
 Default constructor. More...
 
size_t numNodes () const
 Access node count. More...
 
bool hasSensitiveContent (TGeoVolume *vol)
 Returns true if vol or any descendant is a sensitive volume (result is cached). More...
 
void populate (DetElement e)
 Populate the Volume manager. More...
 
size_t scanPhysicalVolume (DetElement &parent, DetElement e, PlacedVolume pv, Encoding parent_encoding, SensitiveDetector &sd, Chain &chain)
 Scan a single physical volume and look for sensitive elements below. More...
 
void add_entry (SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode *n, const Encoding &code, Chain &nodes)
 
void print_node (SensitiveDetector sd, DetElement parent, DetElement e, const TGeoNode *n, const Encoding &code, const Chain &nodes) const
 

Static Public Member Functions

static Encoding update_encoding (const IDDescriptor iddesc, const VolIDs &ids, const Encoding &initial)
 Compute the encoding for a set of VolIDs within a readout descriptor. More...
 
static Encoding encoding (const IDDescriptor iddesc, const VolIDs &ids)
 Compute the encoding for a set of VolIDs within a readout descriptor. More...
 

Private Types

typedef std::vector< TGeoNode * > Chain
 
typedef PlacedVolume::VolIDs VolIDs
 
typedef std::pair< VolumeID, VolumeIDEncoding
 

Private Attributes

const Detectorm_detDesc
 Reference to the Detector instance. More...
 
VolumeManager m_volManager
 Reference to the volume manager to be populated. More...
 
std::set< VolumeIDm_entries
 Set of already added entries. More...
 
std::unordered_map< TGeoVolume *, bool > m_has_sensitive
 Cache: does a TGeoVolume subtree contain any sensitive volume? More...
 
bool m_debug = false
 Debug flag. More...
 
std::size_t m_numNodes = 0
 Node counter. More...
 

Detailed Description

Helper class to populate the volume manager.

Author
M.Frank
Version
1.0

Definition at line 46 of file VolumeManager.cpp.

Member Typedef Documentation

◆ Chain

typedef std::vector<TGeoNode*> dd4hep::detail::VolumeManager_Populator::Chain
private

Definition at line 47 of file VolumeManager.cpp.

◆ Encoding

Definition at line 49 of file VolumeManager.cpp.

◆ VolIDs

Definition at line 48 of file VolumeManager.cpp.

Constructor & Destructor Documentation

◆ VolumeManager_Populator()

dd4hep::detail::VolumeManager_Populator::VolumeManager_Populator ( const Detector description,
VolumeManager  vm 
)
inline

Default constructor.

Definition at line 65 of file VolumeManager.cpp.

Member Function Documentation

◆ add_entry()

void dd4hep::detail::VolumeManager_Populator::add_entry ( SensitiveDetector  sd,
DetElement  parent,
DetElement  e,
const TGeoNode *  n,
const Encoding code,
Chain nodes 
)
inline

Definition at line 256 of file VolumeManager.cpp.

◆ encoding()

static Encoding dd4hep::detail::VolumeManager_Populator::encoding ( const IDDescriptor  iddesc,
const VolIDs ids 
)
inlinestatic

Compute the encoding for a set of VolIDs within a readout descriptor.

Definition at line 242 of file VolumeManager.cpp.

◆ hasSensitiveContent()

bool dd4hep::detail::VolumeManager_Populator::hasSensitiveContent ( TGeoVolume *  vol)
inline

Returns true if vol or any descendant is a sensitive volume (result is cached).

Definition at line 75 of file VolumeManager.cpp.

◆ numNodes()

size_t dd4hep::detail::VolumeManager_Populator::numNodes ( ) const
inline

Access node count.

Definition at line 72 of file VolumeManager.cpp.

◆ populate()

void dd4hep::detail::VolumeManager_Populator::populate ( DetElement  e)
inline

Populate the Volume manager.

Definition at line 88 of file VolumeManager.cpp.

◆ print_node()

void dd4hep::detail::VolumeManager_Populator::print_node ( SensitiveDetector  sd,
DetElement  parent,
DetElement  e,
const TGeoNode *  n,
const Encoding code,
const Chain nodes 
) const
inline

Definition at line 295 of file VolumeManager.cpp.

◆ scanPhysicalVolume()

size_t dd4hep::detail::VolumeManager_Populator::scanPhysicalVolume ( DetElement parent,
DetElement  e,
PlacedVolume  pv,
Encoding  parent_encoding,
SensitiveDetector sd,
Chain chain 
)
inline

Scan a single physical volume and look for sensitive elements below.

Check if this particular volume is the placement of one of the children of this detector element. If the daughter placement is also a detector child, then we must reset the node chain.

Distinguish logically the two following cases for our understanding.... Though the treatment is identical

Definition at line 111 of file VolumeManager.cpp.

◆ update_encoding()

static Encoding dd4hep::detail::VolumeManager_Populator::update_encoding ( const IDDescriptor  iddesc,
const VolIDs ids,
const Encoding initial 
)
inlinestatic

Compute the encoding for a set of VolIDs within a readout descriptor.

Definition at line 228 of file VolumeManager.cpp.

Member Data Documentation

◆ m_debug

bool dd4hep::detail::VolumeManager_Populator::m_debug = false
private

Debug flag.

Definition at line 59 of file VolumeManager.cpp.

◆ m_detDesc

const Detector& dd4hep::detail::VolumeManager_Populator::m_detDesc
private

Reference to the Detector instance.

Definition at line 51 of file VolumeManager.cpp.

◆ m_entries

std::set<VolumeID> dd4hep::detail::VolumeManager_Populator::m_entries
private

Set of already added entries.

Definition at line 55 of file VolumeManager.cpp.

◆ m_has_sensitive

std::unordered_map<TGeoVolume*, bool> dd4hep::detail::VolumeManager_Populator::m_has_sensitive
private

Cache: does a TGeoVolume subtree contain any sensitive volume?

Definition at line 57 of file VolumeManager.cpp.

◆ m_numNodes

std::size_t dd4hep::detail::VolumeManager_Populator::m_numNodes = 0
private

Node counter.

Definition at line 61 of file VolumeManager.cpp.

◆ m_volManager

VolumeManager dd4hep::detail::VolumeManager_Populator::m_volManager
private

Reference to the volume manager to be populated.

Definition at line 53 of file VolumeManager.cpp.


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