2 #include "ClusteringComparison.h"
5 double TransversePairwiseIndex::index(
const PseudoJet* inputParticles,
6 const unsigned* clustering1,
7 const unsigned* clustering2,
8 const unsigned len)
const
10 assert(inputParticles);
15 long double c1 = 0.0L, c2 = 0.0L, c3 = 0.0L, c4 = 0.0L;
17 for (
unsigned i=1; i<len; ++i)
19 const double pt_i = inputParticles[i].pt();
20 const unsigned cl_i_1 = clustering1[i];
21 const unsigned cl_i_2 = clustering2[i];
23 for (
unsigned j=0; j<i; ++j)
25 const double weight = inputParticles[j].pt()*pt_i;
26 const bool same_in_1 = (cl_i_1 == clustering1[j]);
27 const bool same_in_2 = (cl_i_2 == clustering2[j]);
29 if (same_in_1 && same_in_2)
31 else if (same_in_1 && !same_in_2)
33 else if (!same_in_1 && same_in_2)
40 assert(c1 + c2 + c3 + c4 > 0.0L);
41 return combineCounts(c1, c2, c3, c4);