ATLAS Offline Software
Public Member Functions | List of all members
Muon::SortTracksByHitNumber Class Reference

#include <SortTracksByHitNumber.h>

Collaboration diagram for Muon::SortTracksByHitNumber:

Public Member Functions

bool operator() (const Trk::Track *tr1, const Trk::Track *tr2)
 
bool operator() (const Trk::Track &tr1, const Trk::Track &tr2)
 

Detailed Description

Definition at line 15 of file SortTracksByHitNumber.h.

Member Function Documentation

◆ operator()() [1/2]

bool Muon::SortTracksByHitNumber::operator() ( const Trk::Track tr1,
const Trk::Track tr2 
)
inline

Definition at line 19 of file SortTracksByHitNumber.h.

19  {
20  // prefer tracks with fit quality (always expected)
21  const Trk::FitQuality* fq1 = tr1.fitQuality();
22  const Trk::FitQuality* fq2 = tr2.fitQuality();
23  if (!fq1 && fq2) return false;
24  if (fq1 && !fq2) return true;
25  if (!fq1 && !fq2) return false;
26 
27  if (fq1->numberDoF() > fq2->numberDoF()) return true;
28  if (fq1->numberDoF() < fq2->numberDoF()) return false;
29 
30  // select candidate with smallest chi2
31  double chi2Ndof1 = fq1->chiSquared() / fq1->numberDoF();
32  double chi2Ndof2 = fq2->chiSquared() / fq2->numberDoF();
33  return chi2Ndof1 < chi2Ndof2;
34  }

◆ operator()() [2/2]

bool Muon::SortTracksByHitNumber::operator() ( const Trk::Track tr1,
const Trk::Track tr2 
)
inline

Definition at line 17 of file SortTracksByHitNumber.h.

17 { return this->operator()(*tr1, *tr2); }

The documentation for this class was generated from the following file:
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
Muon::SortTracksByHitNumber::operator()
bool operator()(const Trk::Track *tr1, const Trk::Track *tr2)
Definition: SortTracksByHitNumber.h:17
Trk::FitQuality
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Definition: FitQuality.h:97
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
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