20 const ::cluster::ClusterParamsAlg& cluster2)
24 double angle1 = cluster1.GetParams().angle_2d;
25 double angle2 = cluster2.GetParams().angle_2d;
27 double w_start1 = cluster1.GetParams().start_point.w;
28 double t_start1 = cluster1.GetParams().start_point.t;
29 double w_start2 = cluster2.GetParams().start_point.w;
30 double t_start2 = cluster2.GetParams().start_point.t;
32 double len1 = cluster1.GetParams().length;
33 double len2 = cluster2.GetParams().length;
35 size_t hits1 = cluster1.GetHitVector().size();
36 size_t hits2 = cluster1.GetHitVector().size();
39 if ((hits1 <
_minHits) or (hits2 <
_minHits) or (angle1 < -360) or (angle2 < -360))
43 std::cout <<
"Cluster 1:" << std::endl;
44 std::cout <<
"\tStart: ( " << w_start1 <<
", " << t_start1 <<
" )" << std::endl;
45 std::cout <<
"\tAngle: " << angle1 << std::endl;
46 std::cout <<
"\tLength: " << len1 << std::endl;
47 std::cout <<
"\tN Hits: " << hits1 << std::endl;
49 std::cout <<
"Cluster 2:" << std::endl;
50 std::cout <<
"\tStart: ( " << w_start2 <<
", " << t_start2 <<
" )" << std::endl;
51 std::cout <<
"\tAngle: " << angle2 << std::endl;
52 std::cout <<
"\tLength: " << len2 << std::endl;
53 std::cout <<
"\tN Hits: " << hits2 << std::endl;
61 if ((t_start2 - t_start1) == 0)
64 double slope = (t_start2 - t_start1) / (w_start2 - w_start1);
65 angle = atan(slope) * 180. / 3.14;
68 separation =
abs(angle - angle1);
70 std::cout <<
"Angle S1--S2: " << angle << std::endl;
71 std::cout <<
"Angle1--S2: " << separation << std::endl;
76 if (
_verbose) { std::cout <<
"Separate! cluster 1 BIG" << std::endl << std::endl; }
82 angle = (int)(angle) % 360;
83 separation =
abs(angle - angle2);
85 std::cout <<
"Angle S2--S1: " << angle << std::endl;
86 std::cout <<
"Angle2--S1: " << separation << std::endl;
91 if (
_verbose) { std::cout <<
"Separate! cluster 2 BIG" << std::endl << std::endl; }
95 if (
_debug) { std::cout << std::endl; }
constexpr auto abs(T v)
Returns the absolute value of the argument.