22 std::vector<const xAOD::MuonSegment*> segments;
23 std::vector<const xAOD::MuonSegment*> anchors;
32 return StatusCode::SUCCESS;
36 const EventContext& ctx,
37 std::vector<MsTrackSeed>& outSeeds)
const {
46 return StatusCode::SUCCESS;
49 std::map<unsigned int, MlComponent> components;
52 if (!segment)
continue;
53 const std::vector<unsigned int>& payload = componentAcc(*segment);
54 if (payload.size() != 2 || payload[0] == 0)
continue;
55 MlComponent& component = components[payload[0]];
56 component.segments.push_back(segment);
57 if (payload[1] != 0) component.anchors.push_back(segment);
60 std::size_t acceptedComponents = 0;
61 std::size_t constructedSeeds = 0;
62 for (
const auto& [componentId, component] : components) {
66 component.anchors.empty()) {
82 std::map<Muon::MuonStationIndex::LayerIndex, std::pair<double, const xAOD::MuonSegment*>> bestPerLayer;
84 if (segment == anchor)
continue;
87 if (layer == anchorLayer)
continue;
90 auto& best = bestPerLayer[layer];
91 if (!best.second || cosAngle > best.first) best = {cosAngle, segment};
93 if (bestPerLayer.size() + 1 <
m_minLayers.value())
continue;
95 seed.addSegment(anchor);
96 for (
const auto& [layer, choice] : bestPerLayer) seed.addSegment(choice.second);
97 seed.setPosition(anchor->
position());
98 outSeeds.push_back(std::move(seed));
102 <<
" seed(s) from ML component " << componentId
103 <<
" with " << component.segments.size()
107 ATH_MSG_DEBUG(
"Constructed " << constructedSeeds <<
" seed(s) from "
108 << acceptedComponents <<
"/" << components.size()
109 <<
" decorated ML component(s)");
110 return StatusCode::SUCCESS;
113Acts::Result<Acts::BoundTrackParameters>
115 const EventContext& ctx,
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_VERBOSE(x,...)
Handle class for reading a decoration on an object.
Handle class for reading from StoreGate.
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.
Gaudi::Property< unsigned int > m_minSegmentsPerCandidate
Acts::Result< Acts::BoundTrackParameters > estimateStartParameters(const EventContext &ctx, const MsTrackSeed &seed) const override final
Estimate the start track parameters for a given track seed.
Gaudi::Property< double > m_minCosConsistency
ToolHandle< ITrackSeedingTool > m_seedParameterEstimator
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_candidateDecorKey
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_segmentKey
Gaudi::Property< unsigned int > m_minLayers
Gaudi::Property< unsigned int > m_maxSegmentsPerCandidate
Location
Enum defining whether the seed is made in the endcap / barrel.
Handle class for reading a decoration on an object.
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
Amg::Vector3D direction() const
Returns the direction as Amg::Vector.
::Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index.
Amg::Vector3D position() const
Returns the position as Amg::Vector.
This header ties the generic definitions in this package.
bool isBarrel(const ChIndex index)
Returns true if the chamber index points to a barrel chamber.
LayerIndex
enum to classify the different layers in the muon spectrometer
LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
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: