CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GroupedTrajCandLess.h
Go to the documentation of this file.
1 #ifndef GroupedTrajCandLess_H
2 #define GroupedTrajCandLess_H
3 
4 #include <functional>
7 
13 class GroupedTrajCandLess : public std::binary_function< const Trajectory&,
14  const Trajectory&, bool>
15 {
16 public:
17 
18  GroupedTrajCandLess( float p=5, float b=0) : penalty(p), bonus(b) {}
19 
20  bool operator()( const Trajectory& a, const Trajectory& b) const {
21  return score(a) < score(b);
22  }
23 
24  bool operator()( const TempTrajectory& a, const TempTrajectory& b) const {
25  return score(a) < score(b);
26  }
27 
28 private:
29  float score (const Trajectory& t) const
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  }
58  float score (const TempTrajectory& t) const
59  {
60  return t.chiSquared()-t.foundHits()*bonus+t.lostHits()*penalty
62  }
63 
64  private:
65 
66  float penalty;
67  float bonus;
68 
69 };
70 
71 #endif
float dPhiCacheForLoopersReconstruction() const
Definition: Trajectory.h:325
int foundHits() const
Definition: Trajectory.h:236
int lostHits() const
Definition: Trajectory.h:243
float score(const TempTrajectory &t) const
int foundHits() const
obsolete name, use measurements() instead.
float score(const Trajectory &t) const
float dPhiCacheForLoopersReconstruction() const
bool operator()(const Trajectory &a, const Trajectory &b) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double chiSquared() const
Value of the raw Chi2 of the trajectory, not normalised to the N.D.F.
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
GroupedTrajCandLess(float p=5, float b=0)
bool operator()(const TempTrajectory &a, const TempTrajectory &b) const
double chiSquared() const
Definition: Trajectory.h:254
int lostHits() const