CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

GroupedTrajCandLess Class Reference

#include <GroupedTrajCandLess.h>

Inheritance diagram for GroupedTrajCandLess:
binary_function

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

GroupedTrajCandLess::GroupedTrajCandLess ( float  p = 5,
float  b = 0 
) [inline]

Definition at line 18 of file GroupedTrajCandLess.h.

: penalty(p), bonus(b) {}

Member Function Documentation

bool GroupedTrajCandLess::operator() ( const Trajectory a,
const Trajectory b 
) const [inline]

Definition at line 20 of file GroupedTrajCandLess.h.

References score().

                                                                   {
    return score(a) < score(b);
  }
bool GroupedTrajCandLess::operator() ( const TempTrajectory a,
const TempTrajectory b 
) const [inline]

Definition at line 24 of file GroupedTrajCandLess.h.

References score().

                                                                           {
    return score(a) < score(b);
  }
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]

Member Data Documentation

float GroupedTrajCandLess::bonus [private]

Definition at line 63 of file GroupedTrajCandLess.h.

Referenced by score().

Definition at line 62 of file GroupedTrajCandLess.h.

Referenced by score().