24 std::vector<size_t> nCombs_prior(sizes.size());
25 std::vector<int> temp(sizes.size(), 0);
27 for (
size_t i = 0;
i < sizes.size();
i++)
31 nCombs_prior[
i] = nCombs;
37 std::vector<std::vector<int>> combos(nCombs, temp);
39 for (
size_t icomb = 0; icomb < nCombs; icomb++)
42 for (
size_t isize = sizes.size() - 1; isize < sizes.size(); isize--)
44 if (sizes[isize] == 0)
continue;
45 combos[icomb][isize] =
static_cast<int>(
index / nCombs_prior[isize]);
62 double const frac = 0.95;
63 double entries =
h->Integral(0,
h->GetNbinsX() + 1);
68 TH1* h_tmp =
dynamic_cast<TH1*
>(
h->Clone());
70 throw "dynamic_cast failure in FPGATrackSimFunctions rms95(TH1*)";
72 h_tmp->GetXaxis()->SetRange(1, h_tmp->GetNbinsX());
74 int meanbin =
h->GetXaxis()->FindBin(h_tmp->GetMean());
75 int lowerbin = meanbin;
76 int upperbin = meanbin;
78 double sum =
h->GetBinContent(meanbin);
84 int this_lowerbin = meanbin -
i;
85 int this_upperbin = meanbin +
i;
86 if (this_lowerbin < 1 || this_upperbin >
h->GetNbinsX())
break;
88 sum += h_tmp->GetBinContent(this_lowerbin) + h_tmp->GetBinContent(this_upperbin);
92 lowerbin = this_lowerbin;
93 upperbin = this_upperbin;
99 if (upperfrac == lowerfrac)
return h->GetRMS();
101 double rms_lower = 0;
102 double rms_upper = 0;
104 h_tmp->GetXaxis()->SetRange(lowerbin, upperbin);
105 rms_lower = h_tmp->GetRMS();
107 h_tmp->GetXaxis()->SetRange(lowerbin - 1, upperbin + 1);
108 rms_upper = h_tmp->GetRMS();
110 double rms = rms_lower + (
frac - lowerfrac) * (rms_upper - rms_lower) / (upperfrac - lowerfrac);
112 return rms * 1.1479538518;
118 std::vector<float> idealized_coordinates;
126 double houghRho = 0.0003 * hough_y;
128 hitGPhi += (hit.
getR() - target_r) * houghRho;
131 hitGPhi += (
pow(hit.
getR() * houghRho, 3.0) / 6.0);
134 if (hit.
getR() > 1
e-8) {
140 idealized_coordinates.push_back(hitZ);
143 double expectedGPhi = hough_x;
145 expectedGPhi -= target_r * houghRho;
148 expectedGPhi -= (
std::pow(target_r * houghRho, 3.0) / 6.0);
151 idealized_coordinates.push_back(hitGPhi - expectedGPhi);
154 idealized_coordinates.push_back(hitGPhi);
158 return idealized_coordinates;
168 double cor = 0.1216 *
r *
r - 0.0533 *
r + 0.0069;
171 else if (region == 4)
173 double cor = 0.4265 *
r *
r - 0.0662 *
r + 0.0036;