ATLAS Offline Software
Public Member Functions | List of all members
TrkDriftCircleMath::SortSegByNumberOfMDTHitsAndChi2 Struct Reference

#include <SortSegBySizeAndChi2.h>

Collaboration diagram for TrkDriftCircleMath::SortSegByNumberOfMDTHitsAndChi2:

Public Member Functions

bool operator() (const Segment &seg1, const Segment &seg2)
 

Detailed Description

Definition at line 12 of file SortSegBySizeAndChi2.h.

Member Function Documentation

◆ operator()()

bool TrkDriftCircleMath::SortSegByNumberOfMDTHitsAndChi2::operator() ( const Segment seg1,
const Segment seg2 
)
inline

Definition at line 13 of file SortSegBySizeAndChi2.h.

13  {
14  // prefer segment with T0 fit
15  if (seg1.hasT0Shift() && !seg2.hasT0Shift())
16  return true;
17  else if (!seg1.hasT0Shift() && seg2.hasT0Shift())
18  return false;
19 
20  // sort by numbers of hits on track
21  if (seg1.hitsOnTrack() > seg2.hitsOnTrack())
22  return true;
23  else if (seg1.hitsOnTrack() < seg2.hitsOnTrack())
24  return false;
25 
26  // take the one with less empty crossed tubes
27  if (seg1.emptyTubes().size() < seg2.emptyTubes().size())
28  return true;
29  else if (seg1.emptyTubes().size() > seg2.emptyTubes().size())
30  return false;
31 
32  // take one with associated clusters
33  if (seg1.clusterLayers() > 0 && seg2.clusterLayers() == 0) return true;
34  if (seg1.clusterLayers() == 0 && seg2.clusterLayers() > 0) return false;
35 
36  // if equal sort by number of deltas
37  if (seg1.deltas() < seg2.deltas())
38  return true;
39  else if (seg1.deltas() > seg2.deltas())
40  return false;
41 
42  // finally take the one with best chi2
43  return seg1.chi2() < seg2.chi2();
44  }

The documentation for this struct was generated from the following file: