ATLAS Offline Software
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 
10 
15 #include <ActsGeoUtils/Defs.h>
16 
17 #include "Acts/Surfaces/SurfaceBounds.hpp"
18 #include "Acts/Geometry/VolumeBounds.hpp"
19 
20 #include <tuple>
21 namespace Acts{
22  class TrapezoidVolumeBounds;
23  class VolumeBounds;
24  class PlanarBounds;
25 }
26 
27 namespace MuonGMR4 {
28 
29 class MuonReadoutElement;
30 
31 class ChamberAssembleTool : public extends<AthAlgTool, IMuonReadoutGeomTool> {
32  public:
34  using base_class::base_class;
35 
36  virtual StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final;
37 
38  private:
39  using TrapVolBound_t = Acts::TrapezoidVolumeBounds;
40  using SurfBoundPtr_t = std::shared_ptr<const Acts::PlanarBounds>;
41  using VolBoundPtr_t = std::shared_ptr<Acts::TrapezoidVolumeBounds>;
42 
44  using TrfWithBounds = std::tuple<Amg::Transform3D, VolBoundPtr_t, SurfBoundPtr_t>;
52  const std::vector<const MuonReadoutElement*>& readoutEles,
53  const Amg::Transform3D& globToLoc,
54  Acts::VolumeBoundFactory& volBoundSet,
55  Acts::SurfaceBoundFactory& surfBoundSet,
56  const double margin = 1.*Gaudi::Units::cm) const;
57 
61  static VolBoundPtr_t boundingBox(const MuonReadoutElement* reEle,
62  Acts::VolumeBoundFactory& boundSet);
63 
67  static std::array<Amg::Vector3D, 4> cornerPointsPlane(const Amg::Transform3D& localToGlob,
68  const TrapVolBound_t& bounds);
69 
73  static std::array<Amg::Vector3D, 8> cornerPoints(const Amg::Transform3D& localToGlob,
74  const TrapVolBound_t& bounds);
75 
79  static Amg::Transform3D centerTrapezoid(const std::array<Amg::Vector3D, 8>& cornerPoints);
86  static double trapezoidEdgeDist(const Amg::Vector3D& linePos,
87  const Amg::Vector3D& lineDir,
88  const Amg::Vector3D& testMe,
89  bool leftEdge);
90 
91  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "IdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
92  PublicToolHandle<IMuonGeoUtilityTool> m_geoUtilTool{this,"GeoUtilTool", "" };
93 
94 };
95 
96 }
97 
98 #endif
99 #endif
100 
MuonGMR4::ChamberAssembleTool::centerTrapezoid
static Amg::Transform3D centerTrapezoid(const std::array< Amg::Vector3D, 8 > &cornerPoints)
Returns the translation transform centering the 8 corner points of the trapezoid.
Definition: ChamberAssembleTool.cxx:144
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonGMR4::ChamberAssembleTool::cornerPointsPlane
static std::array< Amg::Vector3D, 4 > cornerPointsPlane(const Amg::Transform3D &localToGlob, const TrapVolBound_t &bounds)
Returns the 4 corners of the trapezoid in the x-y plane.
Definition: ChamberAssembleTool.cxx:121
MuonGMR4::ChamberAssembleTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: ChamberAssembleTool.h:91
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
MuonGMR4::ChamberAssembleTool::boundingBox
TrfWithBounds boundingBox(const ActsGeometryContext &gctx, const std::vector< const MuonReadoutElement * > &readoutEles, const Amg::Transform3D &globToLoc, Acts::VolumeBoundFactory &volBoundSet, Acts::SurfaceBoundFactory &surfBoundSet, const double margin=1.*Gaudi::Units::cm) const
builds the bounding box trapezoidal volume bounds from the set of readout elements Returns a pair of ...
Definition: ChamberAssembleTool.cxx:161
MuonGMR4::ChamberAssembleTool::VolBoundPtr_t
std::shared_ptr< Acts::TrapezoidVolumeBounds > VolBoundPtr_t
Definition: ChamberAssembleTool.h:41
Defs.h
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:19
Acts
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/UtilFunctions.h:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
AthAlgTool.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::ChamberAssembleTool::buildReadOutElements
virtual StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final
Definition: ChamberAssembleTool.cxx:302
MuonGMR4::ChamberAssembleTool::TrfWithBounds
std::tuple< Amg::Transform3D, VolBoundPtr_t, SurfBoundPtr_t > TrfWithBounds
Abrivation of the volume transform together with a set of volume & surface bounds.
Definition: ChamberAssembleTool.h:44
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::ChamberAssembleTool::cornerPoints
static std::array< Amg::Vector3D, 8 > cornerPoints(const Amg::Transform3D &localToGlob, const TrapVolBound_t &bounds)
Returns the 8 corners marking the trapezoid.
Definition: ChamberAssembleTool.cxx:131
MuonGMR4::ChamberAssembleTool::SurfBoundPtr_t
std::shared_ptr< const Acts::PlanarBounds > SurfBoundPtr_t
Definition: ChamberAssembleTool.h:40
MdtReadoutElement.h
MuonGMR4::ChamberAssembleTool::trapezoidEdgeDist
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.
Definition: ChamberAssembleTool.cxx:69
MuonGMR4::ChamberAssembleTool
Definition: ChamberAssembleTool.h:31
MuonGMR4::ChamberAssembleTool::TrapVolBound_t
Acts::TrapezoidVolumeBounds TrapVolBound_t
Definition: ChamberAssembleTool.h:39
IMuonReaoutGeomTool.h
MuonGMR4::ChamberAssembleTool::m_geoUtilTool
PublicToolHandle< IMuonGeoUtilityTool > m_geoUtilTool
Definition: ChamberAssembleTool.h:92
IMuonGeoUtilityTool.h
IMuonIdHelperSvc.h
IGeoDbTagSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >