ATLAS Offline Software
Loading...
Searching...
No Matches
ChamberAssembleTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef SIMULATIONBASE
5#ifndef MUONGEOMODELR4_MUONCHAMBERASSMBLETOOL_H
6#define MUONGEOMODELR4_MUONCHAMBERASSMBLETOOL_H
7
9
11
16
17#include "Acts/Surfaces/SurfaceBounds.hpp"
18#include "Acts/Geometry/VolumeBounds.hpp"
19#include "Acts/Utilities/PointerTraits.hpp"
20#include "Acts/Utilities/BoundFactory.hpp"
21#include <tuple>
22
23namespace MuonGMR4 {
24
28class ChamberAssembleTool : public extends<AthAlgTool, IMuonReadoutGeomTool> {
29 public:
31 using base_class::base_class;
32
33 virtual StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final;
34
36 using VolBounds_t = Acts::VolumeBounds;
38 using VolBoundPtr_t = std::shared_ptr<VolBounds_t>;
40 using SurfBoundPtr_t = std::shared_ptr<const Acts::PlanarBounds>;
42 using TrfWithBounds = std::tuple<Amg::Transform3D, VolBoundPtr_t, SurfBoundPtr_t>;
43 private:
53 template <typename ReObjType>
55 const std::vector<ReObjType>& constituents,
56 const Amg::Transform3D& globToLoc,
57 Acts::VolumeBoundFactory& volBoundSet,
58 Acts::SurfaceBoundFactory& surfBoundSet,
59 const double margin) const
60 requires (Acts::PointerConcept<ReObjType>);
61
66 Acts::VolumeBoundFactory& boundSet);
68
69 static VolBoundPtr_t boundingBox(const ChamberPtr& chamber,
70 Acts::VolumeBoundFactory& boundSet);
71
75 static std::array<Amg::Vector3D, 4> cornerPointsPlane(const Amg::Transform3D& localToGlob,
76 const VolBounds_t& bounds);
77
81 static std::array<Amg::Vector3D, 8> cornerPoints(const Amg::Transform3D& localToGlob,
82 const VolBounds_t& bounds);
83
87 static Amg::Transform3D centerTrapezoid(const std::array<Amg::Vector3D, 8>& cornerPoints);
94 static double trapezoidEdgeDist(const Amg::Vector3D& linePos,
95 const Amg::Vector3D& lineDir,
96 const Amg::Vector3D& testMe,
97 bool leftEdge);
102 static VolBoundPtr_t enlargeBounds(const VolBounds_t& enlargeMe,
103 const double margin,
104 Acts::VolumeBoundFactory& volBoundSet);
109 static SurfBoundPtr_t surfaceBounds(const VolBounds_t& volBounds,
110 Acts::SurfaceBoundFactory& surfBoundSet);
111 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
114 Gaudi::Property<bool> m_isRun4{this, "run4Layout", false};
115};
116
117}
118
119#endif
120#endif
121
Assembly tool to produce the Acts envolpe volumes around the muon stations & also to construct the sp...
std::shared_ptr< const Acts::PlanarBounds > SurfBoundPtr_t
Abrivation of the surface bounds.
static std::array< Amg::Vector3D, 4 > cornerPointsPlane(const Amg::Transform3D &localToGlob, const VolBounds_t &bounds)
Returns the 4 corners of the trapezoid in the x-y plane.
static std::array< Amg::Vector3D, 8 > cornerPoints(const Amg::Transform3D &localToGlob, const VolBounds_t &bounds)
Returns the 8 corners marking the trapezoid.
Acts::VolumeBounds VolBounds_t
Abrivation of the volume bounds.
virtual StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final
Gaudi::Property< bool > m_isRun4
Toggling whether the layout is a R3 or R4 layout.
SpectrometerSector::ChamberPtr ChamberPtr
TrfWithBounds boundingBox(const ActsTrk::GeometryContext &gctx, const std::vector< ReObjType > &constituents, const Amg::Transform3D &globToLoc, Acts::VolumeBoundFactory &volBoundSet, Acts::SurfaceBoundFactory &surfBoundSet, const double margin) const
builds the bounding box trapezoidal volume bounds from the set of readout elements Returns a pair of ...
std::shared_ptr< VolBounds_t > VolBoundPtr_t
Abrivation of the Volume bound ptr.
std::tuple< Amg::Transform3D, VolBoundPtr_t, SurfBoundPtr_t > TrfWithBounds
Abrivation of the volume transform together with a set of volume & surface bounds.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
static SurfBoundPtr_t surfaceBounds(const VolBounds_t &volBounds, Acts::SurfaceBoundFactory &surfBoundSet)
Construct surface bounds which measure equal sizes in halfXlow/halfXhigh & halfY as the parsed volume...
static double trapezoidEdgeDist(const Amg::Vector3D &linePos, const Amg::Vector3D &lineDir, const Amg::Vector3D &testMe, bool leftEdge)
Returns the signed distances of an external point to the trapezoidal edge.
static VolBoundPtr_t enlargeBounds(const VolBounds_t &enlargeMe, const double margin, Acts::VolumeBoundFactory &volBoundSet)
Enlarge the parsed volume bounds by an extra margin attached to all 3 dimensions.
static Amg::Transform3D centerTrapezoid(const std::array< Amg::Vector3D, 8 > &cornerPoints)
Returns the translation transform centering the 8 corner points of the trapezoid.
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
GeoModel::TransientConstSharedPtr< Chamber > ChamberPtr
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...