ATLAS Offline Software
MuonSegmentCombinationCleanerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include <algorithm>
8 #include <iostream>
9 #include <sstream>
10 #include <vector>
11 
19 
20 namespace Muon {
21 
22  MuonSegmentCombinationCleanerTool::MuonSegmentCombinationCleanerTool(const std::string& t, const std::string& n, const IInterface* p) :
23  AthAlgTool(t, n, p) {
24  declareInterface<IMuonSegmentCombinationCleanerTool>(this);
25  }
26 
28  ATH_MSG_VERBOSE(" MuonSegmentCombinationCleanerTool::Initializing ");
29  ATH_CHECK(m_printer.retrieve());
30  ATH_CHECK(m_edmHelperSvc.retrieve());
31  ATH_CHECK(m_idHelperSvc.retrieve());
32  ATH_CHECK(m_overlapRemovalTool.retrieve());
33  ATH_MSG_VERBOSE("End of Initializing");
34  return StatusCode::SUCCESS;
35  }
36 
37  std::unique_ptr<MuonSegmentCombinationCollection> MuonSegmentCombinationCleanerTool::clean(
39  std::unique_ptr<MuonSegmentCombinationCollection> combiCleanCol = std::make_unique<MuonSegmentCombinationCollection>();
40 
41  cleanAndMergeCombis(combiCol, combiCleanCol, segPattMap);
42 
43  return combiCleanCol;
44  }
45 
47  std::unique_ptr<MuonSegmentCombinationCollection>& combiCleanCol,
48  MuonSegmentCombPatternCombAssociationMap* segPattMap) const {
49  ATH_MSG_DEBUG(" cleaning combis " << combiCol.size());
50 
51  std::vector<MuonSegmentCombiSummary> summaries;
52 
53  for (const Muon::MuonSegmentCombination* combi : combiCol) {
54  if (!combi) {
55  ATH_MSG_INFO(" empty MuonSegmentCombination!!! ");
56  continue;
57  }
58 
62 
63  if (summary.stations.size() < 2) {
64  // keep combination if Endcap middle
65  if (summary.stations.count(MuonStationIndex::EM)) {
66  ATH_MSG_VERBOSE(" Keeping single station endcap middle MuonSegmentCombination ");
67 
68  } else {
69  ATH_MSG_DEBUG(" MuonSegmentCombination has too few station layers, rejecting ");
70  continue;
71  }
72  }
73 
74  if (summary.stationsGood.empty()) {
75  ATH_MSG_DEBUG(" MuonSegmentCombination has no station layer with good segment, rejecting ");
76  continue;
77  }
78 
79  if (!subSetOfPrevious(summary, summaries)) { summaries.emplace_back(std::move(summary)); }
80  }
81 
82  for (MuonSegmentCombiSummary& summary : summaries) {
83  // check whether there is an original, if so pass the pointer else clone the combi as it comes from the input
84  // collection
85 
86  std::unique_ptr<MuonSegmentCombination> finalCombi = m_overlapRemovalTool->removeDuplicates(summary.segmentCombination());
87 
89  if (!finalCombi) {
90  if (summary.has_ownership()) {
91  finalCombi = summary.release();
92  } else {
93  finalCombi = std::make_unique<MuonSegmentCombination>(*summary.get());
94  }
95  }
96 
97  const MuonSegmentCombination* originalCombi = summary.get();
98 
99  // lookup the patterncombi and add association
100  unsigned int count = segPattMap->count(originalCombi);
101  if (count != 1) {
102  ATH_MSG_INFO(" This list should only have one entry!! ");
103  } else {
104  std::pair<MuonSegmentCombPatternCombAssociationMap::const_iterator,
105  MuonSegmentCombPatternCombAssociationMap::const_iterator>
106  range = segPattMap->equal_range(originalCombi);
107  const Muon::MuonPatternCombination* pat = (range.first)->second;
108  if (pat)
109  segPattMap->insert(std::make_pair(finalCombi.get(), pat));
110  else
111  ATH_MSG_INFO(" The pattern pointer should never be zero!!!! ");
112  }
113 
114  combiCleanCol->push_back(std::move(finalCombi));
115  }
116  }
117 
119  std::vector<MuonSegmentCombiSummary>& summaries) const {
120  if (summaries.empty()) return false;
121 
122  ATH_MSG_DEBUG(" comparing combi with aleady handled ones ");
123  bool hasOverlap = false;
124 
125  for (MuonSegmentCombiSummary& existing : summaries) {
127 
128  // simplest case: no subsets
129  if (overlap.subsetFirst.empty() && overlap.subsetSecond.empty()) {
130  // no overlap
131  if (overlap.shared.empty()) {
132  if (!m_mergeAllCombis) continue;
133  }
134  // complete overlap, keep previous
135  if (overlap.uniqueFirst.empty() && overlap.uniqueSecond.empty()) {
136  ATH_MSG_VERBOSE(" -> complete overlap, keeping first ");
137  hasOverlap = true;
138  break;
139  }
140  }
141 
142  // second simple case, no unique segments in first and no subsets in second combi
143  if (overlap.uniqueFirst.empty() && overlap.subsetSecond.empty()) {
144  ATH_MSG_VERBOSE(" -> keeping selected combi ");
145  hasOverlap = true;
146  break;
147  } else if (overlap.uniqueSecond.empty() && overlap.subsetFirst.empty()) {
148  ATH_MSG_VERBOSE(" -> replacing selected combi ");
149  existing = std::move(summary);
150  hasOverlap = true;
151  break;
152  }
153 
154  // large overlap
155 
156  unsigned int overlappingSegments1 = overlap.subsetFirst.size() + overlap.shared.size();
157  unsigned int overlappingSegments2 = overlap.subsetSecond.size() + overlap.shared.size();
158 
159  unsigned int uniqueSegments1 = overlap.uniqueFirst.size();
160  unsigned int uniqueSegments2 = overlap.uniqueSecond.size();
161  if (overlappingSegments1 > uniqueSegments1 || overlappingSegments2 > uniqueSegments2 || m_mergeAllCombis) {
162  ATH_MSG_VERBOSE(" -> large overlap, merge candidate ");
163 
164  // set to make sure we are not adding segments twice
165  std::set<MuonSegment*> addedSegments;
166  std::vector<std::vector<MuonSegment*> > segmentsPerChamberLayer{MuonStationIndex::ChIndexMax};
167 
168  // first add shared segments, take one with best chi2
169  for (std::pair<MuonSegment*, MuonSegment*>& sh_iter : overlap.shared) {
170  // select segment with best chi2
171  const Trk::FitQuality* fq1 = sh_iter.first->fitQuality();
172  const Trk::FitQuality* fq2 = sh_iter.second->fitQuality();
173  double chi2First = fq1 ? fq1->chiSquared() : 1e10;
174  double chi2Second = fq2 ? fq2->chiSquared() : 1e10;
175  MuonSegment* bestSegment = chi2First < chi2Second ? sh_iter.first : sh_iter.second;
176 
177  // check whether already added
178  if (addedSegments.count(bestSegment)) continue;
179  addedSegments.insert(bestSegment);
180  Identifier chId = m_edmHelperSvc->chamberId(*bestSegment);
181  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
182  segmentsPerChamberLayer[chIndex].push_back(bestSegment);
183  }
184 
185  for (MuonSegment* bestSegment : overlap.uniqueFirst) {
186  // check whether already added
187  if (addedSegments.count(bestSegment)) continue;
188  addedSegments.insert(bestSegment);
189  Identifier chId = m_edmHelperSvc->chamberId(*bestSegment);
190  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
191  segmentsPerChamberLayer[chIndex].push_back(bestSegment);
192  }
193 
194  for (MuonSegment* bestSegment : overlap.uniqueSecond) {
195  // check whether already added
196  if (addedSegments.count(bestSegment)) continue;
197  addedSegments.insert(bestSegment);
198  Identifier chId = m_edmHelperSvc->chamberId(*bestSegment);
199  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
200  segmentsPerChamberLayer[chIndex].push_back(bestSegment);
201  }
202 
203  for (std::pair<MuonSegment*, MuonSegment*>& sh_iter : overlap.subsetFirst) {
204  // check whether already added
205  MuonSegment* bestSegment = sh_iter.second;
206 
207  // check whether already added
208  if (addedSegments.count(bestSegment)) continue;
209  addedSegments.insert(bestSegment);
210  Identifier chId = m_edmHelperSvc->chamberId(*bestSegment);
211  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
212  segmentsPerChamberLayer[chIndex].push_back(bestSegment);
213  }
214 
215  for (const std::pair<MuonSegment*, MuonSegment*>& sh_iter : overlap.subsetSecond) {
216  // check whether already added
217  MuonSegment* bestSegment = sh_iter.first;
218  // check whether already added
219  if (addedSegments.count(bestSegment)) continue;
220  addedSegments.insert(bestSegment);
221  Identifier chId = m_edmHelperSvc->chamberId(*bestSegment);
222  MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chId);
223  segmentsPerChamberLayer[chIndex].push_back(bestSegment);
224  }
225 
226  // now create new combi
227  std::unique_ptr<MuonSegmentCombination> newCombi = std::make_unique<MuonSegmentCombination>();
228 
229  // loop over layers and add segments
230  for (const std::vector<MuonSegment*>& chamber_hits : segmentsPerChamberLayer) {
231  // skip empty ones
232  if (chamber_hits.empty()) continue;
233 
234  std::unique_ptr<MuonSegmentCombination::SegmentVec> segVec = std::make_unique<MuonSegmentCombination::SegmentVec>();
235  segVec->reserve(chamber_hits.size());
236  for (MuonSegment* seg : chamber_hits) segVec->emplace_back(seg->clone());
237  newCombi->addSegments(std::move(segVec));
238  }
239 
240  // create new summary
241  MuonSegmentCombiSummary newSummary{std::move(newCombi)};
242  fillSummary(newSummary);
243 
244  ATH_MSG_VERBOSE(" -> merged combis ");
245  existing = std::move(newSummary);
246  hasOverlap = true;
247  break;
248  }
249  }
250 
251  return hasOverlap;
252  }
253 
255  MuonSegmentCombiSummary& summary2) const {
256  ATH_MSG_DEBUG(" calculating overlap, size first " << summary1.nsegments << " size second " << summary2.nsegments);
257 
259 
260  // loop over all chamber layers and compare per layer
261  for (unsigned int i = 0; i < MuonStationIndex::ChIndexMax; ++i) {
262  // get segment in chamber layer
263  MuonSegmentCombiSummary::SegVec& chamberVec1 = summary1.chamberSegments(i);
264  MuonSegmentCombiSummary::SegVec& chamberVec2 = summary2.chamberSegments(i);
265 
266  // if both no segments do nothing
267  if (chamberVec1.empty() && chamberVec2.empty()) continue;
268 
269  // if both not empty compare the two, exception for CSCs
270  if (!chamberVec1.empty() && !chamberVec2.empty()) {
271  ATH_MSG_DEBUG(" resolving chambe layer " << MuonStationIndex::chName((MuonStationIndex::ChIndex)i));
272 
273  resolveLayerOverlap(chamberVec1, chamberVec2, summary);
274 
275  } else {
276  if (!chamberVec1.empty()) summary.uniqueFirst.insert(summary.uniqueFirst.begin(), chamberVec1.begin(), chamberVec1.end());
277  if (!chamberVec2.empty()) summary.uniqueSecond.insert(summary.uniqueSecond.begin(), chamberVec2.begin(), chamberVec2.end());
278  }
279  }
281  return summary;
282  }
283 
284  void MuonSegmentCombinationCleanerTool::resolveLayerOverlap(const std::vector<MuonSegment*>& chamberVec1,
285  const std::vector<MuonSegment*>& chamberVec2,
287  CompareMuonSegmentKeys compareKeys{};
288 
289  std::vector<int> uniqueFirst(chamberVec1.size(), 1);
290  std::vector<int> uniqueSecond(chamberVec2.size(), 1);
291 
292  unsigned int index1 = 0;
293  for (MuonSegment* seg_chamb1 : chamberVec1) {
294  // identifier(s) of MDT chambers on segment
295  std::set<Identifier> chIds1 = m_edmHelperSvc->chamberIds(*seg_chamb1);
296  MuonSegmentKey key1(*seg_chamb1);
297 
298  unsigned int index2 = 0;
299  for (MuonSegment* seg_chamb2 : chamberVec2) {
300  if (!uniqueSecond[index2]) {
301  ++index2;
302  continue;
303  }
304 
305  // identifier(s) of MDT chambers on segment
306  std::set<Identifier> chIds2 = m_edmHelperSvc->chamberIds(*seg_chamb2);
307 
308  // check whether chamber identifiers overlap
309  bool hasOverlap = std::find_if(chIds2.begin(), chIds2.end(),
310  [&chIds1](const Identifier& id) { return chIds1.count(id) > 0; }) != chIds2.end();
311  // if no chamber identifier overlap continue with next segment
312  if (!hasOverlap) {
313  ++index2;
314  continue;
315  }
316  // compare the hits on the two segments
317 
318  MuonSegmentKey key2(*seg_chamb2);
319  CompareMuonSegmentKeys::OverlapResult overlapResult = compareKeys(key1, key2);
320  ATH_MSG_VERBOSE(" overlap Result: " << compareKeys.print(overlapResult));
321 
322  if (overlapResult == CompareMuonSegmentKeys::Identical) {
323  summary.shared.emplace_back(seg_chamb1, seg_chamb2);
324  uniqueFirst[index1] = 0;
325  uniqueSecond[index2] = 0;
326  } else if (overlapResult == CompareMuonSegmentKeys::SuperSet) {
327  summary.subsetSecond.emplace_back(seg_chamb1, seg_chamb2);
328  uniqueFirst[index1] = 0;
329  uniqueSecond[index2] = 0;
330  } else if (overlapResult == CompareMuonSegmentKeys::SubSet) {
331  summary.subsetFirst.emplace_back(seg_chamb1, seg_chamb2);
332  uniqueFirst[index1] = 0;
333  uniqueSecond[index2] = 0;
334  } else if (overlapResult == CompareMuonSegmentKeys::PartialOverlap) {
335  // keep partial overlaps for now....
336 
337  // in case of full overlap in the MDTs
338  if (compareKeys.intersectionSize == compareKeys.segment1Size &&
339  compareKeys.intersectionSize == compareKeys.segment2Size) {
340  // mark as same if more than 75% overlap in trigger hits
341  double intersectFrac1 = compareKeys.intersectionSizeTrigger == 0
342  ? 0.
343  : compareKeys.intersectionSizeTrigger / (double)compareKeys.segment1SizeTrigger;
344  double intersectFrac2 = compareKeys.intersectionSizeTrigger == 0
345  ? 0.
346  : compareKeys.intersectionSizeTrigger / (double)compareKeys.segment2SizeTrigger;
347  double openingAngle = seg_chamb1->globalDirection().dot(seg_chamb2->globalDirection());
348  ATH_MSG_VERBOSE(" Partial overlap: (" << intersectFrac1 << "," << intersectFrac2 << "), opening angle "
349  << openingAngle);
350  if (intersectFrac1 > 0.75 && intersectFrac2 > 0.75 && openingAngle > 0.99) {
351  summary.shared.emplace_back(seg_chamb1, seg_chamb2);
352  uniqueFirst[index1] = 0;
353  uniqueSecond[index2] = 0;
354  }
355  }
356 
357  } else if (overlapResult == CompareMuonSegmentKeys::NoOverlap) {
358  } else if (overlapResult == CompareMuonSegmentKeys::Unknown) {
359  ATH_MSG_WARNING(" Got invalid return argument comparing segments: " << compareKeys.print(overlapResult));
360  }
361  }
362  ++index1;
363  }
364 
365  // add unique segments
366  index1 = 0;
367  for (MuonSegment* seg_chamb1 : chamberVec1) {
368  if (uniqueFirst[index1]) summary.uniqueFirst.push_back(seg_chamb1);
369  ++index1;
370  }
371 
372  unsigned int index2 = 0;
373  for (MuonSegment* seg_chamb2 : chamberVec2) {
374  if (uniqueSecond[index2]) summary.uniqueSecond.push_back(seg_chamb2);
375  ++index2;
376  }
377  }
378 
380  const MuonSegmentCombination& combi = summary.segmentCombination();
381  unsigned int nstations = combi.numberOfStations();
382 
383  // loop over segments, add them to the chamber layers
384  // loop over chambers in combi and extract segments
385  for (unsigned int i = 0; i < nstations; ++i) {
386  // loop over segments in station
387  const MuonSegmentCombination::SegmentVec* stationSegs = combi.stationSegments(i);
388 
389  // check if not empty
390  if (!stationSegs || stationSegs->empty()) continue;
391 
392  // get chamber identifier, chamber index and station index
393  const Identifier chid = m_edmHelperSvc->chamberId(*stationSegs->front());
394  const MuonStationIndex::ChIndex chIndex = m_idHelperSvc->chamberIndex(chid);
396 
397  summary.stations.insert(stIndex);
398 
399  // reserve space for the new segments
400  MuonSegmentCombiSummary::SegVec& chamberVec = summary.chamberSegments(chIndex);
401  chamberVec.reserve(chamberVec.size() + stationSegs->size());
402 
403  summary.nsegments += stationSegs->size();
404  for (const std::unique_ptr<MuonSegment>& seg : *stationSegs) {
405  if (seg->numberOfContainedROTs() > 3) { summary.stationsGood.insert(stIndex); }
406  chamberVec.push_back(seg.get());
407  }
408  }
409  }
410 
411  std::unique_ptr<MuonSegmentCombination> MuonSegmentCombinationCleanerTool::removeDuplicateSegments(
412  MuonSegmentCombination& combi) const {
413  CompareMuonSegmentKeys compareKeys{};
414 
415  // store pointers to segments that should be kept
416  std::set<MuonSegment*> segmentsToBeKept;
417  unsigned int nsegments = 0; // total number of segments
418 
419  unsigned int nstations = combi.numberOfStations();
420 
421  // loop over segments, add them to the chamber layers
422  // loop over chambers in combi and extract segments
423  for (unsigned int i = 0; i < nstations; ++i) {
424  // loop over segments in station
426  // check if not empty
427  if (!stationSegs || stationSegs->empty()) continue;
428  nsegments += stationSegs->size();
429 
430  std::vector<std::pair<MuonSegmentKey, MuonSegment*> > keys;
431  keys.reserve(stationSegs->size());
432 
433  for (const std::unique_ptr<MuonSegment>& seg : *stationSegs) {
434  ATH_MSG_VERBOSE(" segment " << m_printer->print(*seg) << std::endl << m_printer->print(seg->containedMeasurements()));
435  // create key
436  MuonSegmentKey key{*seg};
437 
438  // loop over already added keys
439  bool addSegment = true;
440  for (std::pair<MuonSegmentKey, MuonSegment*>& key_pair : keys) {
441  CompareMuonSegmentKeys::OverlapResult overlapResult = compareKeys(key, key_pair.first);
442  ATH_MSG_VERBOSE(" overlap Result: " << compareKeys.print(overlapResult));
443 
444  if (overlapResult == CompareMuonSegmentKeys::Identical || overlapResult == CompareMuonSegmentKeys::SubSet) {
445  addSegment = false;
446  break;
447  } else if (overlapResult == CompareMuonSegmentKeys::SuperSet) {
448  key_pair.first = key;
449  key_pair.second = seg.get();
450  addSegment = false;
451  break;
452  } else if (overlapResult == CompareMuonSegmentKeys::Unknown) {
453  ATH_MSG_WARNING(" Got invalid return argument comparing segments: " << compareKeys.print(overlapResult));
454  }
455  }
456  if (addSegment) keys.emplace_back(std::move(key), seg.get());
457  }
458  for (const std::pair<MuonSegmentKey, MuonSegment*>& key_pair : keys) segmentsToBeKept.insert(key_pair.second);
459  }
460 
461  // check whether all segments were kept
462  if (nsegments == segmentsToBeKept.size()) {
463  ATH_MSG_DEBUG(" no segments removed ");
464  return nullptr;
465  }
466 
467  std::unique_ptr<MuonSegmentCombination> newCombi = std::make_unique<MuonSegmentCombination>();
468 
469  // create a new combination removing segments that overlap
470  for (unsigned int i = 0; i < nstations; ++i) {
471  // loop over segments in station
473 
474  // check if not empty
475  if (!stationSegs || stationSegs->empty()) continue;
476 
477  std::unique_ptr<MuonSegmentCombination::SegmentVec> segVec = std::make_unique<MuonSegmentCombination::SegmentVec>();
478  segVec->reserve(stationSegs->size());
479 
480  for (std::unique_ptr<MuonSegment>& seg : *stationSegs) {
481  if (!segmentsToBeKept.count(seg.get())) {
482  ATH_MSG_VERBOSE(" dropping segment " << m_printer->print(*seg));
483  continue;
484  } else
485  ATH_MSG_VERBOSE(" adding segment " << m_printer->print(*seg));
486  segVec->push_back(std::move(seg));
487  }
488  newCombi->addSegments(std::move(segVec));
489  }
490 
491  return newCombi;
492  }
493 
495  std::ostringstream sout;
496 
497  // loop over chamber layers
498  int index = 0;
499  MuonSegmentCombiSummary::ChSegVec& segmentsPerLayer = summary.segmentsPerLayer();
500 
501  sout << "SegmentCombi " << std::endl;
502 
503  for (MuonSegmentCombiSummary::SegVec& chiit : segmentsPerLayer) {
504  // skip empty layers
505  if (chiit.empty()) continue;
506 
507  sout << " Chamber Layer: " << MuonStationIndex::chName((MuonStationIndex::ChIndex)index) << " with " << chiit.size()
508  << " segments " << std::endl;
509 
510  for (MuonSegment* seg : chiit) sout << m_printer->print(*seg) << std::endl;
511 
512  ++index;
513  }
514 
515  return sout.str();
516  }
517 
519  std::ostringstream sout;
520 
521  sout << "SegmentCombi overlap " << std::endl
522  << " shared: " << summary.shared.size() << std::endl
523  << " uniqueFirst: " << summary.uniqueFirst.size() << std::endl
524  << " uniqueSecond: " << summary.uniqueSecond.size() << std::endl
525  << " subsetFirst: " << summary.subsetFirst.size() << std::endl
526  << " subsetSecond: " << summary.subsetSecond.size() << std::endl;
527  return sout.str();
528  }
529 
530 } // namespace Muon
Muon::MuonSegmentCombinationCleanerTool::removeDuplicateSegments
std::unique_ptr< MuonSegmentCombination > removeDuplicateSegments(MuonSegmentCombination &combi) const
remove duplicates from a segment combination, returns a nullptr
Definition: MuonSegmentCombinationCleanerTool.cxx:411
Muon::MuonSegmentCombinationCleanerTool::initialize
virtual StatusCode initialize() override
initializes private members
Definition: MuonSegmentCombinationCleanerTool.cxx:27
Muon::MuonStationIndex::chName
static const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition: MuonStationIndex.cxx:157
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Muon::MuonStationIndex::toStationIndex
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Definition: MuonStationIndex.cxx:43
Muon::MuonSegmentCombination
Definition: MuonSegmentCombination.h:30
Muon::MuonSegmentCombiSummary::nsegments
unsigned int nsegments
Definition: MuonSegmentCombiSummary.h:55
Muon::CompareMuonSegmentKeys::PartialOverlap
@ PartialOverlap
Definition: CompareMuonSegmentKeys.h:20
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Muon::MuonSegmentCombiSummary::chamberSegments
SegVec & chamberSegments(unsigned int chIndex)
Definition: MuonSegmentCombiSummary.cxx:19
Muon::MuonSegmentCombiOverlapSummary
Definition: MuonSegmentCombiOverlapSummary.h:14
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Muon::MuonSegmentCombinationCleanerTool::m_overlapRemovalTool
ToolHandle< IMuonSegmentOverlapRemovalTool > m_overlapRemovalTool
Definition: MuonSegmentCombinationCleanerTool.h:74
Muon::CompareMuonSegmentKeys::SubSet
@ SubSet
Definition: CompareMuonSegmentKeys.h:18
Muon::MuonSegmentCombinationCleanerTool::cleanAndMergeCombis
void cleanAndMergeCombis(const MuonSegmentCombinationCollection &combiCol, std::unique_ptr< MuonSegmentCombinationCollection > &combiCleanCol, MuonSegmentCombPatternCombAssociationMap *segPattMap) const
remove overlaps between combination and merge combinations with large overlap
Definition: MuonSegmentCombinationCleanerTool.cxx:46
index
Definition: index.py:1
Muon::MuonSegmentCombinationCleanerTool::m_mergeAllCombis
Gaudi::Property< bool > m_mergeAllCombis
If set to true, all combinaties will be merged into one big one.
Definition: MuonSegmentCombinationCleanerTool.h:94
Muon::MuonSegmentCombiSummary::SegVec
std::vector< MuonSegment * > SegVec
Definition: MuonSegmentCombiSummary.h:22
Muon::MuonSegmentCombiOverlapSummary::shared
std::vector< std::pair< MuonSegment *, MuonSegment * > > shared
segments shared between combies
Definition: MuonSegmentCombiOverlapSummary.h:16
Muon::MuonSegmentCombination::stationSegments
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
Definition: MuonSegmentCombination.h:114
Muon::MuonSegmentKey
Class to cache the identifiers on a segment in sets that can later be used to perform an overlap remo...
Definition: MuonSegmentKey.h:24
Muon::MuonSegmentCombinationCleanerTool::resolveLayerOverlap
void resolveLayerOverlap(const std::vector< MuonSegment * > &chamberVec1, const std::vector< MuonSegment * > &chamberVec2, MuonSegmentCombiOverlapSummary &summary) const
Definition: MuonSegmentCombinationCleanerTool.cxx:284
Muon::MuonSegmentCombiOverlapSummary::uniqueFirst
std::vector< MuonSegment * > uniqueFirst
segments that are only part of the first combi
Definition: MuonSegmentCombiOverlapSummary.h:17
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonSegmentCombinationCleanerTool.h
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::MuonSegmentCombinationCleanerTool::fillSummary
void fillSummary(MuonSegmentCombiSummary &combi) const
create summary
Definition: MuonSegmentCombinationCleanerTool.cxx:379
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
Muon::MuonSegmentCombinationCleanerTool::subSetOfPrevious
bool subSetOfPrevious(MuonSegmentCombiSummary &summary, std::vector< MuonSegmentCombiSummary > &summaries) const
check whether current summary is a subset of the previous once
Definition: MuonSegmentCombinationCleanerTool.cxx:118
module_driven_slicing.key2
key2
Definition: module_driven_slicing.py:159
MuonSegmentCombination.h
Muon::MuonSegmentCombiOverlapSummary::subsetFirst
std::vector< std::pair< MuonSegment *, MuonSegment * > > subsetFirst
segments that are in both combis, but the one in the first is a subset of the second
Definition: MuonSegmentCombiOverlapSummary.h:21
Muon::CompareMuonSegmentKeys::OverlapResult
OverlapResult
enum for the overlap result
Definition: CompareMuonSegmentKeys.h:16
Muon::MuonSegmentCombPatternCombAssociationMap
std::multimap< const MuonSegmentCombination *, const MuonPatternCombination * > MuonSegmentCombPatternCombAssociationMap
Definition: MuonSegmentCombPatternCombAssociationMap.h:12
Muon::CompareMuonSegmentKeys::Identical
@ Identical
Definition: CompareMuonSegmentKeys.h:17
Trk::index1
@ index1
Definition: BoundarySurfaceFace.h:48
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
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
MuonSegmentCombinationCollection.h
MuonPatternCombination.h
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonSegmentCombinationCleanerTool::MuonSegmentCombinationCleanerTool
MuonSegmentCombinationCleanerTool(const std::string &, const std::string &, const IInterface *)
constructor
Definition: MuonSegmentCombinationCleanerTool.cxx:22
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
DataVector< Muon::MuonSegmentCombination >
Muon::MuonSegmentCombiSummary
Definition: MuonSegmentCombiSummary.h:19
Muon::MuonSegmentCombiOverlapSummary::subsetSecond
std::vector< std::pair< MuonSegment *, MuonSegment * > > subsetSecond
segments that are in both combis, but the second in the first is a subset of the first
Definition: MuonSegmentCombiOverlapSummary.h:24
Muon::MuonSegmentCombinationCleanerTool::m_printer
ToolHandle< Muon::MuonEDMPrinterTool > m_printer
Definition: MuonSegmentCombinationCleanerTool.h:69
dso-stats.pat
pat
Definition: dso-stats.py:39
Muon::CompareMuonSegmentKeys::Unknown
@ Unknown
Definition: CompareMuonSegmentKeys.h:22
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Muon::MuonSegmentCombinationCleanerTool::print
std::string print(MuonSegmentCombiSummary &summary) const
print summaries
Definition: MuonSegmentCombinationCleanerTool.cxx:494
Muon::MuonSegmentCombinationCleanerTool::m_edmHelperSvc
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
Definition: MuonSegmentCombinationCleanerTool.h:81
Muon::MuonStationIndex::ChIndexMax
@ ChIndexMax
Definition: MuonStationIndex.h:19
DeMoScan.index
string index
Definition: DeMoScan.py:362
Muon::MuonSegmentCombinationCleanerTool::clean
std::unique_ptr< MuonSegmentCombinationCollection > clean(const MuonSegmentCombinationCollection &combiCol, MuonSegmentCombPatternCombAssociationMap *segPattMap) const override
clean segment combination collections
Definition: MuonSegmentCombinationCleanerTool.cxx:37
Muon::CompareMuonSegmentKeys::NoOverlap
@ NoOverlap
Definition: CompareMuonSegmentKeys.h:21
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Muon::MuonSegmentCombination::SegmentVec
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
Definition: MuonSegmentCombination.h:32
Muon::MuonSegmentCombinationCleanerTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonSegmentCombinationCleanerTool.h:87
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition: MuonStationIndex.h:15
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
MuonSegment.h
Muon::MuonSegmentCombinationCleanerTool::calculateOverlap
MuonSegmentCombiOverlapSummary calculateOverlap(MuonSegmentCombiSummary &summary1, MuonSegmentCombiSummary &summary2) const
calculate overlap between two summaries
Definition: MuonSegmentCombinationCleanerTool.cxx:254
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition: MuonStationIndex.h:23
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
AthAlgTool
Definition: AthAlgTool.h:26
Muon::CompareMuonSegmentKeys::SuperSet
@ SuperSet
Definition: CompareMuonSegmentKeys.h:19
Muon::MuonPatternCombination
The MuonPatternCombination class provides the means to store the output of the initial global pattern...
Definition: MuonPatternCombination.h:29
FitQuality.h
Muon::MuonSegmentCombination::numberOfStations
unsigned int numberOfStations() const
Number of stations with segment.
Definition: MuonSegmentCombination.h:108
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Muon::MuonSegmentCombiOverlapSummary::uniqueSecond
std::vector< MuonSegment * > uniqueSecond
segments that are only part of the second combi
Definition: MuonSegmentCombiOverlapSummary.h:18
CompareMuonSegmentKeys.h
Muon::CompareMuonSegmentKeys
Definition: CompareMuonSegmentKeys.h:14
Muon::MuonStationIndex::EM
@ EM
Definition: MuonStationIndex.h:26
MuonSegmentKey.h
Muon::MuonSegmentCombiSummary::ChSegVec
std::vector< SegVec > ChSegVec
Definition: MuonSegmentCombiSummary.h:25
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
module_driven_slicing.key1
key1
Definition: module_driven_slicing.py:158
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65