ATLAS Offline Software
Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
MuonGMR4::MdtTubeLayer Class Reference

Helper struct to retrieve the tube lengths and the tube centers directly from the GeoModel tree. More...

#include <MdtTubeLayer.h>

Collaboration diagram for MuonGMR4::MdtTubeLayer:

Classes

struct  CutTubes
 Constructor taking the GeoModel parent node of the tube nodes. More...
 
struct  TubePositioner
 Helper struct to avoid browsing with the serial transformer. More...
 

Public Types

using CutTubeSet = std::set< CutTubes, std::less<> >
 
using TubePositionerSet = std::set< TubePositioner, std::less<> >
 

Public Member Functions

 MdtTubeLayer (const PVConstLink layer, const GeoIntrusivePtr< const GeoTransform > toLayTrf, const CutTubeSet &cutTubes)
 Standard constructor of a MdtTube layer. More...
 
unsigned int nTubes () const
 Returns the number of tubes in the layer. More...
 
const Amg::Transform3DlayerTransform () const
 : Returns the transformation from the layer to the muon station More...
 
const Amg::Transform3D tubeTransform (const unsigned int tube) const
 Returns the transformation of the tube to the muon station Index counting [0 - nTubes()-1]. More...
 
const Amg::Vector3D tubePosInLayer (const unsigned int tube) const
 Returns the tube position within the given tube layer. More...
 
double tubeHalfLength (const unsigned int tube) const
 Returns the half-length of the given tube. More...
 
double uncutHalfLength (const unsigned int tube) const
 Returns the uncut-half length of the given tube. More...
 
PVConstLink getTubeNode (unsigned int tube) const
 returns the PVConst link to the n-th tube [0 - nTubes() -1] More...
 

Public Attributes

friend MdtTubeLayerSorter
 

Private Attributes

PVConstLink m_layerNode {nullptr}
 
GeoIntrusivePtr< const GeoTransform > m_layTrf {nullptr}
 
CutTubeSet m_cutTubes {}
 
TubePositionerSet m_tubePos {}
 
Amg::Vector3D m_tubePitch {Amg::Vector3D::Zero()}
 

Detailed Description

Helper struct to retrieve the tube lengths and the tube centers directly from the GeoModel tree.

Definition at line 28 of file MdtTubeLayer.h.

Member Typedef Documentation

◆ CutTubeSet

using MuonGMR4::MdtTubeLayer::CutTubeSet = std::set<CutTubes, std::less<> >

Definition at line 48 of file MdtTubeLayer.h.

◆ TubePositionerSet

Definition at line 65 of file MdtTubeLayer.h.

Constructor & Destructor Documentation

◆ MdtTubeLayer()

MuonGMR4::MdtTubeLayer::MdtTubeLayer ( const PVConstLink  layer,
const GeoIntrusivePtr< const GeoTransform >  toLayTrf,
const CutTubeSet cutTubes 
)

Standard constructor of a MdtTube layer.

Taking a GeoVPhysVol which is usually shared across multiple layers & chambers

Parameters
layerGeoVPhysVol representing this layer
toLayTrfTransformation to reach the layer
cutTubesList of tubes that are cut

Definition at line 47 of file MdtTubeLayer.cxx.

49  :
50  m_layerNode{std::move(layer)},
51  m_layTrf{std::move(toLayTrf)},
52  m_cutTubes{cutTubes} {
53 
54  const std::vector<GeoChildNodeWithTrf> children = getChildrenWithRef(m_layerNode, true);
55  unsigned int firstTube{0};
56  bool firstTubeSet{false};
57  for (const GeoChildNodeWithTrf& child : children) {
58  TubePositioner positioner{};
59  positioner.firstTube = firstTube;
60  positioner.lastTube = firstTube + child.nCopies -1;
61  positioner.firstTubePos = child.transform.translation();
62  positioner.tubeVol = child.volume;
63  if (!firstTubeSet && child.nCopies>1) {
64  m_tubePitch = child.inductionRule.translation();
65  firstTubeSet = true;
66  }
67  firstTube = positioner.lastTube + 1;
68  m_tubePos.insert(std::move(positioner));
69  }
70  }

Member Function Documentation

◆ getTubeNode()

PVConstLink MuonGMR4::MdtTubeLayer::getTubeNode ( unsigned int  tube) const

returns the PVConst link to the n-th tube [0 - nTubes() -1]

Definition at line 74 of file MdtTubeLayer.cxx.

74  {
75  TubePositionerSet::const_iterator tube_itr = m_tubePos.find(tube);
76  if (tube_itr == m_tubePos.end()) {
77  THROW_EXCEPTION(m_layerNode->getLogVol()->getName()<<" has only "<<nTubes()<<" tubes. But "
78  <<tube<<" is requested. Please check.");
79  }
80  return tube_itr->tubeVol;
81  }

◆ layerTransform()

const Amg::Transform3D & MuonGMR4::MdtTubeLayer::layerTransform ( ) const

: Returns the transformation from the layer to the muon station

Definition at line 71 of file MdtTubeLayer.cxx.

71  {
72  return m_layTrf->getDefTransform();
73  }

◆ nTubes()

unsigned int MuonGMR4::MdtTubeLayer::nTubes ( ) const

Returns the number of tubes in the layer.

Definition at line 94 of file MdtTubeLayer.cxx.

94  {
95  return m_layerNode->getNChildVols();
96  }

◆ tubeHalfLength()

double MuonGMR4::MdtTubeLayer::tubeHalfLength ( const unsigned int  tube) const

Returns the half-length of the given tube.

Definition at line 97 of file MdtTubeLayer.cxx.

97  {
98  TubePositionerSet::const_iterator tube_itr = m_tubePos.find(tube);
99  if (tube_itr == m_tubePos.end()) {
100  THROW_EXCEPTION(m_layerNode->getLogVol()->getName()<<" has only "<<nTubes()<<" tubes. But "
101  <<tube<<" is requested. Please check.");
102  }
103  const GeoShape* shape = tube_itr->tubeVol->getLogVol()->getShape();
104  const GeoTube* tubeShape = static_cast<const GeoTube*>(shape);
105  return tubeShape->getZHalfLength();
106  }

◆ tubePosInLayer()

const Amg::Vector3D MuonGMR4::MdtTubeLayer::tubePosInLayer ( const unsigned int  tube) const

Returns the tube position within the given tube layer.

Definition at line 91 of file MdtTubeLayer.cxx.

91  {
92  return layerTransform().inverse() * tubeTransform(tube).translation();
93  }

◆ tubeTransform()

const Amg::Transform3D MuonGMR4::MdtTubeLayer::tubeTransform ( const unsigned int  tube) const

Returns the transformation of the tube to the muon station Index counting [0 - nTubes()-1].

Definition at line 82 of file MdtTubeLayer.cxx.

82  {
83  TubePositionerSet::const_iterator tube_itr = m_tubePos.find(tube);
84  if (tube_itr == m_tubePos.end()) {
85  THROW_EXCEPTION(m_layerNode->getLogVol()->getName()<<" has only "<<nTubes()<<" tubes. But "
86  <<tube<<" is requested. Please check.");
87  }
88  return layerTransform() * Amg::getTranslate3D(tube_itr->firstTubePos)*
89  Amg::getTranslate3D(1.*(tube-tube_itr->firstTube)* m_tubePitch);
90  }

◆ uncutHalfLength()

double MuonGMR4::MdtTubeLayer::uncutHalfLength ( const unsigned int  tube) const

Returns the uncut-half length of the given tube.

Definition at line 107 of file MdtTubeLayer.cxx.

107  {
108  CutTubeSet::const_iterator itr = m_cutTubes.find(tube);
109  if (itr!= m_cutTubes.end()) {
110  return itr->unCutHalfLength;
111  }
112  return tubeHalfLength(tube);
113  }

Member Data Documentation

◆ m_cutTubes

CutTubeSet MuonGMR4::MdtTubeLayer::m_cutTubes {}
private

Definition at line 96 of file MdtTubeLayer.h.

◆ m_layerNode

PVConstLink MuonGMR4::MdtTubeLayer::m_layerNode {nullptr}
private

Definition at line 94 of file MdtTubeLayer.h.

◆ m_layTrf

GeoIntrusivePtr<const GeoTransform> MuonGMR4::MdtTubeLayer::m_layTrf {nullptr}
private

Definition at line 95 of file MdtTubeLayer.h.

◆ m_tubePitch

Amg::Vector3D MuonGMR4::MdtTubeLayer::m_tubePitch {Amg::Vector3D::Zero()}
private

Definition at line 98 of file MdtTubeLayer.h.

◆ m_tubePos

TubePositionerSet MuonGMR4::MdtTubeLayer::m_tubePos {}
private

Definition at line 97 of file MdtTubeLayer.h.

◆ MdtTubeLayerSorter

friend MuonGMR4::MdtTubeLayer::MdtTubeLayerSorter

Definition at line 67 of file MdtTubeLayer.h.


The documentation for this class was generated from the following files:
MuonGMR4::MdtTubeLayer::m_tubePitch
Amg::Vector3D m_tubePitch
Definition: MdtTubeLayer.h:98
MuonGMR4::MdtTubeLayer::layerTransform
const Amg::Transform3D & layerTransform() const
: Returns the transformation from the layer to the muon station
Definition: MdtTubeLayer.cxx:71
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
MuonGMR4::MdtTubeLayer::m_cutTubes
CutTubeSet m_cutTubes
Definition: MdtTubeLayer.h:96
MuonGMR4::MdtTubeLayer::nTubes
unsigned int nTubes() const
Returns the number of tubes in the layer.
Definition: MdtTubeLayer.cxx:94
MuonGMR4::MdtTubeLayer::tubeHalfLength
double tubeHalfLength(const unsigned int tube) const
Returns the half-length of the given tube.
Definition: MdtTubeLayer.cxx:97
MuonGMR4::MdtTubeLayer::tubeTransform
const Amg::Transform3D tubeTransform(const unsigned int tube) const
Returns the transformation of the tube to the muon station Index counting [0 - nTubes()-1].
Definition: MdtTubeLayer.cxx:82
MuonGMR4::MdtTubeLayer::m_tubePos
TubePositionerSet m_tubePos
Definition: MdtTubeLayer.h:97
MuonGMR4::MdtTubeLayer::m_layerNode
PVConstLink m_layerNode
Definition: MdtTubeLayer.h:94
python.DecayParser.children
children
Definition: DecayParser.py:32
MuonGMR4::MdtTubeLayer::m_layTrf
GeoIntrusivePtr< const GeoTransform > m_layTrf
Definition: MdtTubeLayer.h:95
calibdata.tube
tube
Definition: calibdata.py:31
Amg::getTranslate3D
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Definition: GeoPrimitivesHelpers.h:289