ATLAS Offline Software
Public Member Functions | List of all members
MuonGMR4::MuonGeoUtilityTool Class Referencefinal

#include <MuonGeoUtilityTool.h>

Inheritance diagram for MuonGMR4::MuonGeoUtilityTool:
Collaboration diagram for MuonGMR4::MuonGeoUtilityTool:

Public Member Functions

virtual ~MuonGeoUtilityTool () override final
 
const GeoAlignableTransform * findAlignableTransform (const PVConstLink &physVol) const override final
 
const GeoShape * extractShape (const PVConstLink &physVol) const override final
 
const GeoShape * extractShape (const GeoShape *inShape) const override final
 
std::vector< physVolWithTransfindAllLeafNodesByName (const PVConstLink &physVol, const std::string &volumeName) const override final
 
std::vector< const GeoShape * > getComponents (const GeoShape *booleanShape) const override final
 
std::string dumpShape (const GeoShape *inShape) const override final
 Dumps the shape to string. More...
 
std::string dumpVolume (const PVConstLink &physVol) const override final
 
std::vector< Amg::Vector2DpolygonEdges (const GeoSimplePolygonBrep &polygon) const override
 Transforms the vertices of the Polygon shape into a std::vector consisting of Amg::Vector2D objects. More...
 
std::vector< Amg::Vector3DshapeEdges (const GeoShape *shape, const Amg::Transform3D &refTrf) const override
 

Detailed Description

Definition at line 18 of file MuonGeoUtilityTool.h.

Constructor & Destructor Documentation

◆ ~MuonGeoUtilityTool()

MuonGMR4::MuonGeoUtilityTool::~MuonGeoUtilityTool ( )
finaloverridevirtualdefault

Member Function Documentation

◆ dumpShape()

std::string MuonGMR4::MuonGeoUtilityTool::dumpShape ( const GeoShape *  inShape) const
finaloverride

Dumps the shape to string.

Definition at line 57 of file MuonGeoUtilitiyTool.cxx.

57 { return printGeoShape(shape); }

◆ dumpVolume()

std::string MuonGMR4::MuonGeoUtilityTool::dumpVolume ( const PVConstLink &  physVol) const
finaloverride

Definition at line 58 of file MuonGeoUtilitiyTool.cxx.

58 { return printVolume(physVol); }

◆ extractShape() [1/2]

const GeoShape * MuonGMR4::MuonGeoUtilityTool::extractShape ( const GeoShape *  inShape) const
finaloverride

Definition at line 40 of file MuonGeoUtilitiyTool.cxx.

40  {
41 
42  if (inShape->typeID() == GeoShapeShift::getClassTypeID()) {
43  const auto shift = dynamic_pointer_cast<const GeoShapeShift>(compressShift(inShape));
44  ATH_MSG_VERBOSE(__FILE__<<":"<<__LINE__<<" "<<__func__<<
45  "Shape is a shift by "<<GeoTrf::toString(shift->getX())
46  << ". Continue navigation "<<printGeoShape(shift));
47  return extractShape(shift->getOp());
48  }
49  if (inShape->typeID() == GeoShapeSubtraction::getClassTypeID()){
50  ATH_MSG_VERBOSE(__FILE__<<":"<<__LINE__<<" "<<__func__<<
51  "Shape is a subtraction. Extract the basic shape. Continue navigation "<<inShape);
52  const GeoShapeSubtraction* subtract = static_cast<const GeoShapeSubtraction*>(inShape);
53  return extractShape(subtract->getOpA());
54  }
55  return inShape;
56 }

◆ extractShape() [2/2]

const GeoShape * MuonGMR4::MuonGeoUtilityTool::extractShape ( const PVConstLink &  physVol) const
finaloverride

Definition at line 37 of file MuonGeoUtilitiyTool.cxx.

37  {
38  return extractShape(physVol->getLogVol()->getShape());
39 }

◆ findAlignableTransform()

const GeoAlignableTransform * MuonGMR4::MuonGeoUtilityTool::findAlignableTransform ( const PVConstLink &  physVol) const
finaloverride

Definition at line 59 of file MuonGeoUtilitiyTool.cxx.

59  {
60  PVConstLink parent{physVol->getParent()}, child{physVol};
61  while (parent) {
62  const GeoGraphNode * const * node1 = parent->findChildNode(child);
63  const GeoGraphNode * const * fence = parent->getChildNode(0);
64  for(const GeoGraphNode * const * current = node1 - 1; current>=fence; current--) {
65  const GeoGraphNode* node{*current};
66  if (dynamic_cast<const GeoVPhysVol*>(node)) {
67  break;
68  }
69  const GeoAlignableTransform* alignTrans{dynamic_cast<const GeoAlignableTransform*>(node)};
70  if (alignTrans) {
71  return alignTrans;
72  }
73  }
74  child = parent;
75  parent = child->getParent();
76  }
77  return nullptr;
78 }

◆ findAllLeafNodesByName()

std::vector< MuonGeoUtilityTool::physVolWithTrans > MuonGMR4::MuonGeoUtilityTool::findAllLeafNodesByName ( const PVConstLink &  physVol,
const std::string &  volumeName 
) const
finaloverride

Definition at line 80 of file MuonGeoUtilitiyTool.cxx.

80  {
81  return getAllSubVolumes(physVol,[&volumeName](const physVolWithTrans& child){
82  return child.volume->getLogVol()->getName() == volumeName || child.nodeName == volumeName;
83  });
84 }

◆ getComponents()

std::vector< const GeoShape * > MuonGMR4::MuonGeoUtilityTool::getComponents ( const GeoShape *  booleanShape) const
finaloverride

Definition at line 85 of file MuonGeoUtilitiyTool.cxx.

85  {
86  return getBooleanComponents(booleanShape);
87 }

◆ polygonEdges()

std::vector< Amg::Vector2D > MuonGMR4::MuonGeoUtilityTool::polygonEdges ( const GeoSimplePolygonBrep &  polygon) const
override

Transforms the vertices of the Polygon shape into a std::vector consisting of Amg::Vector2D objects.

Definition at line 89 of file MuonGeoUtilitiyTool.cxx.

89  {
90  std::vector<Amg::Vector2D> polygonEdges{};
91  polygonEdges.reserve(polygon.getNVertices());
92  for (unsigned int i = 0; i < polygon.getNVertices(); ++i) {
93  polygonEdges.emplace_back(polygon.getXVertex(i), polygon.getYVertex(i));
94  ATH_MSG_VERBOSE("Polygon vertext point " << i << ": "<< GeoTrf::toString(polygonEdges.back(), 2));
95  }
96  return polygonEdges;
97 }

◆ shapeEdges()

std::vector< Amg::Vector3D > MuonGMR4::MuonGeoUtilityTool::shapeEdges ( const GeoShape *  shape,
const Amg::Transform3D refTrf 
) const
override

Definition at line 99 of file MuonGeoUtilitiyTool.cxx.

100  {
101  return getPolyShapeEdges(shape, refTrf);
102 }

The documentation for this class was generated from the following files:
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dumpTruth.getName
getName
Definition: dumpTruth.py:34
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
MuonGMR4::MuonGeoUtilityTool::polygonEdges
std::vector< Amg::Vector2D > polygonEdges(const GeoSimplePolygonBrep &polygon) const override
Transforms the vertices of the Polygon shape into a std::vector consisting of Amg::Vector2D objects.
Definition: MuonGeoUtilitiyTool.cxx:89
lumiFormat.i
int i
Definition: lumiFormat.py:85
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
MuonGMR4::physVolWithTrans
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
Definition: MdtReadoutGeomTool.cxx:31
node
Definition: node.h:21
MuonGMR4::MuonGeoUtilityTool::extractShape
const GeoShape * extractShape(const PVConstLink &physVol) const override final
Definition: MuonGeoUtilitiyTool.cxx:37