ATLAS Offline Software
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 
20 namespace MuonR4{
29  class MsTrackSeeder: public AthMessaging {
30  public:
32  struct Config{
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  };
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 {
61  leftOverlap = -1,
62  center = 0,
63  rightOverlap = 1
64  };
66  enum class SeedCoords : std::uint8_t{
70  eSector,
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;
168  void appendSegment(const ActsTrk::GeometryContext& gctx,
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
MuonR4::MsTrackSeeder::SeedCoords::ePosOnCylinder
@ ePosOnCylinder
Extrapolation position along the cylinder surface.
MuonR4::MsTrackSeeder::SeedCoords::eSector
@ eSector
Sector of the associated spectrometer sector.
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:40
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
MuonR4::MsTrackSeeder::Config::barrelRadius
double barrelRadius
The radius of the barrel cylinder to seed.
Definition: MsTrackSeeder.h:34
MuonR4::MsTrackSeeder::withinBounds
bool withinBounds(const Amg::Vector2D &projPos, const Location loc) const
Returns whether the expression on the cylinder is within the surface bounds.
Definition: MsTrackSeeder.cxx:172
MuonR4::MsTrackSeeder::findTrackSeeds
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.
Definition: MsTrackSeeder.cxx:397
MuonR4::MsTrackSeeder::Config::barrelLength
double barrelLength
The maximum length of the barrel cylinder, if not capped by the placement of the endcap discs.
Definition: MsTrackSeeder.h:37
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonR4::MsTrackSeed
Definition: MsTrackSeed.h:18
MuonR4::MsTrackSeeder::projectorFromSeed
static SectorProjector projectorFromSeed(const xAOD::MuonSegment &seg, const MsTrackSeed &refSeed)
Returns the Sector projector within the context of a MsTrackSeed.
Definition: MsTrackSeeder.cxx:104
MuonR4::MsTrackSeeder::SearchTree_t
Acts::KDTree< 3, const xAOD::MuonSegment *, double, std::array, 6 > SearchTree_t
Definition of the search tree class.
Definition: MsTrackSeeder.h:54
xAOD::MuonSegment_v1
Class describing a MuonSegment.
Definition: MuonSegment_v1.h:33
ATLASMagneticFieldWrapper.h
MuonR4::MsTrackSeeder::Config::endcapDiscZ
double endcapDiscZ
Position of the endcap discs.
Definition: MsTrackSeeder.h:39
MuonR4::MsTrackSeeder::calculateRadius
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.
Definition: MsTrackSeeder.cxx:187
MuonR4::MsTrackSeed::Location
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition: MsTrackSeed.h:21
MuonSegmentContainer.h
MuonR4::MsTrackSeeder::SeedCoords
SeedCoords
Abrivation of the seed coordinates.
Definition: MsTrackSeeder.h:66
MuonR4::MsTrackSeeder::m_cfg
Config m_cfg
Definition: MsTrackSeeder.h:176
cm
const double cm
Definition: Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/tools/FCAL_ChannelMap.cxx:25
MuonR4::MsTrackSeeder::expressOnCylinder
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.
Definition: MsTrackSeeder.cxx:151
MuonR4::ISegmentSelectionTool
Definition: ISegmentSelectionTool.h:14
MuonR4::MsTrackSeeder::projectedPhi
static double projectedPhi(const int sector, const SectorProjector proj)
Returns the projected phi for a given sector and projector.
Definition: MsTrackSeeder.cxx:93
MuonR4::MsTrackSeeder::appendSegment
void appendSegment(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment *segment, const Location loc, TreeRawVec_t &outContainer) const
Append the to the raw data container.
Definition: MsTrackSeeder.cxx:349
MuonR4::MsTrackSeeder::envelope
const MuonGMR4::SpectrometerSector * envelope(const xAOD::MuonSegment &segment) const
Returns the spectrometer envelope associated to the segment (Coord system where the parameter are exp...
Definition: MsTrackSeeder.cxx:98
MuonR4::MsTrackSeeder::TreeRawVec_t
SearchTree_t::vector_t TreeRawVec_t
Abbrivation of the KDTree raw data vector.
Definition: MsTrackSeeder.h:160
ISegmentSelectionTool.h
MsTrackSeed.h
MuonDetectorManager.h
MuonR4::MsTrackSeeder::VecOpt_t
std::optional< Amg::Vector3D > VecOpt_t
Definition: MsTrackSeeder.h:58
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonR4::MsTrackSeeder::Location
MsTrackSeed::Location Location
Enum toggling whether the segment is in the endcap or barrel.
Definition: MsTrackSeeder.h:56
MuonR4::MsTrackSeeder::SectorProjector::center
@ center
Project the segment onto the overlap with the previous sector.
ActsTrk::GeometryContext
Definition: GeometryContext.h:28
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
Config
Definition: dumpNPs.cxx:47
MuonR4::MsTrackSeeder::Config::fieldExtpSteps
std::set< double > fieldExtpSteps
Steps between two segments to integrate the magnetic field.
Definition: MsTrackSeeder.h:51
MuonR4::MsTrackSeeder::Config::detMgr
const MuonGMR4::MuonDetectorManager * detMgr
Detector manager to fetch the sector enevelope transforms.
Definition: MsTrackSeeder.h:46
MuonR4::MsTrackSeeder::projectOntoSector
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...
Definition: MsTrackSeeder.cxx:121
MuonR4::MsTrackSeeder::Config::endcapDiscRadius
double endcapDiscRadius
Radius of the endcap discs.
Definition: MsTrackSeeder.h:41
MuonR4::SearchTree_t
MsTrackSeeder::SearchTree_t SearchTree_t
Definition: MsTrackSeeder.cxx:64
MuonR4::MsTrackSeeder::Config::seedHalfLength
double seedHalfLength
Maximum separation of point on the cylinder to be picked up onto a seed.
Definition: MsTrackSeeder.h:44
MuonR4::MsTrackSeeder
Helper class to group muon sgements that may belong to a muon trajectory.
Definition: MsTrackSeeder.h:29
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
MuonR4::MsTrackSeeder::estimateQtimesP
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.
Definition: MsTrackSeeder.cxx:220
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonR4::MsTrackSeeder::Config::selector
const ISegmentSelectionTool * selector
Pointer to the segement selection tool which compares two segments for their compatibilitiy.
Definition: MsTrackSeeder.h:49
MuonR4::MsTrackSeeder::SectorProjector::rightOverlap
@ rightOverlap
Project the segment onto the sector centre.
MuonR4::MsTrackSeedContainer
std::vector< MsTrackSeed > MsTrackSeedContainer
Definition: MsTrackSeed.h:63
AthMessaging.h
MuonR4::MsTrackSeeder::SectorProjector
SectorProjector
Enumeration to select the sector projection.
Definition: MsTrackSeeder.h:60
MuonR4::MsTrackSeeder::resolveOverlaps
std::unique_ptr< MsTrackSeedContainer > resolveOverlaps(MsTrackSeedContainer &&unresolved) const
Removes exact duplciates or partial subsets of the MsTrackSeeds.
Definition: MsTrackSeeder.cxx:471
MuonR4::MsTrackSeeder::constructTree
SearchTree_t constructTree(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegmentContainer &segments) const
Construct a complete search tree from a MuonSegment container.
Definition: MsTrackSeeder.cxx:386
MuonR4::MsTrackSeeder::Config
Configuration object.
Definition: MsTrackSeeder.h:32
MuonR4::MsTrackSeeder::SectorProjector::leftOverlap
@ leftOverlap
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
MuonR4::MsTrackSeeder::SeedCoords::eDetSection
@ eDetSection
Encode the seed location (-1,1 -> endcaps, 0 -> barrel
MuonR4::MsTrackSeeder::MsTrackSeeder
MsTrackSeeder(const std::string &msgName, Config &&cfg)
Standard constructor.
Definition: MsTrackSeeder.cxx:80
MuonR4::MsTrackSeeder::projectOntoPhiPlane
Amg::Vector3D projectOntoPhiPlane(const ActsTrk::GeometryContext &gctx, const xAOD::MuonSegment &segment, const double projectPhi) const
Definition: MsTrackSeeder.cxx:130