ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::MlMsTrackSeeder Class Referencefinal

ITrackSeedingTool implementation which constructs seeds directly from sufficiently large ML-nominated segment components. More...

#include <MlMsTrackSeeder.h>

Inheritance diagram for MuonR4::MlMsTrackSeeder:
Collaboration diagram for MuonR4::MlMsTrackSeeder:

Public Member Functions

StatusCode initialize () override final
StatusCode findTrackSeeds (const EventContext &ctx, std::vector< MsTrackSeed > &outSeeds) const override final
 Retrieves the segment container from StoreGate and constructs TrackSeeds from them.
Acts::Result< Acts::BoundTrackParameters > estimateStartParameters (const EventContext &ctx, const MsTrackSeed &seed) const override final
 Estimate the start track parameters for a given track seed.

Private Attributes

ToolHandle< ITrackSeedingTool > m_seedParameterEstimator
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Gaudi::Property< std::string > m_candidateDecoration
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_candidateDecorKey
Gaudi::Property< unsigned int > m_minSegmentsPerCandidate

Detailed Description

ITrackSeedingTool implementation which constructs seeds directly from sufficiently large ML-nominated segment components.

The wrapped conventional tool is used only for initial-parameter estimation; it never constructs seeds for this tool. Consequently MsTrackFindingAlg sees only the standard ITrackSeedingTool interface and selects this implementation entirely through job configuration.

Definition at line 26 of file MlMsTrackSeeder.h.

Member Function Documentation

◆ estimateStartParameters()

Acts::Result< Acts::BoundTrackParameters > MuonR4::MlMsTrackSeeder::estimateStartParameters ( const EventContext & ctx,
const MsTrackSeed & seed ) const
finaloverride

Estimate the start track parameters for a given track seed.

Parameters
ctxEventContext
seedThe track seed for which to estimate start parameters
Returns
The estimated start parameters or an error

Definition at line 94 of file MlMsTrackSeeder.cxx.

96 {
97 return m_seedParameterEstimator->estimateStartParameters(ctx, seed);
98}
ToolHandle< ITrackSeedingTool > m_seedParameterEstimator

◆ findTrackSeeds()

StatusCode MuonR4::MlMsTrackSeeder::findTrackSeeds ( const EventContext & ctx,
std::vector< MsTrackSeed > & outSeeds ) const
finaloverride

Retrieves the segment container from StoreGate and constructs TrackSeeds from them.

The seed canddiates are pushed to the output seed container

Parameters
ctxEventContext to access the xAOD::MuonSegmentContainer from store gate and additional conditions data if needed to construct the seed
outSeedsMutable reference to the container to whichh the seeds are pushed to.

Definition at line 34 of file MlMsTrackSeeder.cxx.

36 {
37 const xAOD::MuonSegmentContainer* segments{nullptr};
38 ATH_CHECK(SG::get(segments, m_segmentKey, ctx));
39
40 // The decoration payload is [componentId, isSeedAnchor].
41 SG::ReadDecorHandle<xAOD::MuonSegmentContainer, std::vector<unsigned int>>
42 componentAcc{m_candidateDecorKey, ctx};
43 if (!componentAcc.isAvailable()) {
44 ATH_MSG_DEBUG("No ML candidate decoration found");
45 return StatusCode::SUCCESS;
46 }
47
48 std::map<unsigned int, MlComponent> components;
49
50 for (const xAOD::MuonSegment* segment : *segments) {
51 if (!segment) continue;
52 const std::vector<unsigned int>& payload = componentAcc(*segment);
53 if (payload.size() != 2 || payload[0] == 0) continue;
54 MlComponent& component = components[payload[0]];
55 component.segments.push_back(segment);
56 if (payload[1] != 0) component.anchors.push_back(segment);
57 }
58
59 std::size_t acceptedComponents = 0;
60 std::size_t constructedSeeds = 0;
61 for (const auto& [componentId, component] : components) {
62 if (component.segments.size() < m_minSegmentsPerCandidate.value() ||
63 component.anchors.empty()) {
64 continue;
65 }
66 ++acceptedComponents;
67
68 for (const xAOD::MuonSegment* anchor : component.anchors) {
69 const MsTrackSeed::Location location =
73 MsTrackSeed seed{location, ExpandedSector{anchor->position().phi()}};
74 for (const xAOD::MuonSegment* segment : component.segments) {
75 seed.addSegment(segment);
76 }
77 seed.setPosition(anchor->position());
78 outSeeds.push_back(std::move(seed));
79 ++constructedSeeds;
80 }
81 ATH_MSG_VERBOSE("Constructed " << component.anchors.size()
82 << " seed(s) from ML component " << componentId
83 << " with " << component.segments.size()
84 << " segments");
85 }
86
87 ATH_MSG_DEBUG("Constructed " << constructedSeeds << " seed(s) from "
88 << acceptedComponents << "/" << components.size()
89 << " decorated ML component(s)");
90 return StatusCode::SUCCESS;
91}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_VERBOSE(x,...)
Gaudi::Property< unsigned int > m_minSegmentsPerCandidate
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_candidateDecorKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Location
Enum defining whether the seed is made in the endcap / barrel.
Definition MsTrackSeed.h:25
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
bool isBarrel(const ChIndex index)
Returns true if the chamber index points to a barrel chamber.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version:

◆ initialize()

StatusCode MuonR4::MlMsTrackSeeder::initialize ( )
finaloverride

Definition at line 27 of file MlMsTrackSeeder.cxx.

27 {
29 ATH_CHECK(m_segmentKey.initialize());
30 ATH_CHECK(m_candidateDecorKey.initialize());
31 return StatusCode::SUCCESS;
32}

Member Data Documentation

◆ m_candidateDecoration

Gaudi::Property<std::string> MuonR4::MlMsTrackSeeder::m_candidateDecoration
private
Initial value:
{
this, "CandidateDecoration", "trackCandidateIds",
"Segment [componentId, isSeedAnchor] decoration"}

Definition at line 48 of file MlMsTrackSeeder.h.

48 {
49 this, "CandidateDecoration", "trackCandidateIds",
50 "Segment [componentId, isSeedAnchor] decoration"};

◆ m_candidateDecorKey

SG::ReadDecorHandleKey<xAOD::MuonSegmentContainer> MuonR4::MlMsTrackSeeder::m_candidateDecorKey
private
Initial value:
{
this, "CandidateDecoration", m_segmentKey, "trackCandidateIds",
"Scheduler dependency on the ML candidate decoration"}

Definition at line 51 of file MlMsTrackSeeder.h.

51 {
52 this, "CandidateDecoration", m_segmentKey, "trackCandidateIds",
53 "Scheduler dependency on the ML candidate decoration"};

◆ m_minSegmentsPerCandidate

Gaudi::Property<unsigned int> MuonR4::MlMsTrackSeeder::m_minSegmentsPerCandidate
private
Initial value:
{
this, "MinSegmentsPerCandidate", 2}

Definition at line 54 of file MlMsTrackSeeder.h.

54 {
55 this, "MinSegmentsPerCandidate", 2};

◆ m_seedParameterEstimator

ToolHandle<ITrackSeedingTool> MuonR4::MlMsTrackSeeder::m_seedParameterEstimator
private
Initial value:
{
this, "BaselineSeeder", "",
"Tool providing initial-parameter estimates for ML-built seeds"}

Definition at line 43 of file MlMsTrackSeeder.h.

43 {
44 this, "BaselineSeeder", "",
45 "Tool providing initial-parameter estimates for ML-built seeds"};

◆ m_segmentKey

SG::ReadHandleKey<xAOD::MuonSegmentContainer> MuonR4::MlMsTrackSeeder::m_segmentKey
private
Initial value:
{
this, "SegmentContainer", "MuonSegmentsFromR4"}

Definition at line 46 of file MlMsTrackSeeder.h.

46 {
47 this, "SegmentContainer", "MuonSegmentsFromR4"};

The documentation for this class was generated from the following files: