#include <GroupedTrajCandLess.h>
Public Member Functions | |
GroupedTrajCandLess (float p=5, float b=0) | |
bool | operator() (const TempTrajectory &a, const TempTrajectory &b) const |
bool | operator() (const Trajectory &a, const Trajectory &b) const |
Private Member Functions | |
float | score (const Trajectory &t) const |
float | score (const TempTrajectory &t) const |
Private Attributes | |
float | bonus |
float | penalty |
Defines an ordering of Trajectories in terms of "goodness" The comparison is done in terms of total chi**2 / ndf plus a penalty for "lost" hits.
Definition at line 13 of file GroupedTrajCandLess.h.
GroupedTrajCandLess::GroupedTrajCandLess | ( | float | p = 5 , |
float | b = 0 |
||
) | [inline] |
bool GroupedTrajCandLess::operator() | ( | const Trajectory & | a, |
const Trajectory & | b | ||
) | const [inline] |
Definition at line 20 of file GroupedTrajCandLess.h.
References score().
bool GroupedTrajCandLess::operator() | ( | const TempTrajectory & | a, |
const TempTrajectory & | b | ||
) | const [inline] |
Definition at line 24 of file GroupedTrajCandLess.h.
References score().
float GroupedTrajCandLess::score | ( | const Trajectory & | t | ) | const [inline, private] |
Definition at line 29 of file GroupedTrajCandLess.h.
References bonus, Trajectory::chiSquared(), Trajectory::foundHits(), Trajectory::lostHits(), and penalty.
Referenced by operator()().
{ // int ndf(-5); // float chi2(0.); // vector<TrajectoryMeasurement> measurements(t.measurements()); // for ( vector<TrajectoryMeasurement>::const_iterator im=measurements.begin(); // im!=measurements.end(); im++ ) { // if ( im->recHit().isValid() ) { // ndf += im->recHit().dimension(); // chi2 += im->estimate(); // } // } // float normChi2(0.); // if ( ndf>0 ) { // // normalise chi2 to number of (2d) hits // normChi2 = chi2/ndf*2; // } // else { // // // include bonus for found hits // // normChi2 = chi2 - ndf/2*penalty; // } // normChi2 -= t.foundHits()*2*b; // return normChi2+t.lostHits()*penalty; return t.chiSquared()-t.foundHits()*bonus+t.lostHits()*penalty; }
float GroupedTrajCandLess::score | ( | const TempTrajectory & | t | ) | const [inline, private] |
Definition at line 55 of file GroupedTrajCandLess.h.
References bonus, TempTrajectory::chiSquared(), TempTrajectory::foundHits(), TempTrajectory::lostHits(), and penalty.
{ return t.chiSquared()-t.foundHits()*bonus+t.lostHits()*penalty; }
float GroupedTrajCandLess::bonus [private] |
Definition at line 63 of file GroupedTrajCandLess.h.
Referenced by score().
float GroupedTrajCandLess::penalty [private] |
Definition at line 62 of file GroupedTrajCandLess.h.
Referenced by score().