ATLAS Offline Software
Functions
GeoVisitVolumes.cxx File Reference

Visitor to process all volumes under a GeoModel node. More...

#include "GeoModelUtilities/GeoVisitVolumes.h"
#include "GeoModelKernel/GeoNameTag.h"
#include "GeoModelKernel/GeoSerialDenominator.h"
#include "GeoModelKernel/GeoSerialIdentifier.h"
#include "CxxUtils/inline_hints.h"
#include <string>
Include dependency graph for GeoVisitVolumes.cxx:

Go to the source code of this file.

Functions

GeoVolumeVec_t geoGetVolumes (const GeoGraphNode *node, int depthLimit, int sizeHint)
 Return the child volumes and associated transforms. More...
 
std::vector< const GeoVPhysVol * > geoGetVolumesNoXform (const GeoGraphNode *node, int depthLimit, int sizeHint)
 Return the child volumes. More...
 

Detailed Description

Visitor to process all volumes under a GeoModel node.

Author
scott snyder snyde.nosp@m.r@bn.nosp@m.l.gov
Date
Jul, 2019 Based on GeoAccessVolumeAction.

Definition in file GeoVisitVolumes.cxx.

Function Documentation

◆ geoGetVolumes()

GeoVolumeVec_t geoGetVolumes ( const GeoGraphNode *  node,
int  depthLimit,
int  sizeHint 
)

Return the child volumes and associated transforms.

Parameters
nodeRoot of the graph to traverse.
depthLimitDepth limit for the traversal.
sizeHintHint about the number of volumes to be returned, to allow avoiding resizes of the output vector.

Returns a vector of (volume, transform) pairs for volumes in the graph. The same volume may be returned multiple times with different transforms in the case of a GeoSerialTransform.

Definition at line 211 of file GeoVisitVolumes.cxx.

214 {
216  ret.reserve (sizeHint);
217  geoVisitVolumes ([&] (int /*id*/,
218  const std::string& /*name*/,
219  const GeoVPhysVol* volume,
221  const GeoTrf::Transform3D& /*defTransform*/)
222  { ret.emplace_back (volume, transform); },
223  node,
224  depthLimit);
225  return ret;
226 }

◆ geoGetVolumesNoXform()

std::vector<const GeoVPhysVol*> geoGetVolumesNoXform ( const GeoGraphNode *  node,
int  depthLimit,
int  sizeHint 
)

Return the child volumes.

Parameters
nodeRoot of the graph to traverse.
depthLimitDepth limit for the traversal.
sizeHintHint about the number of volumes to be returned, to allow avoiding resizes of the output vector.

Returns a vector of volumes in the graph. The same volume may be returned multiple times in the case of a GeoSerialTransform.

Definition at line 240 of file GeoVisitVolumes.cxx.

243 {
244  std::vector<const GeoVPhysVol*> ret;
245  ret.reserve (sizeHint);
246  geoVisitVolumesNoXform ([&] (int /*id*/,
247  const std::string& /*name*/,
248  const GeoVPhysVol* volume)
249  { ret.push_back (volume); },
250  node,
251  depthLimit);
252  return ret;
253 }
geoVisitVolumesNoXform
void geoVisitVolumesNoXform(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition: GeoVisitVolumes.h:199
GeoVolumeVec_t
std::vector< std::pair< const GeoVPhysVol *, GeoTrf::Transform3D > > GeoVolumeVec_t
Return the child volumes and associated transforms.
Definition: GeoVisitVolumes.h:219
ret
T ret(T t)
Definition: rootspy.cxx:260
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
geoVisitVolumes
void geoVisitVolumes(FUNCTION f, const GeoGraphNode *node, int depthLimit=1)
Template helper for running the visitor.
Definition: GeoVisitVolumes.h:185