ATLAS Offline Software
MuonInDetToMuonSystemExtensionAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
35 public:
36  MuonInDetToMuonSystemExtensionAlg(const std::string& name, ISvcLocator* pSvcLocator);
38 
39  StatusCode initialize() override;
40  StatusCode execute(const EventContext& ctx) const override;
41 
42 private:
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"};
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"};
71  struct MuidCoCache {
75  };
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
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonInDetToMuonSystemExtensionAlg::m_muonSystemExtensionTool
ToolHandle< Muon::IMuonSystemExtensionTool > m_muonSystemExtensionTool
The system extension tool extrapolates the candidate through the spectrometer.
Definition: MuonInDetToMuonSystemExtensionAlg.h:61
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::consumed_hits
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...
Definition: MuonInDetToMuonSystemExtensionAlg.h:99
MuonInDetToMuonSystemExtensionAlg::m_extThreshold
Gaudi::Property< float > m_extThreshold
Minimum pt threshold of the IdCandidate to be extrapolated through the spectrometer.
Definition: MuonInDetToMuonSystemExtensionAlg.h:115
IMuonSystemExtensionTool.h
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::outputContainer
std::unique_ptr< InDetCandidateCollection > outputContainer
Output container for the StoreGate.
Definition: MuonInDetToMuonSystemExtensionAlg.h:90
MuonInDetToMuonSystemExtensionAlg::m_combTagMap
SG::ReadHandleKey< MuonCombined::InDetCandidateToTagMap > m_combTagMap
That is the collection of MuidCo candidates.
Definition: MuonInDetToMuonSystemExtensionAlg.h:63
MuonInDetToMuonSystemExtensionAlg::m_segmentSelector
PublicToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
Definition: MuonInDetToMuonSystemExtensionAlg.h:57
MuonInDetToMuonSystemExtensionAlg::m_extendBulk
Gaudi::Property< bool > m_extendBulk
Shall ordinary ID tracks be equiped with a muon system extension used by MuGirl later.
Definition: MuonInDetToMuonSystemExtensionAlg.h:119
MuonInDetToMuonSystemExtensionAlg::MuidCoVector
std::vector< MuidCoCache > MuidCoVector
Definition: MuonInDetToMuonSystemExtensionAlg.h:76
MuonInDetToMuonSystemExtensionAlg::m_houghMin
Gaudi::Property< int > m_houghMin
The hough maxima always contain at least 2 hits.
Definition: MuonInDetToMuonSystemExtensionAlg.h:109
MuonInDetToMuonSystemExtensionAlg::m_bulkInDetCandKey
SG::WriteHandleKey< InDetCandidateCollection > m_bulkInDetCandKey
Collection of InDet candidates written for MuGirl and MuonSegmentTag.
Definition: MuonInDetToMuonSystemExtensionAlg.h:46
MuonInDetToMuonSystemExtensionAlg::MuidCoCache::MuidCoCache
MuidCoCache(const MuonCombined::InDetCandidate *_id, const MuonCombined::CombinedFitTag *_cb)
Definition: MuonInDetToMuonSystemExtensionAlg.h:74
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::combined_segs
std::set< const Muon::MuonSegment * > combined_segs
List of segments that were successfully combined to a muon.
Definition: MuonInDetToMuonSystemExtensionAlg.h:87
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::tag_map
MuidCoVector tag_map
Combined fit tag map.
Definition: MuonInDetToMuonSystemExtensionAlg.h:85
MuonInDetToMuonSystemExtensionAlg::m_sector_mapping
const Muon::MuonSectorMapping m_sector_mapping
Definition: MuonInDetToMuonSystemExtensionAlg.h:121
MuonCombined::InDetCandidate
Definition: InDetCandidate.h:18
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::input_candidates
const InDetCandidateCollection * input_candidates
Collection of the InDet candidates to consider.
Definition: MuonInDetToMuonSystemExtensionAlg.h:80
MuonInDetToMuonSystemExtensionAlg::maskHits
void maskHits(const Muon::MuonSegment *muon_seg, InDetCandidateCache &output_cache) const
Mask the hits of the corresponding muon segment as used.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:375
MuonPrepDataContainer.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MuonInDetToMuonSystemExtensionAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:49
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonInDetToMuonSystemExtensionAlg::m_segmentQuality
Gaudi::Property< int > m_segmentQuality
Definition: MuonInDetToMuonSystemExtensionAlg.h:111
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache
Definition: MuonInDetToMuonSystemExtensionAlg.h:78
MuonInDetToMuonSystemExtensionAlg
The MuonInDetToMuonSystemExtensionAlg processes further the InDetCandidates created by the MuonCombin...
Definition: MuonInDetToMuonSystemExtensionAlg.h:34
MuonInDetToMuonSystemExtensionAlg::MuidCoCache::id_trk
const MuonCombined::InDetCandidate * id_trk
Definition: MuonInDetToMuonSystemExtensionAlg.h:72
MuonInDetToMuonSystemExtensionAlg::~MuonInDetToMuonSystemExtensionAlg
~MuonInDetToMuonSystemExtensionAlg()=default
MuonInDetToMuonSystemExtensionAlg::m_stauInDetCandKey
SG::WriteHandleKey< InDetCandidateCollection > m_stauInDetCandKey
Collection of InDet candidates written for MuGirlStau.
Definition: MuonInDetToMuonSystemExtensionAlg.h:48
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
MuonInDetToMuonSystemExtensionAlg::m_restrictExtension
Gaudi::Property< bool > m_restrictExtension
Restrict the extrapolation of ID tracks to sectors in the MS where at least a hit is recorded.
Definition: MuonInDetToMuonSystemExtensionAlg.h:106
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
MuonInDetToMuonSystemExtensionAlg::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonInDetToMuonSystemExtensionAlg.h:67
MuonInDetToMuonSystemExtensionAlg::createStaus
StatusCode createStaus(const EventContext &ctx, const InDetCandidateCollection *ext_candidates, const MuidCoVector &tag_map) const
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:337
MuonInDetToMuonSystemExtensionAlg::findSegments
StatusCode findSegments(const EventContext &ctx, InDetCandidateCache &output_cache) const
Select good segments.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:259
IMuonSegmentSelectionTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonInDetToMuonSystemExtensionAlg::MuonInDetToMuonSystemExtensionAlg
MuonInDetToMuonSystemExtensionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:31
MuonInDetToMuonSystemExtensionAlg::selectCandidates
StatusCode selectCandidates(const EventContext &ctx, InDetCandidateCache &cache) const
Select the MuidCo candidates and put the associated id tracks on a black list.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:74
MuonCombined::CombinedFitTag
TagBase implementation for a combined fit.
Definition: CombinedFitTag.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::excluded_trks
std::set< const MuonCombined::InDetCandidate * > excluded_trks
Inner detector tracks to exclude.
Definition: MuonInDetToMuonSystemExtensionAlg.h:83
MuonInDetToMuonSystemExtensionAlg::hasMatchingSeed
bool hasMatchingSeed(const MuonCombined::InDetCandidate &id_cand, const InDetCandidateCache &cache) const
Searches for hough seeds within theta < 0.2 && sharing the same sector.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:321
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::candidate_segments
std::vector< const Muon::MuonSegment * > candidate_segments
Muon segments that could be potentially used for MuGirl / MuTagIMO.
Definition: MuonInDetToMuonSystemExtensionAlg.h:102
MuonInDetToMuonSystemExtensionAlg::hasMatchingSegment
bool hasMatchingSegment(const MuonCombined::InDetCandidate &id_cand, const InDetCandidateCache &cache) const
Searches for segments within theta < 0.2 && sharing the same sector.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:292
AthReentrantAlgorithm.h
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
InDetCandidateToTagMap.h
IMuonEDMHelperSvc.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonInDetToMuonSystemExtensionAlg::MuidCoCache::cmb_trk
const MuonCombined::CombinedFitTag * cmb_trk
Definition: MuonInDetToMuonSystemExtensionAlg.h:73
MuonInDetToMuonSystemExtensionAlg::findHitSectors
StatusCode findHitSectors(const EventContext &ctx, InDetCandidateCache &output_cache) const
Find the sectors in the MS with muon signals.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:178
MuonInDetToMuonSystemExtensionAlg::m_excludeNSW
Gaudi::Property< bool > m_excludeNSW
Prelimnary studies have shown that the NSWs generate a massive amount of fake candidates.
Definition: MuonInDetToMuonSystemExtensionAlg.h:113
MuonInDetToMuonSystemExtensionAlg::MuidCoCache
Helper struct to cache the MuidCo track and it's associated segments while keeping the association In...
Definition: MuonInDetToMuonSystemExtensionAlg.h:71
MuonInDetToMuonSystemExtensionAlg::m_extendSAF
Gaudi::Property< bool > m_extendSAF
Shall SAF tracks be equiped with a muon system extension used by MuGirl later.
Definition: MuonInDetToMuonSystemExtensionAlg.h:117
MuonInDetToMuonSystemExtensionAlg::m_houghDataPerSectorVecKey
SG::ReadHandleKey< Muon::HoughDataPerSectorVec > m_houghDataPerSectorVecKey
Use the hough data to find sectors in the speectrometer traversed by a muon.
Definition: MuonInDetToMuonSystemExtensionAlg.h:51
MuonInDetToMuonSystemExtensionAlg::create
StatusCode create(const EventContext &ctx, InDetCandidateCache &cache) const
Create the InDetCandidaes with system extensions.
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:101
HoughDataPerSec.h
MuonSectorMapping.h
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::hit_sectors
std::map< Muon::MuonStationIndex::DetectorRegionIndex, std::set< int > > hit_sectors
Hit sector map.
Definition: MuonInDetToMuonSystemExtensionAlg.h:93
MuonInDetToMuonSystemExtensionAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonInDetToMuonSystemExtensionAlg.h:65
CombinedFitTag.h
MuonInDetToMuonSystemExtensionAlg::initialize
StatusCode initialize() override
Definition: MuonInDetToMuonSystemExtensionAlg.cxx:34
MuonSegment.h
Muon::MuonSectorMapping
Definition: MuonSectorMapping.h:20
InDetCandidateCollection.h
MuonStationIndex.h
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
MuonInDetToMuonSystemExtensionAlg::m_segmentKey
SG::ReadHandleKey< Trk::SegmentCollection > m_segmentKey
Let's exploit the segments to get rid of as much tracks as possible.
Definition: MuonInDetToMuonSystemExtensionAlg.h:54
MuonInDetToMuonSystemExtensionAlg::m_inputCandidate
SG::ReadHandleKey< InDetCandidateCollection > m_inputCandidate
Definition: MuonInDetToMuonSystemExtensionAlg.h:43
MuonInDetToMuonSystemExtensionAlg::InDetCandidateCache::eta_seeds
std::map< int, std::vector< double > > eta_seeds
Definition: MuonInDetToMuonSystemExtensionAlg.h:95
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >