ATLAS Offline Software
MuonTrackSteering.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MuonTrackSteering.h"
6 
7 #include <algorithm>
8 #include <cmath>
9 #include <iomanip>
10 #include <set>
11 #include <sstream>
12 #include <string>
13 #include <utility>
14 
26 namespace Muon {
27 
28  std::string print(const MuPatSegment& /* seg */) { return ""; }
29 
30  std::string print(const std::vector<MuPatSegment*>& segVec) {
31  std::ostringstream s;
32  for (const MuPatSegment* sit : segVec) { s << " " << print(*sit); }
33  return s.str();
34  }
35 
36  std::string print(const MuPatTrack& track) {
37  std::ostringstream s;
38  s << "Track:" << print(track.segments());
39  return s.str();
40  }
41 
42  std::string print(const std::vector<std::unique_ptr<MuPatTrack> >& tracks) {
43  std::ostringstream s;
44  for (const std::unique_ptr<MuPatTrack>& tit : tracks) s << std::endl << print(*tit);
45 
46  return s.str();
47  }
48  //----------------------------------------------------------------------------------------------------------
49 
50  MuonTrackSteering::MuonTrackSteering(const std::string& t, const std::string& n, const IInterface* p) :
51  AthAlgTool(t, n, p), m_combinedSLOverlaps(false) {
52  declareInterface<IMuonTrackFinder>(this);
53 
54  declareProperty("StrategyList", m_stringStrategies, "List of strategies to be used by the track steering");
55  declareProperty("SegSeedQCut", m_segQCut[0] = -2, "Required quality for segments to be a seed");
56  declareProperty("Seg2ndQCut", m_segQCut[1] = -2, "Required quality for segments to be the second on a track");
57  declareProperty("SegOtherQCut", m_segQCut[2] = -2, "Required quality for segments to be added to a track");
58  declareProperty("OutputSingleStationTracks", m_outputSingleStationTracks = false);
59  declareProperty("DoSummary", m_doSummary = false);
60  declareProperty("UseTightSegmentMatching", m_useTightMatching = true);
61  declareProperty("SegmentThreshold", m_segThreshold = 8);
62  declareProperty("OnlyMdtSeeding", m_onlyMDTSeeding = true);
63  }
64 
66  ATH_CHECK(m_edmHelperSvc.retrieve());
67  ATH_CHECK(m_printer.retrieve());
68  ATH_CHECK(m_candidateTool.retrieve());
70  ATH_CHECK(m_trackBTool.retrieve());
71  ATH_CHECK(m_ambiTool.retrieve());
72  ATH_CHECK(m_mooBTool.retrieve());
73  ATH_CHECK(m_trackRefineTool.retrieve());
74  ATH_CHECK(m_trackSummaryTool.retrieve());
76  if (m_outputSingleStationTracks) ATH_MSG_INFO("Single station track enabled ");
77  ATH_CHECK(m_segmentFitter.retrieve(DisableTool{!m_outputSingleStationTracks}));
78  ATH_CHECK(m_muonHoleRecoverTool.retrieve(DisableTool{!m_outputSingleStationTracks}));
79  ATH_CHECK(m_trackSelector.retrieve(DisableTool{m_trackSelector.empty()}));
80  if (!m_trackSelector.empty()) ATH_MSG_INFO("Track selection enabled: " << m_trackSelector);
81 
82  return StatusCode::SUCCESS;
83  }
84 
85  std::unique_ptr<TrackCollection> MuonTrackSteering::find(const EventContext& ctx, const MuonSegmentCollection& coll) const {
86  GarbageContainer trash_bin{};
87  trash_bin.reserve(150);
88 
89  std::unique_ptr<TrackCollection> result = std::make_unique<TrackCollection>();
90 
91  SegColVec chamberSegments(MuonStationIndex::ChIndexMax); // <! Segments sorted per Chamber
92  SegColVec stationSegments(MuonStationIndex::StIndexMax); // <! Segments sorted per station
93  ChSet chambersWithSegments;
94  StSet stationsWithSegments;
95  // Extract segments into work arrays
96  if (extractSegments(ctx, coll, chamberSegments, stationSegments, chambersWithSegments, stationsWithSegments, trash_bin)) {
97  // Perform the actual track finding
98  result = findTracks(ctx, chamberSegments, stationSegments);
99  }
100  return result;
101  }
102 
103  bool MuonTrackSteering::extractSegments(const EventContext& ctx, const MuonSegmentCollection& coll, SegColVec& chamberSegments, SegColVec& stationSegments,
104  ChSet& chambersWithSegments, StSet& stationsWithSegments, GarbageContainer& trash_bin) const {
105  if (coll.empty()) return false;
106 
107  ATH_MSG_DEBUG("New collection " << coll.size());
108 
109  // Sort the input collection by chamber & station IDs
110  for (const MuonSegment* segment : coll) {
111  ATH_MSG_DEBUG("Adding segment ");
112  std::unique_ptr<MuPatSegment> aSeg = m_candidateTool->createSegInfo(ctx, *segment);
113  ATH_MSG_DEBUG(" -> MuPatSegment " << m_candidateTool->print(*aSeg));
114 
115  MuonStationIndex::ChIndex chIndex = aSeg->chIndex;
116  MuonStationIndex::StIndex stIndex = aSeg->stIndex;
117  if (chIndex < 0 || stIndex < 0) {
118  ATH_MSG_WARNING("Chamber or station index invalid:" << m_candidateTool->print(*aSeg));
119  continue;
120  }
121  chambersWithSegments.insert(chIndex);
122  stationsWithSegments.insert(stIndex);
123 
124  std::vector<MuPatSegment*>& segments = chamberSegments[chIndex];
125  segments.push_back(aSeg.get());
126  if (!m_combinedSLOverlaps) {
127  std::vector<MuPatSegment*>& segments2 = stationSegments[stIndex];
128  segments2.push_back(aSeg.get());
129  }
130  trash_bin.push_back(std::move(aSeg));
131  }
132 
133  if (m_combinedSLOverlaps) {
134  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::BIS], chamberSegments[MuonStationIndex::BIL], stationSegments,
135  stationsWithSegments, trash_bin);
136  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::BMS], chamberSegments[MuonStationIndex::BML], stationSegments,
137  stationsWithSegments, trash_bin);
138  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::BOS], chamberSegments[MuonStationIndex::BOL], stationSegments,
139  stationsWithSegments, trash_bin);
140  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::EIS], chamberSegments[MuonStationIndex::EIL], stationSegments,
141  stationsWithSegments, trash_bin);
142  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::EMS], chamberSegments[MuonStationIndex::EML], stationSegments,
143  stationsWithSegments, trash_bin);
144  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::EOS], chamberSegments[MuonStationIndex::EOL], stationSegments,
145  stationsWithSegments, trash_bin);
146  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::EES], chamberSegments[MuonStationIndex::EEL], stationSegments,
147  stationsWithSegments, trash_bin);
148  combineOverlapSegments(ctx, chamberSegments[MuonStationIndex::CSS], chamberSegments[MuonStationIndex::CSL], stationSegments,
149  stationsWithSegments, trash_bin);
150  std::vector<MuPatSegment*>& segments = chamberSegments[MuonStationIndex::BEE];
151  if (!segments.empty()) {
152  chambersWithSegments.insert(MuonStationIndex::BEE);
153  stationsWithSegments.insert(MuonStationIndex::BE);
154  std::vector<MuPatSegment*>& segs = stationSegments[MuonStationIndex::BE];
155  segs.insert(segs.end(), segments.begin(), segments.end());
156  }
157  }
158  return true;
159  }
160 
161  void MuonTrackSteering::combineOverlapSegments(const EventContext& ctx, std::vector<MuPatSegment*>& ch1, std::vector<MuPatSegment*>& ch2,
162  SegColVec& stationSegments, StSet& stationsWithSegments,
163  GarbageContainer& trash_bin) const {
166  // if both empty there is nothing to be done
167  if (ch1.empty() && ch2.empty()) return;
168 
169  // get station index from the first segment in the first non empty vector
170  MuonStationIndex::StIndex stIndex = !ch1.empty() ? ch1.front()->stIndex : ch2.front()->stIndex;
171 
172  SegCol& stationVec = stationSegments[stIndex];
173 
174  // vector to flag entries in the second station that were matched
175  std::vector<bool> wasMatched2(ch2.size(), false);
176 
177  // loop over all possible combinations
178  for (MuPatSegment* sit1 : ch1) {
179  // do not combine poor quality segments
180  int qualityLevel1 = ch1.size() > 5 ? 1 : 2;
181  if (sit1->quality < qualityLevel1) {
182  ATH_MSG_VERBOSE("resolveSLOverlaps::bad segment1 q: " << sit1->quality << " cut " << qualityLevel1 << std::endl
183  << m_printer->print(*sit1->segment));
184  stationVec.push_back(sit1);
185  continue;
186  }
187 
188  bool wasMatched1 = false;
189 
190  // apply looser cuts as we perform matching
191  int qualityLevel2 = ch2.size() > 5 ? 1 : 2;
194  int idx_ch2 = -1;
195  for (MuPatSegment* sit2 : ch2) {
196  ++idx_ch2;
197  // do not combine poor quality segments AND require at least one of the segments to have a quality beter than 1
198  if (sit2->quality < qualityLevel2) {
199  ATH_MSG_VERBOSE("resolveSLOverlaps::bad segment2: q " << sit2->quality << " cut " << qualityLevel2 << std::endl
200  << m_printer->print(*sit2->segment));
201  continue;
202  }
203  if (sit1->quality < 2 && sit2->quality < 2) {
204  ATH_MSG_VERBOSE("resolveSLOverlaps:: combination of insufficient quality " << std::endl
205  << " q1 " << sit1->quality << " q2 "
206  << sit1->quality);
207  continue;
208  }
209 
210  ATH_MSG_VERBOSE(" combining entries: " << std::endl
211  << m_printer->print(*sit1->segment) << std::endl
212  << m_printer->print(*sit2->segment));
213 
214  if (!m_candidateMatchingTool->match(ctx, *sit1, *sit2, false)) {
215  ATH_MSG_VERBOSE(" overlap combination rejected based on matching" << std::endl << m_printer->print(*sit2->segment));
216  continue;
217  }
218 
219  // create MuonSegment
220  static const Muon::IMuonSegmentTrackBuilder::PrepVec emptyPhiHits{};
221  std::unique_ptr<MuonSegment> newseg{m_mooBTool->combineToSegment(ctx, *sit1, *sit2, emptyPhiHits)};
222  if (!newseg) {
223  ATH_MSG_DEBUG(" Combination of segments failed ");
224  continue;
225  }
226  const Trk::FitQuality* fq = newseg->fitQuality();
227  if (!fq || fq->numberDoF() == 0) {
228  ATH_MSG_WARNING(" no fit quality, dropping segment ");
229  continue;
230  }
231  if (fq->chiSquared() / fq->numberDoF() > 2.5) {
232  ATH_MSG_DEBUG("bad fit quality, dropping segment " << fq->chiSquared() / fq->numberDoF());
233  continue;
234  }
235  std::unique_ptr<MuPatSegment> segInfo = m_candidateTool->createSegInfo(ctx, *newseg);
236  // check whether segment of good quality AND that its quality is equal or better than the input segments
237  if (segInfo->quality < 2 || (segInfo->quality < sit1->quality || segInfo->quality < sit2->quality)) {
238  ATH_MSG_VERBOSE("resolveSLOverlaps::bad segment " << std::endl << m_printer->print(*segInfo->segment));
239  continue;
240  }
241  int shared_eta = 0, shared_phi = 0; // check for hits shared between segments
242 
243  const MuPatSegment* const_sit1 = sit1;
244  const MuPatSegment* const_sit2 = sit2;
245  for (const MuPatHitPtr& hit_ch1 : const_sit1->hitList()) {
246  for (const MuPatHitPtr& hit_ch2 : const_sit2->hitList()) {
247  if (hit_ch1->info().id == hit_ch2->info().id) {
248  if (hit_ch1->info().measuresPhi)
249  shared_phi++;
250  else
251  shared_eta++;
252  }
253  }
254  }
255 
256  if (sit1->etaHits().size() + sit2->etaHits().size() - shared_eta - segInfo->etaHits().size() > 1) {
257  ATH_MSG_VERBOSE("resolveSLOverlaps::more than one eta measurement removed, dropping track "
258  << std::endl
259  << m_printer->print(*segInfo->segment));
260  continue;
261  }
262 
263  int phiHitDiff = sit1->phiHits().size() + sit2->phiHits().size() - shared_phi - segInfo->phiHits().size();
264  if (phiHitDiff > 1 || (sit1->phiHits().size() + sit2->phiHits().size() > 0 && segInfo->phiHits().empty())) {
265  ATH_MSG_VERBOSE("resolveSLOverlaps::more than one phi measurement removed, dropping track "
266  << std::endl
267  << m_printer->print(*segInfo->segment));
268  continue;
269  }
272  double cosPointingAngle = (newseg->globalPosition().x() * newseg->globalDirection().x() +
273  newseg->globalPosition().y() * newseg->globalDirection().y()) /
274  (newseg->globalPosition().perp() * newseg->globalDirection().perp());
275  if (cosPointingAngle < 0.995) {
276  ATH_MSG_VERBOSE("resolveSLOverlaps: rejected due to too large pointing angle " << std::endl
277  << m_printer->print(*segInfo->segment));
278  continue;
279  }
280  ATH_MSG_VERBOSE("created SL overlap segment: cos pointing " << cosPointingAngle << std::endl
281  << m_printer->print(*segInfo->segment));
282 
283  // flag segments as matched
284  wasMatched1 = true;
285  wasMatched2[idx_ch2] = true;
286 
287  // add segment
288  stationVec.push_back(segInfo.get());
289  trash_bin.push_back(std::move(newseg));
290  trash_bin.push_back(std::move(segInfo));
291 
292  }
293 
294  // if entry was not associated with entry in other station add it to entries
295  if (!wasMatched1) { stationVec.push_back(sit1); }
296  }
297 
298  // loop over entries in second station and add unassociated entries to candidate entries
299  for (unsigned int i = 0; i < wasMatched2.size(); ++i) {
300  if (!wasMatched2[i]) { stationVec.push_back(ch2[i]); }
301  }
302 
303  // add station to list of stations with segments
304  if (!stationVec.empty()) { stationsWithSegments.insert(stIndex); }
305 
306  // sort segment according to their quality
307  std::stable_sort(stationVec.begin(), stationVec.end(), SortSegInfoByQuality());
308  }
309 
310  //-----------------------------------------------------------------------------------------------------------
311 
312  std::unique_ptr<TrackCollection> MuonTrackSteering::findTracks(const EventContext& ctx, SegColVec& chamberSegments, SegColVec& stationSegments) const {
313  // Very basic : output all of the segments we are starting with
314  ATH_MSG_DEBUG("List of all strategies: " << m_strategies.size());
315  for (unsigned int i = 0; i < m_strategies.size(); ++i) ATH_MSG_DEBUG((*(m_strategies[i])));
316 
317  std::vector<std::unique_ptr<MuPatTrack> > resultAll;
318 
319  // Outermost loop over strategies!
320  for (unsigned int i = 0; i < m_strategies.size(); ++i) {
321  if (!m_strategies[i]) continue; // Check for empty strategy pointer
322 
324 
325  std::vector<std::unique_ptr<MuPatTrack> > result;
326 
327  // Segments that will be looped over...
328  SegColVec mySegColVec(strategy.getAll().size());
329 
330  ATH_MSG_VERBOSE("Segments to be looped on: " << mySegColVec.size());
331 
332  std::set<MuonStationIndex::StIndex> stations;
333  // Preprocessing : loop over layers
334  for (unsigned int lit = 0; lit < strategy.getAll().size(); ++lit) {
335  std::vector<MuonStationIndex::ChIndex> chambers = strategy.getCh(lit);
336 
337  // Optional : combine segments in the same station but different chambers
339  // Loop over stations in the layer
340  for (unsigned int chin = 0; chin < chambers.size(); ++chin) {
341  // get station index for the chamber
343 
344  // skip those that are already included
345  if (stations.count(stIndex)) continue;
346  SegCol& segments = stationSegments[stIndex];
347  // Add all of the MuPatSegments into the list for that layer
348  // db
349 
351  // SegCol filteredSegments;
352  for (unsigned int iseg = 0; iseg < segments.size(); iseg++) {
353  double thetaSeg = std::abs((*segments[iseg]).segment->globalPosition().theta());
354 
355  // only select segments in barrel/endcap overlap
356  if ((0.74159 > thetaSeg && thetaSeg > 0.51159) || (2.63 > thetaSeg && thetaSeg > 2.40))
357  mySegColVec[lit].push_back(segments[iseg]);
358  }
359  } else {
360  mySegColVec[lit].insert(mySegColVec[lit].end(), segments.begin(), segments.end());
361  }
362 
363  stations.insert(stIndex);
364  } // End of loop over chambers
365 
366  } else {
367  // Loop over stations in the layer
368  for (unsigned int chin = 0; chin < chambers.size(); ++chin) {
369  SegCol& segments = chamberSegments[chambers[chin]];
370  // Throw all of the MuPatSegments into the list for that layer
371  mySegColVec[lit].insert(mySegColVec[lit].end(), segments.begin(), segments.end());
372  } // End of loop over chambers
373  } // End of if combine segments in a layer
374 
375  } // End of loop over layers
376 
377  // Preprocessing step two : sort all layers' segments by quality
378  for (unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
379  std::stable_sort(mySegColVec[lit].begin(), mySegColVec[lit].end(), SortSegInfoByQuality());
380  }
381 
382  if (m_doSummary || msgLvl(MSG::DEBUG)) {
383  bool hasSegments = false;
384  for (unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
385  if (!mySegColVec[lit].empty()) {
386  hasSegments = true;
387  break;
388  }
389  }
390  if (hasSegments) {
391  msg(m_doSummary ? MSG::INFO : MSG::DEBUG) << "For strategy: " << strategy.getName() << " segments are: ";
392  for (unsigned int lit = 0; lit < mySegColVec.size(); ++lit)
393  for (unsigned int sit = 0; sit < mySegColVec[lit].size(); ++sit)
394  msg(m_doSummary ? MSG::INFO : MSG::DEBUG) << std::endl
395  << " " << m_candidateTool->print(*(mySegColVec[lit])[sit]);
396  msg(m_doSummary ? MSG::INFO : MSG::DEBUG) << endmsg;
397  }
398  }
399 
400  // Hang on to whether we want to cut seeds or not
402 
403  // Now assign priority for the layers
404  std::vector<unsigned int> seeds;
405 
406  // Assign seeds dynamically according to
408  // Loop through layers and do a little sort
409  std::vector<std::pair<int, unsigned int> > occupancy; // layer , occ
410  for (unsigned int lit = 0; lit < mySegColVec.size(); ++lit) {
411  occupancy.emplace_back(mySegColVec[lit].size(), lit);
412  }
413  std::stable_sort(occupancy.begin(), occupancy.end());
414  for (unsigned int lit = 0; lit < occupancy.size(); ++lit) { seeds.push_back(occupancy[lit].second); }
415  } else {
416  seeds = strategy.seeds();
417  if (seeds.empty()) {
418  for (unsigned int j = 0; j < mySegColVec.size(); ++j) seeds.push_back(j);
419  }
420  }
421  ATH_MSG_VERBOSE("Selected seed layers " << seeds.size());
422 
423  MuPatSegment* seedSeg = nullptr;
424  // Loop over seed layers
425  for (unsigned int lin = 0; lin < seeds.size(); ++lin) {
426  // Loop over segments in that layer
427  ATH_MSG_VERBOSE("New seed layer " << lin << " segments in layer " << mySegColVec[lin].size());
428 
429  for (unsigned int sin = 0; sin < mySegColVec[lin].size(); sin++) {
430  seedSeg = mySegColVec[lin].operator[](sin);
431  if (!seedSeg) continue; // Check for empty poinnter
432 
433  // Optionally, if the seed is on a track we skip it
434  if (cutSeeds && seedSeg->usedInFit) continue;
435 
436  // See if the seed passes our quality cut
437  if (seedSeg->quality < m_segQCut[0] ||
438  (m_segQCut[0] == -99 && !(seedSeg->segQuality && seedSeg->segQuality->isStrict())))
439  continue;
440  if (m_onlyMDTSeeding && !seedSeg->isMdt) continue;
441 
442  int segsInCone = 0;
443  double phiSeed = seedSeg->segment->globalPosition().phi();
444  double etaSeed = seedSeg->segment->globalPosition().eta();
445  for (unsigned int sin2 = 0; sin2 < mySegColVec[lin].size(); sin2++) {
446  if (sin == sin2) continue;
447  MuPatSegment* seg = mySegColVec[lin].operator[](sin2);
448 
449  if (seg->quality < m_segQCut[0] || (m_segQCut[0] == -99 && !(seg->segQuality && seg->segQuality->isStrict())))
450  continue;
451 
452  double phiSeg = seg->segment->globalPosition().phi();
453  double etaSeg = seg->segment->globalPosition().eta();
454 
455  double deltaPhi = xAOD::P4Helpers::deltaPhi(phiSeed, phiSeg);
456  double deltaEta = std::abs(etaSeed - etaSeg);
457  double deltaR = std::hypot(deltaPhi, deltaEta);
458 
459  if (deltaR < 0.35) segsInCone++;
460  }
461  ATH_MSG_VERBOSE("New seed " << sin << " segments in cone " << segsInCone);
462 
463  if (segsInCone > m_segThreshold && seedSeg->quality < m_segQCut[0] + 1) continue;
464 
465  std::vector<std::unique_ptr<MuPatTrack> > found =
466  findTrackFromSeed(ctx, *seedSeg, *(m_strategies[i]), seeds[lin], mySegColVec);
467 
468  ATH_MSG_VERBOSE(" Tracks for seed: " << std::endl << " --- " << m_candidateTool->print(result));
469  if (!found.empty()) {
470  result.insert(result.end(), std::make_move_iterator(found.begin()), std::make_move_iterator(found.end()));
471  }
472  } // End of loop over segments in a layer
473  } // Done with loop over seed layers
474 
475  // Post-processing : refinement
477 
478  // Post-processing : ambiguity resolution
479  if (msgLvl(MSG::DEBUG) && !result.empty()) {
480  msg(MSG::DEBUG) << "Initial track collection for strategy: " << strategy.getName() << " " << m_candidateTool->print(result)
481  << endmsg;
482  }
483 
485 
486  if (!result.empty())
487  resultAll.insert(resultAll.end(), std::make_move_iterator(result.begin()), std::make_move_iterator(result.end()));
488 
489  } // Done with loop over strategies
490 
491  if (!resultAll.empty()) { solveAmbiguities(resultAll); }
492 
494  SegCol& emSegments = stationSegments[MuonStationIndex::EM];
495  // loop over segments in EM stations
496  if (!emSegments.empty()) {
497  for (MuPatSegment* sit : emSegments) {
498  // skip segments that are associated to a track
499  if (!sit->tracks().empty()) continue;
500 
501  // only take highest quality segments
502  if (sit->quality < 2) continue;
503 
504  // fit segment and add the track if fit ok
505  std::unique_ptr<Trk::Track> segmentTrack(m_segmentFitter->fit(*sit->segment));
506  if (segmentTrack) {
507  // Try to recover hits on the track
508  std::unique_ptr<Trk::Track> recoveredTrack(m_muonHoleRecoverTool->recover(*segmentTrack, ctx));
509  if (recoveredTrack) segmentTrack.swap(recoveredTrack);
510 
511  // generate a track summary for this track
512  if (m_trackSummaryTool.isEnabled()) {
513  m_trackSummaryTool->computeAndReplaceTrackSummary(ctx, *segmentTrack, false);
514  }
515 
516  std::unique_ptr<MuPatTrack> can = m_candidateTool->createCandidate(*sit, segmentTrack);
517  if (can)
518  resultAll.push_back(std::move(can));
519  else
520  ATH_MSG_WARNING("Failed to create MuPatTrack");
521  }
522  }
523  }
524  }
525 
526  // Output all the tracks that we are ending with
527  if (!resultAll.empty()) {
528  if (m_doSummary)
529  ATH_MSG_INFO("Final Output : " << m_candidateTool->print(resultAll) << endmsg);
530  else
531  ATH_MSG_DEBUG("Final Output : " << m_candidateTool->print(resultAll) << endmsg);
532  }
533  std::unique_ptr<TrackCollection> finalTrack = nullptr;
534  if (!resultAll.empty()) { finalTrack = selectTracks(resultAll); }
535 
536  return finalTrack;
537  }
538 
539  std::vector<std::unique_ptr<MuPatTrack> > MuonTrackSteering::findTrackFromSeed(const EventContext& ctx, MuPatSegment& seedSeg,
540  const MuonTrackSteeringStrategy& strat,
541  const unsigned int layer, const SegColVec& segs) const {
542  // the resulting vector of tracks to be returned
543  std::vector<std::unique_ptr<MuPatTrack> > result;
544  ATH_MSG_DEBUG("Working on seed: " << std::endl << " --- " << m_candidateTool->print(seedSeg));
545  const unsigned int endLayer = strat.getAll().size();
547  for (unsigned int ilayer = 0; ilayer < strat.getAll().size(); ++ilayer) {
548  if (ilayer == layer) continue; // don't include the layer of the seed
549 
550  if (segs[ilayer].empty()) continue;
551 
552  std::vector<MuPatSegment*> matchedSegs;
553  bool tightCuts = false;
554  //
555  if (m_useTightMatching) {
556  double phiSeed = (seedSeg.segment)->globalPosition().phi();
557  double etaSeed = (seedSeg.segment)->globalPosition().eta();
558 
559  int segsInCone = 0;
560  for (unsigned int j = 0; j < segs[ilayer].size(); j++) {
561  double phiSeg = (*segs[ilayer][j]).segment->globalPosition().phi();
562  double etaSeg = (*segs[ilayer][j]).segment->globalPosition().eta();
563 
564  double deltaPhi = xAOD::P4Helpers::deltaPhi(phiSeed, phiSeg);
565  double deltaEta = std::abs(etaSeed - etaSeg);
566  double deltaR = std::hypot(deltaPhi, deltaEta);
567 
568  if (deltaR < 0.35) segsInCone++;
569  }
570 
571  if (segsInCone > m_segThreshold) {
572  for (unsigned int j = 0; j < segs[ilayer].size(); ++j) {
573  bool isMatched = m_candidateMatchingTool->match(ctx, seedSeg, *segs[ilayer][j], true);
574 
575  if (isMatched) matchedSegs.push_back(segs[ilayer][j]);
576  }
577  if (matchedSegs.empty()) continue;
578  tightCuts = true;
579  }
580  }
581 
582  std::vector<std::unique_ptr<MuPatTrack> > tracks;
583 
584  if (!matchedSegs.empty() && m_useTightMatching)
585  tracks = m_trackBTool->find(ctx, seedSeg, matchedSegs);
586  else
587  tracks = m_trackBTool->find(ctx, seedSeg, segs[ilayer]);
588  if (!tracks.empty()) {
589  // if we reached the end of the sequence, we should save what we have else continue to next layer
590  if (ilayer + 1 == strat.getAll().size()) {
591  result.insert(result.end(), std::make_move_iterator(tracks.begin()), std::make_move_iterator(tracks.end()));
592  break;
593  }
594 
595  // loop on found tracks
596  for (std::unique_ptr<MuPatTrack>& cit : tracks) {
597  unsigned int nextLayer = ilayer + 1;
598  if (nextLayer < strat.getAll().size()) {
599  int cutLevel = tightCuts ? 1 : 0;
600  std::vector<std::unique_ptr<MuPatTrack> > nextTracks =
601  extendWithLayer(ctx, *cit, segs, nextLayer, endLayer, cutLevel);
602  if (!nextTracks.empty()) {
603  result.insert(result.end(), std::make_move_iterator(nextTracks.begin()),
604  std::make_move_iterator(nextTracks.end()));
605  } else {
606  result.push_back(std::move(cit));
607  }
608  }
609  }
610  }
611  }
612 
613  ATH_MSG_DEBUG("Constructed " << result.size() << " tracks with strategy " << strat.getName());
614  return result;
615  }
616 
617  std::vector<std::unique_ptr<MuPatTrack> > MuonTrackSteering::extendWithLayer(const EventContext& ctx, MuPatTrack& candidate, const SegColVec& segs,
618  unsigned int nextlayer, const unsigned int endlayer,
619  int cutLevel) const {
620  std::vector<std::unique_ptr<MuPatTrack> > result;
621  if (nextlayer < endlayer) {
622  for (; nextlayer != endlayer; nextlayer++) {
623  if (segs[nextlayer].empty()) continue;
624 
625  std::vector<std::unique_ptr<MuPatTrack> > nextTracks = m_trackBTool->find(ctx, candidate, segs[nextlayer]);
626  if (!nextTracks.empty()) {
627  for (std::unique_ptr<MuPatTrack>& cit : nextTracks) {
628  std::vector<std::unique_ptr<MuPatTrack> > nextTracks2 =
629  extendWithLayer(ctx, *cit, segs, nextlayer + 1, endlayer, cutLevel);
630  if (!nextTracks2.empty()) {
631  result.insert(result.end(), std::make_move_iterator(nextTracks2.begin()),
632  std::make_move_iterator(nextTracks2.end()));
633  } else {
634  result.push_back(std::move(cit));
635  }
636  }
637  }
638  }
639  }
640 
641  return result;
642  }
643 
644  //-----------------------------------------------------------------------------------------------------------
645  std::unique_ptr<TrackCollection> MuonTrackSteering::selectTracks(std::vector<std::unique_ptr<MuPatTrack> >& candidates, bool takeOwnership) const {
646  std::unique_ptr<TrackCollection> result = takeOwnership ?std::make_unique<TrackCollection>() : std::make_unique<TrackCollection>(SG::VIEW_ELEMENTS);
647  result->reserve(candidates.size());
648  for (std::unique_ptr<MuPatTrack>& cit : candidates) {
649  auto & thisTrack = cit->track();
650  // if track selector is configured, use it and remove bad tracks
651  if (!m_trackSelector.empty() && !m_trackSelector->decision(thisTrack)) continue;
652 
653  Trk::Track* track{nullptr};
654  if (takeOwnership)
655  track = new Trk::Track(thisTrack);
656  else
657  track = &thisTrack;
658  // add track summary to this track
659  if (m_trackSummaryTool.isEnabled()) { m_trackSummaryTool->computeAndReplaceTrackSummary(*track, false); }
660  result->push_back(track);
661  }
662  return result;
663  }
664 
665  void MuonTrackSteering::refineTracks(const EventContext& ctx, std::vector<std::unique_ptr<MuPatTrack> >& candidates) const {
666  for (std::unique_ptr<MuPatTrack>& cit : candidates) { m_trackRefineTool->refine(ctx, *cit); }
667  }
668 
669  //-----------------------------------------------------------------------------------------------------------
670 
671  void MuonTrackSteering::solveAmbiguities(std::vector<std::unique_ptr<MuPatTrack> >& tracks,
672  const MuonTrackSteeringStrategy* /*strat*/) const {
673  // the resulting vector of tracks to be returned
674  std::unique_ptr<TrackCollection> trkColl(selectTracks(tracks, false));
675  if (!trkColl || trkColl->empty()) { return; }
676 
677  std::unique_ptr<const TrackCollection> resolvedTracks(m_ambiTool->process(trkColl.get()));
678  if (!resolvedTracks) { return; }
679 
680  ATH_MSG_DEBUG(" resolved track candidates: old size " << trkColl->size() << " new size " << resolvedTracks->size());
681 
682  std::vector<std::unique_ptr<MuPatTrack> >::iterator pat = tracks.begin();
683  for (; pat != tracks.end();) {
684  bool found = false;
685  for (const Trk::Track* rtrk : *resolvedTracks) {
686  if (&(*pat)->track() == rtrk) {
687  found = true;
688  break;
689  }
690  }
691  if (!found) {
692  pat = tracks.erase(pat);
693  } else {
694  ++pat;
695  }
696  }
697 
698  }
699 
700  //-----------------------------------------------------------------------------------------------------------
701 
703  for (unsigned int i = 0; i < strategy.size(); ++i) {
704  std::unique_ptr<const MuonTrackSteeringStrategy> holder = decodeStrategy(strategy[i]);
705  if (!holder) {
706  // complain
707  ATH_MSG_DEBUG("failed to decode strategy");
708  } else {
709  // flag whether segments should be combined
711  m_strategies.emplace_back(std::move(holder));
712  }
713  }
714  return StatusCode::SUCCESS;
715  }
716 
717  //-----------------------------------------------------------------------------------------------------------
718 
719  std::unique_ptr<const MuonTrackSteeringStrategy> MuonTrackSteering::decodeStrategy(const std::string& strategy) const {
720  const std::string delims(" \t[],;");
721 
722  // The strategy name
723  std::string name;
724 
725  // The strategy options (which should be a vector of enums, but I'll use strings now to check that I'm
726  // decoding the stragegy correctly)
727  std::vector<std::string> options;
728 
729  // The strategy sequence (which should be a vector of vector of station enumbs, but again I'll use
730  // strings instead of enums to test that I've got the decoding correct)
731  typedef std::vector<std::string> ChamberGroup;
732  std::vector<ChamberGroup> sequence;
733  std::string seqStr;
734 
735  bool success = false;
736  std::unique_ptr<const MuonTrackSteeringStrategy> result;
737 
738  std::string::size_type length = strategy.length();
739 
740  // Extract the strategy name and options
741  std::string::size_type begIdx, endIdx;
742  begIdx = strategy.find_first_not_of(delims);
743  if (std::string::npos != begIdx) {
744  endIdx = strategy.find(':', begIdx);
745  if (std::string::npos != endIdx) {
746  seqStr = strategy.substr(endIdx + 1, length - endIdx - 1);
747  std::string nameopt = strategy.substr(begIdx, endIdx - begIdx);
748  std::string::size_type bi = nameopt.find('[');
749  if (std::string::npos != bi) {
750  name = nameopt.substr(0, bi);
751 
752  // Decode options
753  std::string::size_type ei = nameopt.find(']', bi);
754  if (std::string::npos == ei) { ei = nameopt.length(); }
755  std::string inputOpt = nameopt.substr(bi + 1, ei - bi - 1);
756  success = decodeList(inputOpt, options);
757  } else {
758  name = nameopt;
759  }
760  }
761  }
762  if (msgLvl(MSG::DEBUG)) {
763  ATH_MSG_DEBUG("From strat: " << strategy << " with success " << success << " end " << endIdx << " beg " << begIdx
764  << " Name: " << name << " options: ");
765  for (std::vector<std::string>::iterator oit = options.begin(); oit != options.end(); ++oit)
766  msg(MSG::DEBUG) << " " << *oit << endmsg;
767  }
768  // Name and options successfully decoded, now decode the sequence and groups
769  if (success) {
770  begIdx = endIdx + 1;
771  do {
772  endIdx = strategy.find(';', begIdx);
773  std::string::size_type lstIdx = endIdx;
774  if (std::string::npos == endIdx) { lstIdx = strategy.length(); }
775  std::string grpString = strategy.substr(begIdx, lstIdx - begIdx);
776  ChamberGroup group;
777  success = success && decodeList(grpString, group);
778  sequence.push_back(group);
779  begIdx = lstIdx + 1;
780  } while (std::string::npos != endIdx && success);
781  }
782 
783  if (success) {
784  std::vector<std::vector<MuonStationIndex::ChIndex> > path;
785  for (unsigned int i = 0; i < sequence.size(); ++i) {
786  std::vector<MuonStationIndex::ChIndex> idxGrp;
787  for (unsigned int j = 0; j < sequence[i].size(); ++j) {
790  if (sequence[i][j] != "all" && sequence[i][j] != "ALL" && sequence[i][j] != "All") {
791  // Complain
792  ATH_MSG_WARNING("I am complaining: Bad station index.");
793  } else { // asked for all chambers
794  idxGrp.clear();
796  idxGrp.push_back(MuonStationIndex::ChIndex(all));
797  }
798  } else {
799  idxGrp.push_back(idx);
800  }
801  }
802  path.push_back(idxGrp);
803  }
804  result = std::make_unique<MuonTrackSteeringStrategy>(name, options, path);
805  }
806 
807  return result;
808  }
809 
810  //-----------------------------------------------------------------------------------------------------------
811 
812  bool MuonTrackSteering::decodeList(const std::string& input, std::vector<std::string>& list) {
813  bool result = true;
814  std::string::size_type begIdx = 0;
815  std::string::size_type endIdx = 0;
816  do {
817  endIdx = input.find(',', begIdx);
818  std::string::size_type lstIdx = endIdx;
819  if (std::string::npos == endIdx) { lstIdx = input.length(); }
820  std::string item = input.substr(begIdx, lstIdx - begIdx);
821  list.push_back(item);
822  begIdx = lstIdx + 1;
823  } while (std::string::npos != endIdx);
824  return result;
825  }
826 
827 } // namespace Muon
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
xAOD::strategy
strategy
Definition: L2CombinedMuon_v1.cxx:107
Muon::MuonStationIndex::BIS
@ BIS
Definition: MuonStationIndex.h:17
Muon::MuonTrackSteering::m_segQCut
std::array< int, 3 > m_segQCut
Required segment quality for seed, 2nd, and other segments.
Definition: MuonTrackSteering.h:152
Muon::MuonTrackSteeringStrategy::getName
const std::string getName() const
Definition: MuonTrackSteeringStrategy.h:64
Muon::MuonStationIndex::BE
@ BE
Definition: MuonStationIndex.h:25
Muon::MuonTrackSteering::GarbageContainer::push_back
void push_back(std::unique_ptr< MuonSegment > seg)
Definition: MuonTrackSteering.h:87
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Muon::MuonStationIndex::CSS
@ CSS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::toStationIndex
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Definition: MuonStationIndex.cxx:43
Muon::MuonTrackSteering::SegCol
std::vector< MuPatSegment * > SegCol
Definition: MuonTrackSteering.h:55
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Muon::MuonStationIndex::chIndex
static ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
Definition: MuonStationIndex.cxx:20
get_generator_info.result
result
Definition: get_generator_info.py:21
Muon::MuonTrackSteering::decodeList
static bool decodeList(const std::string &input, std::vector< std::string > &list)
Definition: MuonTrackSteering.cxx:812
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
TrackParameters.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Muon::MuonTrackSteering::refineTracks
void refineTracks(const EventContext &ctx, std::vector< std::unique_ptr< MuPatTrack >> &candidates) const
Definition: MuonTrackSteering.cxx:665
Muon::MuonStationIndex::EEL
@ EEL
Definition: MuonStationIndex.h:18
Muon::MuonTrackSteering::decodeStrategy
std::unique_ptr< const MuonTrackSteeringStrategy > decodeStrategy(const std::string &strategy) const
Definition: MuonTrackSteering.cxx:719
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
drawFromPickle.candidates
candidates
Definition: drawFromPickle.py:271
xAODP4Helpers.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
Muon::MuonStationIndex::BML
@ BML
Definition: MuonStationIndex.h:17
Muon::MuonTrackSteeringStrategy::CutSeedsOnTracks
@ CutSeedsOnTracks
Definition: MuonTrackSteeringStrategy.h:20
Muon::MuonTrackSteeringStrategy::getAll
const std::vector< std::vector< MuonStationIndex::ChIndex > > & getAll() const
Definition: MuonTrackSteeringStrategy.h:60
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
Muon::MuPatSegment::segQuality
const MuonSegmentQuality * segQuality
Definition: MuPatSegment.h:51
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
MuPatCandidateBase.h
Muon::MuonTrackSteering::GarbageContainer::reserve
void reserve(size_t N)
Definition: MuonTrackSteering.h:89
Muon::MuonTrackSteering::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
Definition: MuonTrackSteering.h:132
InDetSecVtxTruthMatchUtils::isMatched
bool isMatched(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:48
Muon::MuonTrackSteering::MuonTrackSteering
MuonTrackSteering(const std::string &, const std::string &, const IInterface *)
default AlgTool constructor
Definition: MuonTrackSteering.cxx:50
Muon::MuonStationIndex::BOS
@ BOS
Definition: MuonStationIndex.h:17
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::MuonStationIndex::BMS
@ BMS
Definition: MuonStationIndex.h:17
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Muon::MuonTrackSteering::m_useTightMatching
bool m_useTightMatching
Definition: MuonTrackSteering.h:156
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuPatSegment::isMdt
bool isMdt
true for MDT, false for CSC
Definition: MuPatSegment.h:61
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
Muon::MuonStationIndex::EIS
@ EIS
Definition: MuonStationIndex.h:18
MuPatSegment.h
MuonTrackMakerStlTools.h
Muon::MuonTrackSteering::m_trackSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trackSummaryTool
Definition: MuonTrackSteering.h:147
Muon::MuonTrackSteering::m_outputSingleStationTracks
bool m_outputSingleStationTracks
Definition: MuonTrackSteering.h:153
Muon::MuonTrackSteeringStrategy::BarrelEndcapFilter
@ BarrelEndcapFilter
Definition: MuonTrackSteeringStrategy.h:27
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Muon::MuonStationIndex::EOS
@ EOS
Definition: MuonStationIndex.h:18
MuonSegmentCombination.h
Muon::MuonTrackSteering::m_combinedSLOverlaps
bool m_combinedSLOverlaps
Definition: MuonTrackSteering.h:154
Muon::MuonTrackSteeringStrategy::DoRefinement
@ DoRefinement
Definition: MuonTrackSteeringStrategy.h:25
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Muon::MuonTrackSteeringStrategy::DoAmbiSolving
@ DoAmbiSolving
Definition: MuonTrackSteeringStrategy.h:26
TileDCSDataPlotter.tit
tit
Definition: TileDCSDataPlotter.py:890
PlotPulseshapeFromCool.can
can
Definition: PlotPulseshapeFromCool.py:91
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:53
Muon::MuonTrackSteering::extendWithLayer
std::vector< std::unique_ptr< MuPatTrack > > extendWithLayer(const EventContext &ctx, MuPatTrack &candidate, const SegColVec &segcol, unsigned int nextlayer, const unsigned int endlayer, int cutLevel=0) const
Definition: MuonTrackSteering.cxx:617
lumiFormat.i
int i
Definition: lumiFormat.py:92
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TrackCollection.h
Muon::MuPatSegment::usedInFit
int usedInFit
Definition: MuPatSegment.h:55
MuPatTrack.h
Muon::MuPatSegment::segment
const MuonSegment * segment
Definition: MuPatSegment.h:52
Muon::MuonTrackSteering::m_trackSelector
ToolHandle< Muon::MuonTrackSelectorTool > m_trackSelector
Definition: MuonTrackSteering.h:143
Muon::MuonTrackSteering::StSet
std::set< MuonStationIndex::StIndex > StSet
Definition: MuonTrackSteering.h:65
Muon::MuonTrackSteering::m_strategies
std::vector< std::unique_ptr< const MuonTrackSteeringStrategy > > m_strategies
Definition: MuonTrackSteering.h:149
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonTrackSteering::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonTrackSteering.h:130
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
Muon::MuonTrackSteering::ChSet
std::set< MuonStationIndex::ChIndex > ChSet
Definition: MuonTrackSteering.h:61
Muon::MuonTrackSteering::SegColVec
std::vector< SegCol > SegColVec
Definition: MuonTrackSteering.h:57
python.AtlRunQueryLib.options
options
Definition: AtlRunQueryLib.py:379
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Muon::MuonTrackSteering::findTracks
std::unique_ptr< TrackCollection > findTracks(const EventContext &ctx, SegColVec &chamberSegments, SegColVec &stationSegments) const
actual find method
Definition: MuonTrackSteering.cxx:312
Muon::MuonTrackSteering::m_segmentFitter
ToolHandle< IMuonSegmentFittingTool > m_segmentFitter
Definition: MuonTrackSteering.h:141
Muon::MuonTrackSteering::GarbageContainer
Definition: MuonTrackSteering.h:86
Muon::MuonTrackSteering::extractSegments
bool extractSegments(const EventContext &ctx, const MuonSegmentCollection &coll, SegColVec &chamberSegments, SegColVec &stationSegments, ChSet &chambersWithSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) const
Definition: MuonTrackSteering.cxx:103
Muon::MuPatHitPtr
std::shared_ptr< MuPatHit > MuPatHitPtr
Definition: MuPatHit.h:25
Muon::MuonTrackSteering::initialize
virtual StatusCode initialize() override
initialize method, method taken from bass-class AlgTool
Definition: MuonTrackSteering.cxx:65
Muon::MuonTrackSteering::m_trackRefineTool
ToolHandle< IMuonTrackRefiner > m_trackRefineTool
Definition: MuonTrackSteering.h:140
Muon::MuonStationIndex::EES
@ EES
Definition: MuonStationIndex.h:18
Muon::MuonTrackSteering::m_muonHoleRecoverTool
ToolHandle< IMuonHoleRecoveryTool > m_muonHoleRecoverTool
Definition: MuonTrackSteering.h:145
Muon::MuonStationIndex::ChUnknown
@ ChUnknown
Definition: MuonStationIndex.h:16
dso-stats.pat
pat
Definition: dso-stats.py:39
Muon::MuonTrackSteering::decodeStrategyVector
StatusCode decodeStrategyVector(const std::vector< std::string > &strategy)
Definition: MuonTrackSteering.cxx:702
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Muon::MuonStationIndex::StIndexMax
@ StIndexMax
Definition: MuonStationIndex.h:27
Muon::MuonTrackSteering::m_mooBTool
ToolHandle< MooTrackBuilder > m_mooBTool
Definition: MuonTrackSteering.h:137
Muon::MuonTrackSteering::m_candidateTool
ToolHandle< MuPatCandidateTool > m_candidateTool
Definition: MuonTrackSteering.h:133
Muon::MuonTrackSteering::selectTracks
std::unique_ptr< TrackCollection > selectTracks(std::vector< std::unique_ptr< MuPatTrack >> &candidates, bool takeOwnership=true) const
Definition: MuonTrackSteering.cxx:645
Muon::MuonTrackSteering::m_candidateMatchingTool
ToolHandle< MooCandidateMatchingTool > m_candidateMatchingTool
Definition: MuonTrackSteering.h:138
item
Definition: ItemListSvc.h:43
Muon::MuonTrackSteeringStrategy
Definition: MuonTrackSteeringStrategy.h:17
Muon::MuonTrackSteering::m_segThreshold
int m_segThreshold
Definition: MuonTrackSteering.h:158
Muon::MuonTrackSteering::solveAmbiguities
void solveAmbiguities(std::vector< std::unique_ptr< MuPatTrack >> &tracks, const MuonTrackSteeringStrategy *strat=nullptr) const
Resolve ambiguities among tracks for a single strategy This allows a strategy-specific ambiguity solv...
Definition: MuonTrackSteering.cxx:671
Muon::MuPatSegment
segment candidate object.
Definition: MuPatSegment.h:43
Muon::MuonStationIndex::ChIndexMax
@ ChIndexMax
Definition: MuonStationIndex.h:19
Muon::MuonStationIndex::EML
@ EML
Definition: MuonStationIndex.h:18
Muon::MuonTrackSteering::m_doSummary
bool m_doSummary
Definition: MuonTrackSteering.h:155
Cut::all
@ all
Definition: SUSYToolsAlg.cxx:64
MuonTrackSteeringStrategy.h
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
Muon::MuonTrackSteering::m_onlyMDTSeeding
bool m_onlyMDTSeeding
Definition: MuonTrackSteering.h:157
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonStationIndex::BIL
@ BIL
Definition: MuonStationIndex.h:17
Muon::MuPatCandidateBase::hitList
const MuPatHitList & hitList() const
returns a reference to the hit list
Definition: MuPatCandidateBase.h:108
Muon::MuonTrackSteeringStrategy::DynamicSeeding
@ DynamicSeeding
Definition: MuonTrackSteeringStrategy.h:22
Muon::MuPatTrack
track candidate object.
Definition: MuPatTrack.h:37
Muon::MuonStationIndex::BEE
@ BEE
Definition: MuonStationIndex.h:17
Muon::MuonTrackSteering::find
std::unique_ptr< TrackCollection > find(const EventContext &ctx, const MuonSegmentCollection &coll) const override
find tracks starting from a MuonSegmentCollection
Definition: MuonTrackSteering.cxx:85
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
Muon::MuonTrackSteering::findTrackFromSeed
std::vector< std::unique_ptr< MuPatTrack > > findTrackFromSeed(const EventContext &ctx, MuPatSegment &seedSeg, const MuonTrackSteeringStrategy &strat, const unsigned int layer, const SegColVec &segs) const
Find tracks starting from a good segment.
Definition: MuonTrackSteering.cxx:539
Muon::MuonTrackSteering::m_stringStrategies
std::vector< std::string > m_stringStrategies
Definition: MuonTrackSteering.h:150
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Muon::MuonTrackSteering::combineOverlapSegments
void combineOverlapSegments(const EventContext &ctx, std::vector< MuPatSegment * > &ch1, std::vector< MuPatSegment * > &ch2, SegColVec &stationSegments, StSet &stationsWithSegments, GarbageContainer &trash_bin) const
Definition: MuonTrackSteering.cxx:161
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
MuonSegment.h
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
Muon::MuonSegment::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
global position
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:157
Muon::MuonSegmentCollection
std::vector< const Muon::MuonSegment * > MuonSegmentCollection
Definition: MuonTrackSteering.h:44
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Muon::MuonTrackSteeringStrategy::CombineSegInStation
@ CombineSegInStation
Definition: MuonTrackSteeringStrategy.h:21
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
AthAlgTool
Definition: AthAlgTool.h:26
Muon::MuonStationIndex::EMS
@ EMS
Definition: MuonStationIndex.h:18
Muon::MuonStationIndex::EOL
@ EOL
Definition: MuonStationIndex.h:18
Muon::SortSegInfoByQuality
Definition: MuPatSegment.h:97
MuonTrackSteering.h
Muon::MuonTrackSteering::m_trackBTool
ToolHandle< IMuonTrackBuilder > m_trackBTool
Definition: MuonTrackSteering.h:134
Muon::IMuonSegmentTrackBuilder::PrepVec
std::vector< const Trk::PrepRawData * > PrepVec
Definition: IMuonSegmentTrackBuilder.h:26
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
Muon::MuonStationIndex::BOL
@ BOL
Definition: MuonStationIndex.h:17
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
Muon::MuonSegmentQuality::isStrict
bool isStrict() const
Returns true if the segment was created using strict criteria.
Definition: MuonSegmentQuality.h:82
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Muon::MuonStationIndex::EM
@ EM
Definition: MuonStationIndex.h:26
SegmentCollection.h
Muon::MuonTrackSteering::m_ambiTool
ToolHandle< Trk::ITrackAmbiguityProcessorTool > m_ambiTool
Definition: MuonTrackSteering.h:135
Muon::MuonStationIndex::CSL
@ CSL
Definition: MuonStationIndex.h:18
Muon::MuPatSegment::quality
int quality
Definition: MuPatSegment.h:50
NSWL1::PadTriggerAdapter::segment
Muon::NSW_PadTriggerSegment segment(const NSWL1::PadTrigger &data)
Definition: PadTriggerAdapter.cxx:5
Muon::MuonStationIndex::EIL
@ EIL
Definition: MuonStationIndex.h:18