ATLAS Offline Software
Loading...
Searching...
No Matches
MsTrackSeeder.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_MSTRACKSEEDER_H
5#define MUONTRACKFINDINGTOOLS_MSTRACKSEEDER_H
6
8
9#include "GaudiKernel/SystemOfUnits.h"
10#include "Acts/Utilities/KDTree.hpp"
11
12
18
19
20namespace MuonR4{
30 public:
32 struct Config{
34 double barrelRadius{7.*Gaudi::Units::m};
37 double barrelLength{25.*Gaudi::Units::m};
39 double endcapDiscZ{15.*Gaudi::Units::m};
41 double endcapDiscRadius{13.*Gaudi::Units::m};
44 double seedHalfLength{25.*Gaudi::Units::cm};
51 std::set<double> fieldExtpSteps{0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1};
52 };
53
54 using SearchTree_t = Acts::KDTree<3, const xAOD::MuonSegment*, double, std::array, 6>;
59 using VecOpt_t = std::optional<Amg::Vector3D>;
61 enum class SeedCoords : std::uint8_t{
68 };
69
73 MsTrackSeeder(const std::string& msgName, Config&& cfg);
79 const xAOD::MuonSegmentContainer& segments) const;
89 const xAOD::MuonSegment& segment,
90 const Location loc,
91 const ExpandedSector sector) const;
101 const xAOD::MuonSegment& segment,
102 const double projectPhi) const;
108 double estimateTwoStationP(const xAOD::MuonSegment& segment1,
109 const xAOD::MuonSegment& segment2,
110 const AtlasFieldCacheCondObj& magField) const;
117 double estimateQtimesP(const ActsTrk::GeometryContext& gctx,
118 const AtlasFieldCacheCondObj& magField,
119 const MsTrackSeed& seed) const;
123 bool withinBounds(const Amg::Vector2D& projPos,
124 const Location loc) const;
128 std::unique_ptr<MsTrackSeedContainer> findTrackSeeds(const EventContext& ctx,
129 const ActsTrk::GeometryContext& gctx,
130 const xAOD::MuonSegmentContainer& segments) const;
134 const MuonGMR4::SpectrometerSector* envelope(const xAOD::MuonSegment& segment) const;
135 private:
136 using PosMomPair_t = std::pair<Amg::Vector3D, Amg::Vector3D>;
137 std::pair<double, unsigned> averageBField(const PosMomPair_t& start,
138 const PosMomPair_t& end,
139 const AtlasFieldCacheCondObj& magField,
140 const bool skipFirst) const;
141
145 std::optional<double> calculateRadius(VecOpt_t&& pI, VecOpt_t&& pM, VecOpt_t&& pO,
146 const Amg::Vector3D& planeNorm) const;
147
149 using TreeRawVec_t = SearchTree_t::vector_t;
158 const xAOD::MuonSegment* segment,
159 const Location loc,
160 TreeRawVec_t& outContainer) const;
163 std::unique_ptr<MsTrackSeedContainer> resolveOverlaps(MsTrackSeedContainer&& unresolved) const;
164
166 };
167}
168
169
170#endif
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
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
std::optional< double > calculateRadius(VecOpt_t &&pI, VecOpt_t &&pM, VecOpt_t &&pO, const Amg::Vector3D &planeNorm) const
Calculates the radius of the bending circle from three points using the sagitta.
std::pair< double, unsigned > averageBField(const PosMomPair_t &start, const PosMomPair_t &end, const AtlasFieldCacheCondObj &magField, const bool skipFirst) const
bool withinBounds(const Amg::Vector2D &projPos, const Location loc) const
Returns whether the expression on the cylinder is within the surface bounds.
SearchTree_t constructTree(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegmentContainer &segments) const
Construct a complete search tree from a MuonSegment container.
SearchTree_t::vector_t TreeRawVec_t
Abbrivation of the KDTree raw data vector.
std::unique_ptr< MsTrackSeedContainer > resolveOverlaps(MsTrackSeedContainer &&unresolved) const
Removes exact duplciates or partial subsets of the MsTrackSeeds.
std::pair< Amg::Vector3D, Amg::Vector3D > PosMomPair_t
void appendSegment(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment *segment, const Location loc, TreeRawVec_t &outContainer) const
Append the to the raw data container.
Acts::KDTree< 3, const xAOD::MuonSegment *, double, std::array, 6 > SearchTree_t
Definition of the search tree class.
const MuonGMR4::SpectrometerSector * envelope(const xAOD::MuonSegment &segment) const
Returns the spectrometer envelope associated to the segment (Coord system where the parameter are exp...
MsTrackSeeder(const std::string &msgName, Config &&cfg)
Standard constructor.
double estimateTwoStationP(const xAOD::MuonSegment &segment1, const xAOD::MuonSegment &segment2, const AtlasFieldCacheCondObj &magField) const
Calculates the precision deflection angle between two segments on a muon track.
MsTrackSeed::Location Location
Enum toggling whether the segment is in the endcap or barrel.
Amg::Vector2D expressOnCylinder(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const Location loc, const ExpandedSector sector) const
Expresses the segment on the cylinder surface.
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.
double estimateQtimesP(const ActsTrk::GeometryContext &gctx, const AtlasFieldCacheCondObj &magField, const MsTrackSeed &seed) const
Estimate the q /p of the seed candidate from the contained segments.
std::unique_ptr< MsTrackSeedContainer > findTrackSeeds(const EventContext &ctx, const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegmentContainer &segments) const
Constructs the MS track seeds from the segment container.
ExpandedSector::SectorProjector SectorProjector
Recycle the expanded sector.
Amg::Vector3D projectOntoPhiPlane(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const double projectPhi) const
Projects the passed segment onto the plane with global phi = x The local coordinate system is arrange...
std::optional< Amg::Vector3D > VecOpt_t
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
std::vector< MsTrackSeed > MsTrackSeedContainer
Definition MsTrackSeed.h:71
MsTrackSeeder::SearchTree_t SearchTree_t
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Configuration object.
double barrelRadius
The radius of the barrel cylinder to seed.
double endcapDiscRadius
Radius of the endcap discs.
const MuonGMR4::MuonDetectorManager * detMgr
Detector manager to fetch the sector enevelope transforms.
double barrelLength
The maximum length of the barrel cylinder, if not capped by the placement of the endcap discs.
std::set< double > fieldExtpSteps
Steps between two segments to integrate the magnetic field.
double seedHalfLength
Maximum separation of point on the cylinder to be picked up onto a seed.
double endcapDiscZ
Position of the endcap discs.
const ISegmentSelectionTool * selector
Pointer to the segement selection tool which compares two segments for their compatibilitiy.