5#include <GeoModelKernel/GeoTube.h>
6#include <GeoModelKernel/GeoAccessVolumeAction.h>
8#include <GeoModelHelpers/TransformSorter.h>
9#include <GeoModelHelpers/GeoPhysVolSorter.h>
10#include <GeoModelHelpers/getChildNodesWithTrf.h>
16 return a.lastTube < tube;
19 return tube <
a.firstTube;
22 return a.lastTube < tube;
25 return tube <
a.firstTube;
31 if (
a.m_layTrf != b.m_layTrf) {
32 static const GeoTrf::TransformSorter trfSort{};
33 const int trfCmp = trfSort.compare(
a.layerTransform(), b.layerTransform());
34 if (trfCmp)
return trfCmp < 0;
36 if (
a.m_layerNode != b.m_layerNode) {
37 static const GeoPhysVolSorter physSort{};
38 return physSort(
a.m_layerNode, b.m_layerNode);
43 return (*
this)(*
a, *b);
48 const GeoIntrusivePtr<const GeoTransform> toLayTrf,
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) {
60 positioner.
lastTube = firstTube + child.nCopies -1;
62 positioner.
tubeVol = child.volume;
63 if (!firstTubeSet && child.nCopies>1) {
75 TubePositionerSet::const_iterator tube_itr =
m_tubePos.find(tube);
78 <<tube<<
" is requested. Please check.");
80 return tube_itr->tubeVol;
83 TubePositionerSet::const_iterator tube_itr =
m_tubePos.find(tube);
86 <<tube<<
" is requested. Please check.");
98 TubePositionerSet::const_iterator tube_itr =
m_tubePos.find(tube);
101 <<tube<<
" is requested. Please check.");
103 const GeoShape* shape = tube_itr->tubeVol->getLogVol()->getShape();
104 const GeoTube* tubeShape =
static_cast<const GeoTube*
>(shape);
105 return tubeShape->getZHalfLength();
108 CutTubeSet::const_iterator itr =
m_cutTubes.find(tube);
110 return itr->unCutHalfLength;
Visitor to process all volumes under a GeoModel node.
Helper struct to retrieve the tube lengths and the tube centers directly from the GeoModel tree.
Amg::Vector3D m_tubePitch
MdtTubeLayer(const PVConstLink layer, const GeoIntrusivePtr< const GeoTransform > toLayTrf, const CutTubeSet &cutTubes)
Standard constructor of a MdtTube layer.
PVConstLink getTubeNode(unsigned int tube) const
returns the PVConst link to the n-th tube [0 - nTubes() -1]
const Amg::Transform3D & layerTransform() const
: Returns the transformation from the layer to the muon station
std::set< CutTubes, std::less<> > CutTubeSet
unsigned int nTubes() const
Returns the number of tubes in the layer.
const Amg::Vector3D tubePosInLayer(const unsigned int tube) const
Returns the tube position within the given tube layer.
const Amg::Transform3D tubeTransform(const unsigned int tube) const
Returns the transformation of the tube to the muon station Index counting [0 - nTubes()-1].
TubePositionerSet m_tubePos
double tubeHalfLength(const unsigned int tube) const
Returns the half-length of the given tube.
double uncutHalfLength(const unsigned int tube) const
Returns the uncut-half length of the given tube.
GeoIntrusivePtr< const GeoTransform > m_layTrf
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
bool operator<(const MdtTubeLayer::CutTubes &a, const unsigned int tube)
GeoModel::TransientConstSharedPtr< MdtTubeLayer > MdtTubeLayerPtr
bool operator()(const MdtTubeLayer &a, const MdtTubeLayer &b) const
Constructor taking the GeoModel parent node of the tube nodes.
Helper struct to avoid browsing with the serial transformer.
unsigned int firstTube
First tube of the positioning.
unsigned int lastTube
Last tube of the positioning.
Amg::Vector3D firstTubePos
Transform to reach the first tube.
PVConstLink tubeVol
Underlying physical volume of the tube.
#define THROW_EXCEPTION(MESSAGE)