ATLAS Offline Software
Loading...
Searching...
No Matches
MsTrackSeeder.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 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>;
57
58 using VecOpt_t = std::optional<Amg::Vector3D>;
60 enum class SectorProjector : std::int8_t {
62 center = 0,
64 };
65
66 enum class SeedCoords : std::uint8_t{
73 };
74
78 MsTrackSeeder(const std::string& msgName, Config&& cfg);
84 const xAOD::MuonSegmentContainer& segments) const;
91 const xAOD::MuonSegment& segment,
92 const Location loc,
93 const SectorProjector proj) const;
94
96 const xAOD::MuonSegment& segment,
97 const double projectPhi) const;
104 const xAOD::MuonSegment& segment,
105 const SectorProjector proj) const;
112 const xAOD::MuonSegment& segment,
113 const MsTrackSeed& seed) const;
114
121 double estimateQtimesP(const ActsTrk::GeometryContext& gctx,
122 const AtlasFieldCacheCondObj& magField,
123 const MsTrackSeed& seed) const;
128 static double projectedPhi(const int sector,
129 const SectorProjector proj);
135 const MsTrackSeed& refSeed);
136
140 bool withinBounds(const Amg::Vector2D& projPos,
141 const Location loc) const;
145 std::unique_ptr<MsTrackSeedContainer> findTrackSeeds(const EventContext& ctx,
146 const ActsTrk::GeometryContext& gctx,
147 const xAOD::MuonSegmentContainer& segments) const;
151 const MuonGMR4::SpectrometerSector* envelope(const xAOD::MuonSegment& segment) const;
152 private:
156 std::optional<double> calculateRadius(VecOpt_t&& pI, VecOpt_t&& pM, VecOpt_t&& pO,
157 const Amg::Vector3D& planeNorm) const;
158
160 using TreeRawVec_t = SearchTree_t::vector_t;
169 const xAOD::MuonSegment* segment,
170 const Location loc,
171 TreeRawVec_t& outContainer) const;
174 std::unique_ptr<MsTrackSeedContainer> resolveOverlaps(MsTrackSeedContainer&& unresolved) const;
175
177 };
178}
179
180
181#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...
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:21
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.
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.
Amg::Vector3D projectOntoSector(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const SectorProjector proj) const
Projects the segment's position onto the sector centre or onto the overlap point with one of the neig...
SearchTree_t::vector_t TreeRawVec_t
Abbrivation of the KDTree raw data vector.
Amg::Vector2D expressOnCylinder(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const Location loc, const SectorProjector proj) const
Expresses the segment on the cylinder surface.
std::unique_ptr< MsTrackSeedContainer > resolveOverlaps(MsTrackSeedContainer &&unresolved) const
Removes exact duplciates or partial subsets of the MsTrackSeeds.
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...
static double projectedPhi(const int sector, const SectorProjector proj)
Returns the projected phi for a given sector and projector.
MsTrackSeeder(const std::string &msgName, Config &&cfg)
Standard constructor.
MsTrackSeed::Location Location
Enum toggling whether the segment is in the endcap or barrel.
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.
Amg::Vector3D projectOntoPhiPlane(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const double projectPhi) const
static SectorProjector projectorFromSeed(const xAOD::MuonSegment &seg, const MsTrackSeed &refSeed)
Returns the Sector projector within the context of a MsTrackSeed.
std::optional< Amg::Vector3D > VecOpt_t
SectorProjector
Enumeration to select the sector projection.
@ rightOverlap
Project the segment onto the sector centre.
@ center
Project the segment onto the overlap with the previous sector.
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:63
MsTrackSeeder::SearchTree_t SearchTree_t
MsTrackSeeder::SectorProjector SectorProjector
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.