2 #include "ClusteringComparisonCP.h"
7 const unsigned * clustering1,
8 const unsigned * clustering2,
10 double * constitStab )
const
13 assert(inputParticles);
19 long double c1 = 0.0L, c2 = 0.0L, c3 = 0.0L, c4 = 0.0L;
21 for (
unsigned i=0; i<len; i++ ) {
22 const double pt_i = inputParticles[i].pt();
23 const unsigned cl_i_1 = clustering1[i];
24 const unsigned cl_i_2 = clustering2[i];
27 long double ci1 = 0.L, ci2 = 0.L, ci3 = 0.L, ci4 = 0.L;
29 for (
unsigned j=0; j<len; ++j ) {
30 if ( j == i )
continue;
32 const double weight = inputParticles[j].pt()*pt_i;
33 const bool same_in_1 = (cl_i_1 == clustering1[j]);
34 const bool same_in_2 = (cl_i_2 == clustering2[j]);
36 if ( same_in_1 && same_in_2)
38 else if ( same_in_1 && ! same_in_2)
40 else if ( !same_in_1 && same_in_2)
46 assert( ci1 + ci2 + ci3 + ci4 > 0.L );
47 constitStab[i] += combineCounts(ci1,ci2,ci3,ci4);
55 assert(c1 + c2 + c3 + c4 > 0.L);
60 return combineCounts(c1/2.,c2/2.,c3/2.,c4/2.);
double index(const PseudoJet *inputParticles, const unsigned *clustering1, const unsigned *clustering2, unsigned size, double *constitStab) const