DD4hep  1.38.0
Detector Description Toolkit for High Energy Physics
Classes | Typedefs | Functions
dd4hep::detail::tools Namespace Reference

Helper namespace used to answer detector element specific questons. More...

Classes

class  PlacementPathCache
 

Typedefs

typedef std::vector< DetElement > ElementPath
 
typedef std::vector< PlacedVolume > PlacementPath
 

Functions

void copy (Alignment from, Alignment to)
 Copy alignment object from source object. More...
 
void computeIdeal (Alignment alignment)
 Compute the ideal/nominal to-world transformation from the detector element placement. More...
 
void computeSurvey (Alignment alignment)
 Compute the ideal/nominal to-world transformation from the detector element placement. More...
 
DetElement topElement (DetElement child)
 Determine top level element (=world) for any element walking up the detector element tree. More...
 
std::string elementPath (DetElement element)
 Assemble the path of a particular detector element. More...
 
std::string elementPath (const ElementPath &nodes, bool reverse=true)
 Assemble the path of the PlacedVolume selection. More...
 
void elementPath (DetElement elt, ElementPath &detectors)
 Collect detector elements to the top detector element (world) More...
 
DetElement findElement (const Detector &description, const std::string &path)
 Find DetElement as child of the top level volume by its absolute path. More...
 
DetElement findDaughterElement (DetElement parent, const std::string &subpath)
 Find DetElement as child of a parent by its relative or absolute path. More...
 
bool isParentElement (DetElement parent, DetElement child)
 Find path between the child element and the parent element. More...
 
std::string placementPath (DetElement element)
 Assemble the placement path from a given detector element to the world volume. More...
 
std::string placementPath (const PlacementPath &nodes, bool reverse=true)
 Assemble the path of the PlacedVolume selection. More...
 
std::string placementPath (const std::vector< const TGeoNode * > &nodes, bool reverse=true)
 Assemble the path of the PlacedVolume selection. More...
 
void placementPath (DetElement elt, PlacementPath &nodes)
 Collect detector elements placements to the top detector element (world) [no holes!]. More...
 
void placementPath (DetElement parent, DetElement child, PlacementPath &nodes)
 Collect detector elements placements to the parent detector element [no holes!]. More...
 
void clearPathCaches (DetElement element)
 Clear the placement path cache of this thread and the paths cached by the detector element and its children. More...
 
PlacedVolume findNode (PlacedVolume top_place, const std::string &place)
 Find a given node in the hierarchy starting from the top node (absolute placement!) More...
 
void placementTrafo (const PlacementPath &nodes, bool inverse, TGeoHMatrix *&mat)
 Update cached matrix to transform to positions to an upper level Placement. More...
 
void placementTrafo (const PlacementPath &nodes, bool inverse, TGeoHMatrix &mat)
 Update cached matrix to transform to positions to an upper level Placement. More...
 
std::string toString (const PlacedVolume::VolIDs &ids)
 Convert VolumeID to string. More...
 
std::string toString (const IDDescriptor &dsc, const PlacedVolume::VolIDs &ids, VolumeID code)
 Convert VolumeID to string. More...
 
std::vector< std::string > pathElements (const std::string &path)
 Extract all the path elements from a path. More...
 
std::string elementPath (const PlacementPath &nodes, bool reverse)
 Assemble the path of the PlacedVolume selection. More...
 
void elementPath (DetElement parent, DetElement elt, ElementPath &detectors)
 Collect detector elements to any parent detector element. More...
 
void elementPath (DetElement elt, PlacementPath &nodes)
 Collect detector elements placements to the top detector element (world) [fast, but may have holes!]. More...
 
void elementPath (DetElement parent, DetElement element, PlacementPath &nodes)
 Collect detector elements placements to the parent detector element [no holes!]. More...
 
bool findChild (PlacedVolume parent, PlacedVolume child, PlacementPath &path)
 Find Child of PlacedVolume and assemble on the fly the path of PlacedVolumes. More...
 

Detailed Description

Helper namespace used to answer detector element specific questons.

Author
M.Frank
Version
1.0

Typedef Documentation

◆ ElementPath

Definition at line 38 of file DetectorTools.h.

◆ PlacementPath

Definition at line 39 of file DetectorTools.h.

Function Documentation

◆ clearPathCaches()

void dd4hep::detail::tools::clearPathCaches ( DetElement  element)

Clear the placement path cache of this thread and the paths cached by the detector element and its children.

Definition at line 127 of file DetectorTools.cpp.

◆ computeIdeal()

void dd4hep::detail::tools::computeIdeal ( Alignment  alignment)

Compute the ideal/nominal to-world transformation from the detector element placement.

Note: Detector information of the alignment data is filled by the caller!

Definition at line 60 of file AlignmentTools.cpp.

◆ computeSurvey()

void dd4hep::detail::tools::computeSurvey ( Alignment  alignment)

Compute the ideal/nominal to-world transformation from the detector element placement.

Compute the survey to-world transformation from the detector element placement with respect to the survey constants.

Note: Detector information of the alignment data is filled by the caller! Compute the survey to-world transformation. Compute the survey to-world transformation from the detector element placement with respect to the survey constants

Note: Detector information of the alignment data is filled by the caller!

Definition at line 117 of file AlignmentTools.cpp.

◆ copy()

void dd4hep::detail::tools::copy ( Alignment  from,
Alignment  to 
)

Copy alignment object from source object.

Definition at line 43 of file AlignmentTools.cpp.

◆ elementPath() [1/7]

std::string dd4hep::detail::tools::elementPath ( const ElementPath &  nodes,
bool  reverse = true 
)

Assemble the path of the PlacedVolume selection.

Definition at line 283 of file DetectorTools.cpp.

◆ elementPath() [2/7]

std::string dd4hep::detail::tools::elementPath ( const PlacementPath &  nodes,
bool  reverse 
)

Assemble the path of the PlacedVolume selection.

Definition at line 269 of file DetectorTools.cpp.

◆ elementPath() [3/7]

std::string dd4hep::detail::tools::elementPath ( DetElement  element)

Assemble the path of a particular detector element.

Definition at line 297 of file DetectorTools.cpp.

◆ elementPath() [4/7]

void dd4hep::detail::tools::elementPath ( DetElement  elt,
ElementPath &  detectors 
)

Collect detector elements to the top detector element (world)

Definition at line 214 of file DetectorTools.cpp.

◆ elementPath() [5/7]

void dd4hep::detail::tools::elementPath ( DetElement  elt,
PlacementPath &  nodes 
)

Collect detector elements placements to the top detector element (world) [fast, but may have holes!].

Definition at line 259 of file DetectorTools.cpp.

◆ elementPath() [6/7]

void dd4hep::detail::tools::elementPath ( DetElement  parent,
DetElement  element,
PlacementPath &  nodes 
)

Collect detector elements placements to the parent detector element [no holes!].

Collect detector elements placements to the top detector element (world) [fast, but may have holes!].

Definition at line 241 of file DetectorTools.cpp.

◆ elementPath() [7/7]

void dd4hep::detail::tools::elementPath ( DetElement  parent,
DetElement  elt,
ElementPath &  detectors 
)

Collect detector elements to any parent detector element.

Definition at line 220 of file DetectorTools.cpp.

◆ findChild()

bool dd4hep::detail::tools::findChild ( PlacedVolume  parent,
PlacedVolume  child,
PlacementPath &  path 
)

Find Child of PlacedVolume and assemble on the fly the path of PlacedVolumes.

Definition at line 152 of file DetectorTools.cpp.

◆ findDaughterElement()

DetElement dd4hep::detail::tools::findDaughterElement ( DetElement  parent,
const std::string &  subpath 
)

Find DetElement as child of a parent by its relative or absolute path.

Definition at line 309 of file DetectorTools.cpp.

◆ findElement()

DetElement dd4hep::detail::tools::findElement ( const Detector &  description,
const std::string &  path 
)

Find DetElement as child of the top level volume by its absolute path.

Definition at line 304 of file DetectorTools.cpp.

◆ findNode()

PlacedVolume dd4hep::detail::tools::findNode ( PlacedVolume  top_place,
const std::string &  place 
)

Find a given node in the hierarchy starting from the top node (absolute placement!)

Definition at line 423 of file DetectorTools.cpp.

◆ isParentElement()

bool dd4hep::detail::tools::isParentElement ( DetElement  parent,
DetElement  child 
)

Find path between the child element and the parent element.

Definition at line 141 of file DetectorTools.cpp.

◆ pathElements()

std::vector< std::string > dd4hep::detail::tools::pathElements ( const std::string &  path)

Extract all the path elements from a path.

Definition at line 492 of file DetectorTools.cpp.

◆ placementPath() [1/5]

std::string dd4hep::detail::tools::placementPath ( const PlacementPath &  nodes,
bool  reverse = true 
)

Assemble the path of the PlacedVolume selection.

Definition at line 378 of file DetectorTools.cpp.

◆ placementPath() [2/5]

std::string dd4hep::detail::tools::placementPath ( const std::vector< const TGeoNode * > &  nodes,
bool  reverse = true 
)

Assemble the path of the PlacedVolume selection.

Definition at line 392 of file DetectorTools.cpp.

◆ placementPath() [3/5]

std::string dd4hep::detail::tools::placementPath ( DetElement  element)

Assemble the placement path from a given detector element to the world volume.

Assemble the path of the PlacedVolume selection.

Definition at line 371 of file DetectorTools.cpp.

◆ placementPath() [4/5]

void dd4hep::detail::tools::placementPath ( DetElement  elt,
PlacementPath &  nodes 
)

Collect detector elements placements to the top detector element (world) [no holes!].

Definition at line 357 of file DetectorTools.cpp.

◆ placementPath() [5/5]

void dd4hep::detail::tools::placementPath ( DetElement  parent,
DetElement  child,
PlacementPath &  nodes 
)

Collect detector elements placements to the parent detector element [no holes!].

Definition at line 364 of file DetectorTools.cpp.

◆ placementTrafo() [1/2]

void dd4hep::detail::tools::placementTrafo ( const PlacementPath &  nodes,
bool  inverse,
TGeoHMatrix &  mat 
)

Update cached matrix to transform to positions to an upper level Placement.

Definition at line 411 of file DetectorTools.cpp.

◆ placementTrafo() [2/2]

void dd4hep::detail::tools::placementTrafo ( const PlacementPath &  nodes,
bool  inverse,
TGeoHMatrix *&  mat 
)

Update cached matrix to transform to positions to an upper level Placement.

Definition at line 405 of file DetectorTools.cpp.

◆ topElement()

DetElement dd4hep::detail::tools::topElement ( DetElement  child)

Determine top level element (=world) for any element walking up the detector element tree.

Definition at line 330 of file DetectorTools.cpp.

◆ toString() [1/2]

std::string dd4hep::detail::tools::toString ( const IDDescriptor &  dsc,
const PlacedVolume::VolIDs &  ids,
VolumeID  code 
)

Convert VolumeID to string.

Definition at line 481 of file DetectorTools.cpp.

◆ toString() [2/2]

std::string dd4hep::detail::tools::toString ( const PlacedVolume::VolIDs &  ids)

Convert VolumeID to string.

Definition at line 473 of file DetectorTools.cpp.