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#include <ActsGeoUtils/Defs.h>
17
18#include "Acts/Surfaces/SurfaceBounds.hpp"
19#include "Acts/Geometry/VolumeBounds.hpp"
20#include "Acts/Utilities/PointerTraits.hpp"
21#include "Acts/Utilities/BoundFactory.hpp"
22#include <tuple>
23
24namespace MuonGMR4 {
25
29class ChamberAssembleTool : public extends<AthAlgTool, IMuonReadoutGeomTool> {
30 public:
32 using base_class::base_class;
33
34 virtual StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final;
35
37 using VolBounds_t = Acts::VolumeBounds;
39 using VolBoundPtr_t = std::shared_ptr<VolBounds_t>;
41 using SurfBoundPtr_t = std::shared_ptr<const Acts::PlanarBounds>;
43 using TrfWithBounds = std::tuple<Amg::Transform3D, VolBoundPtr_t, SurfBoundPtr_t>;
44 private:
54 template <typename ReObjType>
56 const std::vector<ReObjType>& constituents,
57 const Amg::Transform3D& globToLoc,
58 Acts::VolumeBoundFactory& volBoundSet,
59 Acts::SurfaceBoundFactory& surfBoundSet,
60 const double margin) const
61 requires (Acts::PointerConcept<ReObjType>);
62
67 Acts::VolumeBoundFactory& boundSet);
69
70 static VolBoundPtr_t boundingBox(const ChamberPtr& chamber,
71 Acts::VolumeBoundFactory& boundSet);
72
76 static std::array<Amg::Vector3D, 4> cornerPointsPlane(const Amg::Transform3D& localToGlob,
77 const VolBounds_t& bounds);
78
82 static std::array<Amg::Vector3D, 8> cornerPoints(const Amg::Transform3D& localToGlob,
83 const VolBounds_t& bounds);
84
88 static Amg::Transform3D centerTrapezoid(const std::array<Amg::Vector3D, 8>& cornerPoints);
95 static double trapezoidEdgeDist(const Amg::Vector3D& linePos,
96 const Amg::Vector3D& lineDir,
97 const Amg::Vector3D& testMe,
98 bool leftEdge);
103 static VolBoundPtr_t enlargeBounds(const VolBounds_t& enlargeMe,
104 const double margin,
105 Acts::VolumeBoundFactory& volBoundSet);
110 static SurfBoundPtr_t surfaceBounds(const VolBounds_t& volBounds,
111 Acts::SurfaceBoundFactory& surfBoundSet);
112 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
115 Gaudi::Property<bool> m_isRun4{this, "run4Layout", false};
116};
117
118}
119
120#endif
121#endif
122
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.
The MuonReadoutElement is an abstract class representing the geometry representing the 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...