stablejet is hosted by Hepforge, IPPP Durham
StableJet
ClusteringComparison.h
1 #ifndef ClusteringComparison_h
2 #define ClusteringComparison_h
3 
4 #include "ClusteringComparisonIndex.h"
5 
6 namespace stab {
8  {
9  public:
10  inline virtual ~TransversePairwiseIndex() {}
11 
12  double index(const PseudoJet* inputParticles,
13  const unsigned* clustering1,
14  const unsigned* clustering2,
15  unsigned size) const;
16  private:
17  // c1 -- weighted sum of pairs assigned to the same cluster
18  // in both clusterings.
19  // c2 -- weighted sum of pairs assigned to different clusters
20  // in both clusterings.
21  // c3 -- weighted sum of pairs assigned to the same cluster
22  // in clustering 1 but to different clusters in clustering 2.
23  // c4 -- weighted sum of pairs assigned to the same cluster
24  // in clustering 2 but to different clusters in clustering 1.
25  //
26  virtual double combineCounts(double c1, double c2,
27  double c3, double c4) const = 0;
28  };
29 
31  {
32  inline double combineCounts(const double c1, const double c2,
33  const double c3, const double c4) const
34  {
35  return (c1 + c2)/(c1 + c2 + c3 + c4);
36  }
37  };
38 
40  {
41  inline double combineCounts(const double c1, const double c2,
42  const double c3, const double c4) const
43  {
44  return c1/(c1 + c3 + c4);
45  }
46  };
47 }
48 
49 #endif // ClusteringComparison_h