Retrieves the segment container from StoreGate and constructs TrackSeeds from them.
36 {
39
40
41 SG::ReadDecorHandle<xAOD::MuonSegmentContainer, std::vector<unsigned int>>
45 return StatusCode::SUCCESS;
46 }
47
48 std::map<unsigned int, MlComponent> components;
49
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) {
63 component.anchors.empty()) {
64 continue;
65 }
66 ++acceptedComponents;
67
73 MsTrackSeed
seed{location, ExpandedSector{anchor->
position().phi()}};
75 seed.addSegment(segment);
76 }
78 outSeeds.push_back(std::move(seed));
79 ++constructedSeeds;
80 }
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.
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: