ATLAS Offline Software
Loading...
Searching...
No Matches
MuonChamberToolTest.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONGEOMODELTESTR4_MUONCHAMBERTOOLTEST_H
5#define MUONGEOMODELTESTR4_MUONCHAMBERTOOLTEST_H
6
8
16
20
21
22#include "Acts/Surfaces/Surface.hpp"
23#include "Acts/Surfaces/StrawSurface.hpp"
24#include "Acts/Surfaces/PlaneSurface.hpp"
25#include "Acts/Surfaces/CylinderSurface.hpp"
26#include "Acts/Geometry/TrackingVolume.hpp"
27
28namespace MuonGMR4 {
29
30
32 public:
33 using AthReentrantAlgorithm::AthReentrantAlgorithm;
35
36 StatusCode execute(const EventContext& ctx) const override;
37 StatusCode initialize() override;
38
39 bool isReEntrant() const override final {return false;}
40
41 private:
43 std::vector<Amg::Vector3D> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::Volume& volume) const;
44 std::array<Amg::Vector3D, 8> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::StrawSurface& surface) const;
45 std::array<Amg::Vector3D, 4> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::PlaneSurface& surface) const;
46
48 const std::string& envName,
49 const Acts::Volume& envelopeVol,
50 const std::vector<const MuonGMR4::MuonReadoutElement*>& assocRE,
51 const std::vector<std::shared_ptr<Acts::Volume>>& subVolumes={}) const;
53 StatusCode checkChambers(const ActsTrk::GeometryContext& gctx) const;
55 StatusCode checkEnvelopes(const ActsTrk::GeometryContext& gctx) const;
57 StatusCode checkTrackingGeometry(const ActsTrk::GeometryContext& gctx, std::shared_ptr<const Acts::TrackingGeometry>& trackingGeometry) const;
59 template <class EnvelopeType>
61 const EnvelopeType& envelope) const;
62
71 template <class EnvelopeType>
72 StatusCode pointInside(const ActsTrk::GeometryContext& gctx,
73 const EnvelopeType& envelope,
74 const Acts::Volume& boundVol,
75 const Amg::Vector3D& point,
76 const std::string& descr,
77 const Identifier& channelId) const;
84 StatusCode pointInside(const ActsTrk::GeometryContext& gctx,
85 const Acts::TrackingVolume& volume,
86 const Amg::Vector3D& point,
87 const std::string& descr,
88 const Identifier& chamberId) const;
94 bool hasOverlap(const ActsTrk::GeometryContext& gctx,
95 const std::vector<Amg::Vector3D>& chamberEdges,
96 const Acts::Volume& volume) const;
103 template <class EnvelopeType>
104 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
105 const MdtReadoutElement& readOutEle,
106 const EnvelopeType& envelope,
107 const Acts::Volume& boundVol) const;
108 template <class EnvelopeType>
109 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
110 const RpcReadoutElement& readOutEle,
111 const EnvelopeType& envelope,
112 const Acts::Volume& boundVol) const;
113 template <class EnvelopeType>
115 const TgcReadoutElement& readOutEle,
116 const EnvelopeType& envelope,
117 const Acts::Volume& boundVol) const;
118 template <class EnvelopeType>
119 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
120 const sTgcReadoutElement& readOutEle,
121 const EnvelopeType& envelope,
122 const Acts::Volume& boundVol) const;
123 template <class EnvelopeType>
125 const MmReadoutElement& readOutEle,
126 const EnvelopeType& envelope,
127 const Acts::Volume& boundVol) const;
128
129
130
132 "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
133
134 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
135
136 ServiceHandle<ActsTrk::ITrackingGeometrySvc> m_trackingGeometrySvc{this, "TrackingGeometrySvc","ActsTrackingGeometrySvc"};
138 Gaudi::Property<unsigned> m_overlapSamples{this, "overlapSamples", 50};
140 Gaudi::Property<std::string> m_overlapChambObj{this, "chamberOverlapFile", "OverlapingChambers.obj"};
143 Gaudi::Property<bool> m_ignoreOverlapCh{this, "ignoreChamberOverlap", true};
145 Gaudi::Property<bool> m_ignoreOutsideSurf{this, "ignoreOutsideSurface", true};
147 Gaudi::Property<bool> m_dumpObjs{this, "dumpVolumes" , false};
149
150};
151}
152#endif
An algorithm that can be simultaneously executed in multiple threads.
const MuonDetectorManager * m_detMgr
StatusCode testReadoutEle(const ActsTrk::GeometryContext &gctx, const MmReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
Gaudi::Property< bool > m_ignoreOverlapCh
The overlap of chamber volumes does not lead to a failure.
StatusCode checkEnvelopes(const ActsTrk::GeometryContext &gctx) const
Check envelopes.
void saveEnvelope(const ActsTrk::GeometryContext &gctx, const std::string &envName, const Acts::Volume &envelopeVol, const std::vector< const MuonGMR4::MuonReadoutElement * > &assocRE, const std::vector< std::shared_ptr< Acts::Volume > > &subVolumes={}) const
StatusCode execute(const EventContext &ctx) const override
StatusCode checkChambers(const ActsTrk::GeometryContext &gctx) const
Check whether the chamber envelopes are consistent.
Gaudi::Property< bool > m_dumpObjs
Dump the chambers & sectors as separate obj files.
StatusCode pointInside(const ActsTrk::GeometryContext &gctx, const EnvelopeType &envelope, const Acts::Volume &boundVol, const Amg::Vector3D &point, const std::string &descr, const Identifier &channelId) const
Checks whether the point is inside of an envelope object, i.e.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< std::string > m_overlapChambObj
Name of the chamber output obj file.
StatusCode checkTrackingGeometry(const ActsTrk::GeometryContext &gctx, std::shared_ptr< const Acts::TrackingGeometry > &trackingGeometry) const
Check tracking geometry volumes.
StatusCode testReadoutEle(const ActsTrk::GeometryContext &gctx, const MdtReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
Checks whether all channels of a given readout element are fully covered by the envelope.
StatusCode testReadoutEle(const ActsTrk::GeometryContext &gctx, const TgcReadoutElement &readOutEle, const EnvelopeType &envelope, const Acts::Volume &boundVol) const
bool isReEntrant() const override final
Gaudi::Property< unsigned > m_overlapSamples
Number of points to scan along the lines between two volume corners to check whether they belong to a...
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Gaudi::Property< bool > m_ignoreOutsideSurf
The exceeding surfaces does not lead to a failure.
StatusCode allReadoutInEnvelope(const ActsTrk::GeometryContext &ctx, const EnvelopeType &envelope) const
Checks whether the readout elements of an enevelope are completely embedded into the envelope.
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
std::vector< Amg::Vector3D > cornerPoints(const ActsTrk::GeometryContext &gctx, const Acts::Volume &volume) const
Returns the edge points from a trapezoidal / cuboid /diamond volume.
bool hasOverlap(const ActsTrk::GeometryContext &gctx, const std::vector< Amg::Vector3D > &chamberEdges, const Acts::Volume &volume) const
Checks whether the edge points from a trapezoid/cuboid/diamond form a volume overlapping with the giv...
Property holding a SG store/key/clid from which a ReadHandle is made.
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...