ATLAS Offline Software
Loading...
Searching...
No Matches
MuonInDetToMuonSystemExtensionAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONCOMBINEDALGS_MUONINDETSYSTEMEXTENSIONALG_H
6#define MUONCOMBINEDALGS_MUONINDETSYSTEMEXTENSIONALG_H
7
8#include <map>
9#include <string>
10
12#include "GaudiKernel/ToolHandle.h"
27
35public:
36 using AthReentrantAlgorithm::AthReentrantAlgorithm;
38
39 StatusCode initialize() override;
40 StatusCode execute(const EventContext& ctx) const override;
41
42private:
43 SG::ReadHandleKey<InDetCandidateCollection> m_inputCandidate{this, "InputInDetCandidates", "InDetCandidates"};
44
46 SG::WriteHandleKey<InDetCandidateCollection> m_bulkInDetCandKey{this, "WriteInDetCandidates", "InDetCandidatesSystemExtened"};
49
51 SG::ReadHandleKey<Muon::HoughDataPerSectorVec> m_houghDataPerSectorVecKey{this, "LayerHoughKey", "HoughDataPerSectorVec",
52 "HoughDataPerSectorVec key"};
53
54 SG::ReadHandleKey<Trk::SegmentCollection> m_segmentKey{this, "MuonSegmentLocation", "TrackMuonSegments",
55 "name of muon segment container"};
56
57 PublicToolHandle<Muon::IMuonSegmentSelectionTool> m_segmentSelector{this, "MuonSegmentSelectionTool",
58 "Muon::MuonSegmentSelectionTool/MuonSegmentSelectionTool"};
59
61 ToolHandle<Muon::IMuonSystemExtensionTool> m_muonSystemExtensionTool{this, "MuonSystemExtensionTool", "", "Muon system extension tool"};
63 SG::ReadHandleKey<MuonCombined::InDetCandidateToTagMap> m_combTagMap{this, "CombinedTagMap", "muidcoTagMap", "Combined muon tag map"};
64
65 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
66
67 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
68 "Handle to the service providing the IMuonEDMHelperSvc interface"};
69
76 using MuidCoVector = std::vector<MuidCoCache>;
77
81
83 std::set<const MuonCombined::InDetCandidate*> excluded_trks;
87 std::set<const Muon::MuonSegment*> combined_segs{};
88
90 std::unique_ptr<InDetCandidateCollection> outputContainer = std::make_unique<InDetCandidateCollection>(SG::OWN_ELEMENTS);
91
93 std::map<Muon::MuonStationIndex::DetectorRegionIndex, std::set<int>> hit_sectors;
94
95 std::map<int, std::vector<double>> eta_seeds{};
96
99 std::map<unsigned int, std::set<Identifier>> consumed_hits{};
100
102 std::vector<const Muon::MuonSegment*> candidate_segments{};
103 };
104
106 Gaudi::Property<bool> m_restrictExtension{this, "UseOnlyHitSectors", false};
109 Gaudi::Property<int> m_houghMin{this, "minHoughHits", 4, "Minimum number of hits required for a hough maximum to be accepted"};
110
111 Gaudi::Property<int> m_segmentQuality{this, "segQuality", 1, "Quality cut on the segment."};
113 Gaudi::Property<bool> m_excludeNSW{this, "noNSWforSeeding", false, "Ignore hits/segments from the NSW"};
115 Gaudi::Property<float> m_extThreshold{this, "ExtensionPtThreshold", 2500};
117 Gaudi::Property<bool> m_extendSAF{this, "ExtendSAF", false};
119 Gaudi::Property<bool> m_extendBulk{this, "ExtendBulk", true};
120
122
124 StatusCode selectCandidates(const EventContext& ctx, InDetCandidateCache& cache) const;
126 StatusCode findHitSectors(const EventContext& ctx, InDetCandidateCache& output_cache) const;
128 StatusCode findSegments(const EventContext& ctx, InDetCandidateCache& output_cache) const;
129
131 bool hasMatchingSegment(const MuonCombined::InDetCandidate& id_cand, const InDetCandidateCache& cache) const;
133 bool hasMatchingSeed(const MuonCombined::InDetCandidate& id_cand, const InDetCandidateCache& cache) const;
134
136 StatusCode create(const EventContext& ctx, InDetCandidateCache& cache) const;
137
138 StatusCode createStaus(const EventContext& ctx, const InDetCandidateCollection* ext_candidates, const MuidCoVector& tag_map) const;
140 void maskHits(const Muon::MuonSegment* muon_seg, InDetCandidateCache& output_cache) const;
141};
142
143#endif
DataVector< MuonCombined::InDetCandidate > InDetCandidateCollection
This typedef represents a collection of InDetCandidate objects.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
TagBase implementation for a combined fit.
The MuonInDetToMuonSystemExtensionAlg processes further the InDetCandidates created by the MuonCombin...
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
StatusCode create(const EventContext &ctx, InDetCandidateCache &cache) const
Create the InDetCandidaes with system extensions.
SG::ReadHandleKey< Trk::SegmentCollection > m_segmentKey
Let's exploit the segments to get rid of as much tracks as possible.
SG::ReadHandleKey< MuonCombined::InDetCandidateToTagMap > m_combTagMap
That is the collection of MuidCo candidates.
StatusCode findSegments(const EventContext &ctx, InDetCandidateCache &output_cache) const
Select good segments.
StatusCode findHitSectors(const EventContext &ctx, InDetCandidateCache &output_cache) const
Find the sectors in the MS with muon signals.
Gaudi::Property< bool > m_extendSAF
Shall SAF tracks be equiped with a muon system extension used by MuGirl later.
StatusCode selectCandidates(const EventContext &ctx, InDetCandidateCache &cache) const
Select the MuidCo candidates and put the associated id tracks on a block list.
bool hasMatchingSeed(const MuonCombined::InDetCandidate &id_cand, const InDetCandidateCache &cache) const
Searches for hough seeds within theta < 0.2 && sharing the same sector.
bool hasMatchingSegment(const MuonCombined::InDetCandidate &id_cand, const InDetCandidateCache &cache) const
Searches for segments within theta < 0.2 && sharing the same sector.
PublicToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
StatusCode execute(const EventContext &ctx) const override
ToolHandle< Muon::IMuonSystemExtensionTool > m_muonSystemExtensionTool
The system extension tool extrapolates the candidate through the spectrometer.
StatusCode createStaus(const EventContext &ctx, const InDetCandidateCollection *ext_candidates, const MuidCoVector &tag_map) const
void maskHits(const Muon::MuonSegment *muon_seg, InDetCandidateCache &output_cache) const
Mask the hits of the corresponding muon segment as used.
Gaudi::Property< bool > m_restrictExtension
Restrict the extrapolation of ID tracks to sectors in the MS where at least a hit is recorded.
SG::ReadHandleKey< InDetCandidateCollection > m_inputCandidate
Gaudi::Property< int > m_houghMin
The hough maxima always contain at least 2 hits.
SG::WriteHandleKey< InDetCandidateCollection > m_bulkInDetCandKey
Collection of InDet candidates written for MuGirl and MuonSegmentTag.
SG::WriteHandleKey< InDetCandidateCollection > m_stauInDetCandKey
Collection of InDet candidates written for MuGirlStau.
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Gaudi::Property< bool > m_extendBulk
Shall ordinary ID tracks be equiped with a muon system extension used by MuGirl later.
Gaudi::Property< bool > m_excludeNSW
Prelimnary studies have shown that the NSWs generate a massive amount of fake candidates.
Gaudi::Property< float > m_extThreshold
Minimum pt threshold of the IdCandidate to be extrapolated through the spectrometer.
SG::ReadHandleKey< Muon::HoughDataPerSectorVec > m_houghDataPerSectorVecKey
Use the hough data to find sectors in the speectrometer traversed by a muon.
This is the common class for 3D segments used in the muon spectrometer.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
@ OWN_ELEMENTS
this data object owns its elements
std::unique_ptr< InDetCandidateCollection > outputContainer
Output container for the StoreGate.
const InDetCandidateCollection * input_candidates
Collection of the InDet candidates to consider.
std::set< const MuonCombined::InDetCandidate * > excluded_trks
Inner detector tracks to exclude.
std::map< Muon::MuonStationIndex::DetectorRegionIndex, std::set< int > > hit_sectors
Hit sector map.
std::vector< const Muon::MuonSegment * > candidate_segments
Muon segments that could be potentially used for MuGirl / MuTagIMO.
std::map< unsigned int, std::set< Identifier > > consumed_hits
Map of hits that were successfully combined to a muon segment Key is the hash made out of region & la...
std::set< const Muon::MuonSegment * > combined_segs
List of segments that were successfully combined to a muon.
MuidCoCache(const MuonCombined::InDetCandidate *id, const MuonCombined::CombinedFitTag *cb)