ATLAS Offline Software
Loading...
Searching...
No Matches
MsTrackSeederTool.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 MUONTRACKFINDINGTOOLS_MSTRACKSEEDERTOOL_H
5#define MUONTRACKFINDINGTOOLS_MSTRACKSEEDERTOOL_H
6
8
9#include "GaudiKernel/SystemOfUnits.h"
10#include "Acts/Utilities/KDTree.hpp"
11
13
14
23
24#include <span>
25
26namespace MuonR4{
35 class MsTrackSeederTool: public extends<AthAlgTool, ITrackSeedingDiagnosticsTool> {
36 public:
37
39 using SearchTree_t = Acts::KDTree<3, const xAOD::MuonSegment*, double, std::array, 6>;
45 enum class SeedCoords : std::uint8_t{
52 };
53
54 using TreeRawVec_t = SearchTree_t::vector_t;
55
57 using base_class::base_class;
59 virtual StatusCode initialize() override final;
60
62 virtual StatusCode findTrackSeeds(const EventContext& ctx,
63 std::vector<MsTrackSeed>& outSeeds) const override final;
64
66 virtual Acts::Result<Acts::BoundTrackParameters>
67 estimateStartParameters(const EventContext& ctx,
68 const MsTrackSeed& seed) const override final;
69
71 virtual bool withinBounds(const Amg::Vector2D& projPos,
72 const Location loc) const override final;
74 virtual Amg::Vector2D expressOnCylinder(const Acts::GeometryContext& tgContext,
75 const xAOD::MuonSegment& segment,
76 const Location loc,
77 const ExpandedSector sector) const override final;
78
87 virtual double estimateQtimesP(const Acts::GeometryContext& tgContext,
88 const MsTrackSeed& seed,
89 MagField::AtlasFieldCache& fieldCache) const override final;
90
91 private:
92
100 Amg::Vector3D segPosOntoPhiPlane(const Acts::GeometryContext& tgContext,
101 const Amg::Vector3D& planeNormal,
102 const xAOD::MuonSegment& segment) const;
103
106 SearchTree_t constructTree(const Acts::GeometryContext& tgContext,
107 const xAOD::MuonSegmentContainer& segments) const;
108
119 double estimateQtimesP(const Amg::Vector3D& planeNorm,
120 const PosMomPair_t& p1,
123 MagField::AtlasFieldCache& fieldCache) const;
132 double estimateQtimesP(const Amg::Vector3D& planeNorm,
133 const PosMomPair_t& p1,
135 MagField::AtlasFieldCache& fieldCache) const;
141 double getPtimesQ(const Amg::Vector3D& forceIntegral,
142 const Amg::Vector3D& deltaDir) const;
154 const PosMomPair_t& point2,
155 const Amg::Vector3D& planeNorm,
156 MagField::AtlasFieldCache& fieldCache) const;
165 void appendSegment(const Acts::GeometryContext& tgContext,
166 const xAOD::MuonSegment* segment,
167 const Location loc,
168 TreeRawVec_t& outContainer) const;
172 const MuonGMR4::SpectrometerSector* envelope(const xAOD::MuonSegment& segment) const;
176
180 DoubleProperty m_barrelRadius{this, "BarrelRadius", 7.*Gaudi::Units::m};
183 DoubleProperty m_barrelLength{this, "BarrelLength", 25.*Gaudi::Units::m};
185 DoubleProperty m_endcapDiscZ{this, "EndcapDiscZ", 15.*Gaudi::Units::m};
187 DoubleProperty m_endcapDiscRadius{this, "EndcapRadius", 13.*Gaudi::Units::m};
190 DoubleProperty m_seedHalfLength{this, "SeedHalfLength", 25.*Gaudi::Units::cm};
192 DoubleProperty m_barrelMomentumRes{this, "BarrelMomentumResolution", 0.05};
194 DoubleProperty m_endcapMomentumRes{this, "EndcapMomentumResolution", 0.1};
196 UnsignedIntegerProperty m_nFieldSteps{this, "nFieldSteps", 10};
199 ToolHandle<ISegmentSelectionTool> m_segSelector{this, "SegmentSelectionTool" , "" };
201 ServiceHandle<ActsTrk::ITrackingGeometrySvc> m_trackingGeometrySvc{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};
202
207 SG::ReadHandleKey<xAOD::MuonSegmentContainer> m_segmentKey{this, "SegmentContainer", "MuonSegmentsFromR4" };
210 };
211}
212
213
214#endif
Eigen::Matrix< double, 3, 1 > Vector3D
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
SectorProjector
Enumeration to select the sector projection of the regular MS sector.
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:25
Helper class to group muon sgements that may belong to a muon trajectory.
void appendSegment(const Acts::GeometryContext &tgContext, const xAOD::MuonSegment *segment, const Location loc, TreeRawVec_t &outContainer) const
Append the segment to the raw data container.
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Declare the data dependency on the standard Mdt+Rpc+Tgc segment container & on the NSW segment contai...
virtual Acts::Result< Acts::BoundTrackParameters > estimateStartParameters(const EventContext &ctx, const MsTrackSeed &seed) const override final
Estimate the start track parameters for a given track seed.
UnsignedIntegerProperty m_nFieldSteps
number of steps between two segments to integrate the magnetic field
virtual bool withinBounds(const Amg::Vector2D &projPos, const Location loc) const override final
MsTrackSeed::Location Location
Enum toggling whether the segment is in the endcap or barrel.
std::pair< Amg::Vector3D, Amg::Vector3D > PosMomPair_t
ToolHandle< ISegmentSelectionTool > m_segSelector
Pointer to the segement selection tool which compares two segments for their compatibilitiy.
SearchTree_t::vector_t TreeRawVec_t
Abbrivation of the KDTree raw data vector.
DoubleProperty m_barrelRadius
The radius of he barrel cylinder.
DoubleProperty m_endcapMomentumRes
Momentum resolution in the endcap.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Tracking geometry tool.
SearchTree_t constructTree(const Acts::GeometryContext &tgContext, const xAOD::MuonSegmentContainer &segments) const
Construct a complete search tree from a MuonSegment container.
Acts::KDTree< 3, const xAOD::MuonSegment *, double, std::array, 6 > SearchTree_t
Definition of the search tree class.
DoubleProperty m_endcapDiscRadius
Radius of the endcap discs.
ActsTrk::ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
const MuonGMR4::SpectrometerSector * envelope(const xAOD::MuonSegment &segment) const
Returns the spectrometer envelope associated to the segment (Coord system where the parameter are exp...
std::vector< double > m_fieldExtpSteps
The list of field steps in the force field integration.
double getPtimesQ(const Amg::Vector3D &forceIntegral, const Amg::Vector3D &deltaDir) const
Compute the charge times momentum from the integral of lorentz force and the total change in directio...
virtual double estimateQtimesP(const Acts::GeometryContext &tgContext, const MsTrackSeed &seed, MagField::AtlasFieldCache &fieldCache) const override final
Estimate the charge times momentum of a muon track candidate from the contained segments.
virtual StatusCode initialize() override final
virtual StatusCode findTrackSeeds(const EventContext &ctx, std::vector< MsTrackSeed > &outSeeds) const override final
Retrieves the segment container from StoreGate and constructs TrackSeeds from them.
Amg::Vector3D segPosOntoPhiPlane(const Acts::GeometryContext &tgContext, const Amg::Vector3D &planeNormal, const xAOD::MuonSegment &segment) const
Projects the segment position onto the plane with global phi = x The local coordinate system is arran...
SeedCoords
Abrivation of the seed coordinates.
@ eSector
Sector of the associated spectrometer sector.
@ ePosOnCylinder
Extrapolation position along the cylinder surface.
@ eDetSection
Encode the seed location (-1,1 -> endcaps, 0 -> barrel.
virtual Amg::Vector2D expressOnCylinder(const Acts::GeometryContext &tgContext, const xAOD::MuonSegment &segment, const Location loc, const ExpandedSector sector) const override final
Expresses the passed segment on the virtual cylinder constructed by the track seeder.
const MuonGMR4::MuonDetectorManager * m_detMgr
MsTrackSeedContainer resolveOverlaps(MsTrackSeedContainer &&unresolved) const
Removes exact duplciates or partial subsets of the MsTrackSeeds.
DoubleProperty m_endcapDiscZ
Position of the endcap discs.
DoubleProperty m_seedHalfLength
Maximum separation of point on the cylinder to be picked up onto a seed.
DoubleProperty m_barrelMomentumRes
Momentum resolution in the barrel.
ExpandedSector::SectorProjector SectorProjector
Recycle the expanded sector.
DoubleProperty m_barrelLength
The maximum length of the barrel cylinder, if not capped by the placement of the endcap discs.
Amg::Vector3D forceIntegration(const PosMomPair_t &point1, const PosMomPair_t &point2, const Amg::Vector3D &planeNorm, MagField::AtlasFieldCache &fieldCache) const
Compute the integral of magnetic force (v x B ) dS along a trajectory, given the initial and final po...
This is the common class for 3D segments used in the muon spectrometer.
Property holding a SG store/key/clid from which a ReadHandle is made.
STL class.
Definition of ATLAS Math & Geometry primitives (Amg).
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
This header ties the generic definitions in this package.
std::vector< MsTrackSeed > MsTrackSeedContainer
Definition MsTrackSeed.h:96
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define private
Definition testRead.cxx:27