@@ -32,14 +32,21 @@ public ArrayList<PreCluster> find_preclusters_for_AI(List<Hit> AHDC_hits) {
3232 ArrayList <Hit > s5l1 = fill (AHDC_hits , 5 , 1 );
3333
3434 // Sort hits of each layers by phi:
35- s1l1 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
36- s2l1 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
37- s2l2 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
38- s3l1 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
39- s3l2 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
40- s4l1 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
41- s4l2 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
42- s5l1 .sort (new Comparator <Hit >() {@ Override public int compare (Hit a1 , Hit a2 ) {return Double .compare (a1 .getPhi (), a2 .getPhi ());}});
35+ Comparator <Hit > comparator = new Comparator <>() {
36+ @ Override
37+ public int compare (Hit a1 , Hit a2 ) {
38+ return Double .compare (a1 .getPhi (), a2 .getPhi ());
39+ }
40+ };
41+
42+ s1l1 .sort (comparator );
43+ s2l1 .sort (comparator );
44+ s2l2 .sort (comparator );
45+ s3l1 .sort (comparator );
46+ s3l2 .sort (comparator );
47+ s4l1 .sort (comparator );
48+ s4l2 .sort (comparator );
49+ s5l1 .sort (comparator );
4350
4451 ArrayList <ArrayList <Hit >> all_super_layer = new ArrayList <>(Arrays .asList (s1l1 , s2l1 , s2l2 , s3l1 , s3l2 , s4l1 , s4l2 , s5l1 ));
4552
0 commit comments