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

#include <SortSegBySizeAndChi2.h>

Collaboration diagram for TrkDriftCircleMath::SortSegByNumberOfHitsAndChi2:

Public Member Functions

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

Detailed Description

Definition at line 47 of file SortSegBySizeAndChi2.h.

Member Function Documentation

◆ operator()()

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

Definition at line 48 of file SortSegBySizeAndChi2.h.

48  {
49  // prefer segment with T0 fit
50  if (seg1.hasT0Shift() && !seg2.hasT0Shift())
51  return true;
52  else if (!seg1.hasT0Shift() && seg2.hasT0Shift())
53  return false;
54 
55  unsigned int nhits1 = seg1.hitsOnTrack() + seg1.clusterLayers();
56  unsigned int nhits2 = seg2.hitsOnTrack() + seg2.clusterLayers();
57 
58  // sort by numbers of hits on track
59  if (nhits1 > nhits2)
60  return true;
61  else if (nhits1 < nhits2)
62  return false;
63 
64  // take the one with less empty crossed tubes
65  if (seg1.emptyTubes().size() < seg2.emptyTubes().size())
66  return true;
67  else if (seg1.emptyTubes().size() > seg2.emptyTubes().size())
68  return false;
69 
70  // finally take the one with best chi2
71  return seg1.chi2() < seg2.chi2();
72  }

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