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/Geometry/TrackingVolume.hpp"
26
27namespace MuonGMR4 {
28
29
31 public:
32 using AthReentrantAlgorithm::AthReentrantAlgorithm;
34
35 StatusCode execute(const EventContext& ctx) const override;
36 StatusCode initialize() override;
37
38 bool isReEntrant() const override final {return false;}
39
40 private:
42 std::vector<Amg::Vector3D> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::Volume& volume) const;
43 std::array<Amg::Vector3D, 8> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::StrawSurface& surface) const;
44 std::array<Amg::Vector3D, 4> cornerPoints(const ActsTrk::GeometryContext& gctx, const Acts::PlaneSurface& surface) const;
45
47 const std::string& envName,
48 const Acts::Volume& envelopeVol,
49 const std::vector<const Acts::Surface*>& assocSurfaces,
50 const std::vector<const Acts::Volume*>& subVolumes={}) const;
51
52 StatusCode checkPortals(const ActsTrk::GeometryContext& gctx,
53 const Acts::TrackingVolume& volume) const;
54
56 StatusCode checkChambers(const ActsTrk::GeometryContext& gctx) const;
58 StatusCode checkEnvelopes(const ActsTrk::GeometryContext& gctx) const;
60 StatusCode checkTrackingGeometry(const ActsTrk::GeometryContext& gctx,
61 const Acts::TrackingGeometry& trackingGeometry) const;
63 template <class EnvelopeType>
65 const EnvelopeType& envelope) const;
66
75 template <class EnvelopeType>
76 StatusCode pointInside(const ActsTrk::GeometryContext& gctx,
77 const EnvelopeType& envelope,
78 const Acts::Volume& boundVol,
79 const Amg::Vector3D& point,
80 const std::string& descr,
81 const Identifier& channelId) const;
88 StatusCode pointInside(const ActsTrk::GeometryContext& gctx,
89 const Acts::TrackingVolume& volume,
90 const Amg::Vector3D& point,
91 const std::string& descr,
92 const Identifier& chamberId) const;
98 bool hasOverlap(const ActsTrk::GeometryContext& gctx,
99 const std::vector<Amg::Vector3D>& chamberEdges,
100 const Acts::Volume& volume) const;
107 template <class EnvelopeType>
108 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
109 const MdtReadoutElement& readOutEle,
110 const EnvelopeType& envelope,
111 const Acts::Volume& boundVol) const;
112 template <class EnvelopeType>
113 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
114 const RpcReadoutElement& readOutEle,
115 const EnvelopeType& envelope,
116 const Acts::Volume& boundVol) const;
117 template <class EnvelopeType>
119 const TgcReadoutElement& readOutEle,
120 const EnvelopeType& envelope,
121 const Acts::Volume& boundVol) const;
122 template <class EnvelopeType>
123 StatusCode testReadoutEle(const ActsTrk::GeometryContext& gctx,
124 const sTgcReadoutElement& readOutEle,
125 const EnvelopeType& envelope,
126 const Acts::Volume& boundVol) const;
127 template <class EnvelopeType>
129 const MmReadoutElement& readOutEle,
130 const EnvelopeType& envelope,
131 const Acts::Volume& boundVol) const;
132
133
134
136 "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
137
138 SG::ReadHandleKey<ActsTrk::GeometryContext> m_geoCtxKey{this, "AlignmentKey", "ActsAlignment", "cond handle key"};
139
140 ServiceHandle<ActsTrk::ITrackingGeometrySvc> m_trackingGeometrySvc{this, "TrackingGeometrySvc","ActsTrackingGeometrySvc"};
142 Gaudi::Property<unsigned> m_overlapSamples{this, "overlapSamples", 50};
144 Gaudi::Property<std::string> m_overlapChambObj{this, "chamberOverlapFile", "OverlapingChambers.obj"};
147 Gaudi::Property<bool> m_ignoreOverlapCh{this, "ignoreChamberOverlap", true};
149 Gaudi::Property<bool> m_ignoreOutsideSurf{this, "ignoreOutsideSurface", true};
151 Gaudi::Property<bool> m_dumpObjs{this, "dumpVolumes" , false};
153
154};
155}
156#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.
StatusCode checkPortals(const ActsTrk::GeometryContext &gctx, const Acts::TrackingVolume &volume) const
StatusCode execute(const EventContext &ctx) const override
StatusCode checkChambers(const ActsTrk::GeometryContext &gctx) const
Check whether the chamber envelopes are consistent.
void saveEnvelope(const ActsTrk::GeometryContext &gctx, const std::string &envName, const Acts::Volume &envelopeVol, const std::vector< const Acts::Surface * > &assocSurfaces, const std::vector< const Acts::Volume * > &subVolumes={}) const
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 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.
StatusCode checkTrackingGeometry(const ActsTrk::GeometryContext &gctx, const Acts::TrackingGeometry &trackingGeometry) const
Check tracking geometry volumes.
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...