19 HoughHistMC =
new TH2D(
"HoughHistMC",
"HoughHistMC" , 15 , -2.5 , 2.5, 12, 200, 2500);
24 for (
int i=0;
i<
Nr;
i++)
31 cout<<
"checking............";
33 for (
int i=0;
i<k1+1;
i++)
38 cout<<
"\n\n\n\t\t\t"<<Npoints<<
"\n\n";
40 for (
int i=0;
i<
Nr;
i++)
55 cout <<
"\n N" << Npoints <<
"\t k1"<<k1<<
"\t K"<<
k;
58 static std::vector <double> inverse_slope;
59 static std::vector <double>
offset;
61 for (
int i=0;
i<
k;
i++)
63 for (
int j=
i+1;
j<
k;
j++)
70 c= (y2*x1 - y1*x2)/(x1-x2);
71 inverse_slope.push_back(1/m);
77 int size =
static_cast<int>(inverse_slope.size());
78 cout <<
"\n Size "<<
size;
81 double Median_InverseSlope, Median_Offset;
82 sort(inverse_slope.begin(), inverse_slope.end());
84 Median_InverseSlope = inverse_slope[(size+1)/2];
86 Median_InverseSlope = (inverse_slope[(
size)/2] + inverse_slope[(size+2)/2])/2.0 ;
87 cout <<
"\n Median_ Inverse Slope"<<Median_InverseSlope;
89 sort(offset.begin(), offset.end());
91 Median_Offset = offset[(size+1)/2];
93 Median_Offset = (offset[(
size)/2] + offset[(size+2)/2])/2.0 ;
94 cout <<
"\nMedian_Offset"<<Median_Offset <<
"\n";
105 std::vector <double> accum_IS;
106 std::for_each (
std::begin(inverse_slope),
std::end(inverse_slope), [&](
const double d) {
107 accum_IS.push_back(abs(d - Median_InverseSlope));
109 cout<<
"\n Size of accum vector without static" << accum_IS.size();
115 double MAD_InverseSlope = 0;
116 sort(accum_IS.begin(), accum_IS.end());
118 MAD_InverseSlope = accum_IS[(size+1)/2];
120 MAD_InverseSlope = accum_IS[size/2];
123 cout <<
"\n MAD_InverseSlope"<< MAD_InverseSlope;
126 std::vector <double> accum_O;
127 std::for_each (
std::begin(inverse_slope),
std::end(inverse_slope), [&](
const double d) {
128 accum_O.push_back(abs(d - Median_Offset));
131 cout<<
"\n Size of accum vector with static" << accum_O.size();
138 sort(accum_O.begin(), accum_O.end());
140 MAD_Offset = accum_O[(size+1)/2];
142 MAD_Offset = accum_O[size/2];