44 return StatusCode::SUCCESS;
52 std::unique_ptr<Trk::SegmentCollection> segmentContainer = std::make_unique<Trk::SegmentCollection>();
53 std::unique_ptr<Trk::SegmentCollection> nswSegmentContainer = !
m_segmentNSWCollectionKey.empty() ? std::make_unique<Trk::SegmentCollection>()
59 ATH_MSG_DEBUG(
"Processing the pattern collections with " << patternColl->
size() <<
" Collections ");
71 segmentContainer->insert(segmentContainer->end(), std::make_move_iterator(nswCache.
constructedSegs.begin()),
76 if (!nswSegmentContainer)
continue;
77 nswSegmentContainer->insert(nswSegmentContainer->end(), std::make_move_iterator(nswCache.
quadSegs.begin()),
78 std::make_move_iterator(nswCache.
quadSegs.end()));
85 std::unique_ptr<MuonSegmentCombinationCollection> csc4dSegmentCombinations{};
90 ATH_MSG_DEBUG(
"segments before overlap removal: " << segmentContainer->size());
92 ATH_MSG_DEBUG(
" Segments after overlap removal: " << segmentContainer->size());
96 ATH_MSG_INFO(
"Number of segments found " << segmentContainer->size());
112 return StatusCode::SUCCESS;
116 std::unique_ptr<MuonSegmentCombinationCollection>& csc4dSegmentCombinations)
const {
120 if (!cscPrds)
return StatusCode::SUCCESS;
122 std::vector<const Muon::CscPrepDataCollection*> cscCols;
124 ATH_MSG_DEBUG(
"Retrieved CscPrepDataContainer " << cscCols.size());
125 if (cscCols.empty())
return StatusCode::SUCCESS;
126 std::unique_ptr<MuonSegmentCombinationCollection> csc2dSegmentCombinations =
m_csc2dSegmentFinder->find(cscCols, ctx);
127 if (!csc2dSegmentCombinations)
return StatusCode::SUCCESS;
130 return StatusCode::SUCCESS;
134 if (!combi_coll)
return;
141 const unsigned int nstations = combi->numberOfStations();
142 const bool useEta = combi->useStripsInSegment(1);
143 const bool usePhi = combi->useStripsInSegment(0);
146 for (
unsigned int i = 0; i < nstations; ++i) {
150 if (!segments || segments->empty())
continue;
152 for (std::unique_ptr<Muon::MuonSegment>& seg : *segments) {
155 segmentContainer->
push_back(std::move(seg));
166 std::map<int, std::vector<std::unique_ptr<const Muon::MuonClusterOnTrack>> > clustersPerSector;
170 if (it.prepRawDataVec().empty())
continue;
172 const Identifier id = it.prepRawDataVec().front()->identify();
183 if (!newCluster)
continue;
184 std::vector<std::unique_ptr<const Muon::MuonClusterOnTrack>>& clusters = clustersPerSector[sector];
185 clusters.emplace_back(newCluster);
188 for (
auto&[sector, clusters] :clustersPerSector) {
200 ATH_MSG_DEBUG(
"Do not search segments in the Mdt part of the muon spectrometer");
201 return StatusCode::SUCCESS;
209 for (
const ROTRegion& region : hitsPerRegion) {
210 for (
const MdtVec& mdts : region.mdts()) {
211 if (mdts.empty())
continue;
215 if (
msgLvl(MSG::VERBOSE)){
216 std::vector<const Trk::MeasurementBase*> meas {};
217 meas.insert(meas.end(), mdts.begin(), mdts.end());
218 meas.insert(meas.end(), region.clusters().begin(), region.clusters().end());
221 <<
" nMdts: "<<mdts.size()<<
" nClusters "<<region.clusters().size()
225 m_segmentMaker->find(region.regionPos, region.regionDir, mdts, region.clusters(), hasPhiMeasurements, segs,
226 region.regionDir.mag());
228 std::vector<const Trk::RIO_OnTrack*> rios;
229 rios.insert(rios.begin(), mdts.begin(), mdts.end());
234 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
DataVector< Muon::MuonPatternCombination > MuonPatternCombinationCollection
This typedef represents a collection of MuonPatternCombination objects.
bool msgLvl(const MSG::Level lvl) const
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
Gaudi::Property< bool > m_runMdtSegments
Run the Mdt segment maker (Switched of the NCB systems)
virtual StatusCode initialize() override
Gaudi::Property< bool > m_doFullFinder
Run segment finding with eta / phi determination.
SG::ReadHandleKey< MuonPatternCombinationCollection > m_patternCollKey
StatusCode createCscSegments(const EventContext &ctx, std::unique_ptr< MuonSegmentCombinationCollection > &csc4dSegmentCombinations) const
Retrieve the raw outputs from the Csc segment makers for the curved combination.
void appendSegmentsFromCombi(const std::unique_ptr< MuonSegmentCombinationCollection > &combi_coll, Trk::SegmentCollection *segments) const
SG::WriteHandleKey< Trk::SegmentCollection > m_segmentCollectionKey
StatusCode createSegmentsWithMDTs(const EventContext &ctx, const Muon::MuonPatternCombination *patt, Trk::SegmentCollection *segs) const
ToolHandle< Muon::IMuonSegmentMaker > m_segmentMaker
Gaudi::Property< bool > m_doMMSegments
ToolHandle< Muon::IMuonPatternCalibration > m_patternCalibration
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< Trk::SegmentCollection > m_segmentNSWCollectionKey
SG::ReadHandleKey< Muon::CscPrepDataContainer > m_cscPrdsKey
Muon::IMuonNSWSegmentFinderTool::SegmentMakingCache NSWSegmentCache
ToolHandle< Muon::IMuonNSWSegmentFinderTool > m_clusterSegMakerNSW
Gaudi::Property< int > m_segQuality
Apply a preselection on the segments.
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
Gaudi::Property< bool > m_printSummary
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
void createNSWSegments(const EventContext &ctx, const Muon::MuonPatternCombination *patt, NSWSegmentCache &cache) const
Gaudi::Property< bool > m_removeUsedNswHits
If switched to true, hits that have been already successfully combined to a segment are removed from ...
ToolHandle< ICscSegmentFinder > m_csc4dSegmentFinder
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusterCreator
ToolHandle< Muon::IMuonSegmentOverlapRemovalTool > m_segmentOverlapRemovalTool
ToolHandle< ICscSegmentFinder > m_csc2dSegmentFinder
Gaudi::Property< bool > m_doSTgcSegments
Run the NSW segment maker.
ToolHandle< Muon::IMuonSegmentSelectionTool > m_segmentSelector
std::vector< const MdtDriftCircleOnTrack * > MdtVec
std::vector< ROTRegion > ROTsPerRegion
Base class for Muon cluster RIO_OnTracks.
Class representing clusters in the muon system.
This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
The MuonPatternCombination class provides the means to store the output of the initial global pattern...
const std::vector< MuonPatternChamberIntersect > & chamberData() const
access to the MuonPatternChamberIntersect associated with the MuonPatternCombination
Class to hold a set of MuonSegments belonging together.
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
This is the common class for 3D segments used in the muon spectrometer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Base class for all TrackSegment implementations, extends the common MeasurementBase.
const std::vector< const Trk::MeasurementBase * > & containedMeasurements() const
returns the vector of Trk::MeasurementBase objects
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
MuonPrepDataCollection< CscPrepData > CscPrepDataCollection
MuonPrepDataContainerT< CscPrepData > CscPrepDataContainer
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
DataVector< Trk::Segment > SegmentCollection