CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GroupedTrajCandLess Class Reference

#include <GroupedTrajCandLess.h>

Inheritance diagram for GroupedTrajCandLess:

Public Member Functions

 GroupedTrajCandLess (float p=5, float b=0)
 
bool operator() (const Trajectory &a, const Trajectory &b) const
 
bool operator() (const TempTrajectory &a, const TempTrajectory &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

Member Function Documentation

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

Definition at line 20 of file GroupedTrajCandLess.h.

References score().

20  {
21  return score(a) < score(b);
22  }
float score(const Trajectory &t) const
bool GroupedTrajCandLess::operator() ( const TempTrajectory a,
const TempTrajectory b 
) const
inline

Definition at line 24 of file GroupedTrajCandLess.h.

References score().

24  {
25  return score(a) < score(b);
26  }
float score(const Trajectory &t) const
float GroupedTrajCandLess::score ( const Trajectory t) const
inlineprivate

Definition at line 29 of file GroupedTrajCandLess.h.

References bonus, Trajectory::chiSquared(), funct::cos(), Trajectory::dPhiCacheForLoopersReconstruction(), Trajectory::foundHits(), Trajectory::lostHits(), and penalty.

Referenced by operator()().

30  {
31 // int ndf(-5);
32 // float chi2(0.);
33 // vector<TrajectoryMeasurement> measurements(t.measurements());
34 // for ( vector<TrajectoryMeasurement>::const_iterator im=measurements.begin();
35 // im!=measurements.end(); im++ ) {
36 // if ( im->recHit().isValid() ) {
37 // ndf += im->recHit().dimension();
38 // chi2 += im->estimate();
39 // }
40 // }
41 
42 // float normChi2(0.);
43 // if ( ndf>0 ) {
44 // // normalise chi2 to number of (2d) hits
45 // normChi2 = chi2/ndf*2;
46 // }
47 // else {
48 // // // include bonus for found hits
49 // // normChi2 = chi2 - ndf/2*penalty;
50 // }
51 // normChi2 -= t.foundHits()*2*b;
52 // return normChi2+t.lostHits()*penalty;
53 
54 
55  return t.chiSquared()-t.foundHits()*bonus+t.lostHits()*penalty
57  }
float dPhiCacheForLoopersReconstruction() const
Definition: Trajectory.h:323
int foundHits() const
Definition: Trajectory.h:234
int lostHits() const
Definition: Trajectory.h:241
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float chiSquared() const
Definition: Trajectory.h:252
float GroupedTrajCandLess::score ( const TempTrajectory t) const
inlineprivate

Definition at line 58 of file GroupedTrajCandLess.h.

References bonus, TempTrajectory::chiSquared(), funct::cos(), TempTrajectory::dPhiCacheForLoopersReconstruction(), TempTrajectory::foundHits(), TempTrajectory::lostHits(), and penalty.

59  {
60  return t.chiSquared()-t.foundHits()*bonus+t.lostHits()*penalty
62  }
int foundHits() const
float dPhiCacheForLoopersReconstruction() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
int lostHits() const

Member Data Documentation

float GroupedTrajCandLess::bonus
private

Definition at line 67 of file GroupedTrajCandLess.h.

Referenced by score().

float GroupedTrajCandLess::penalty
private

Definition at line 66 of file GroupedTrajCandLess.h.

Referenced by score().