13 from ROOT
import Belle2
14 from ROOT.Belle2
import TrackFindingCDC
as TFCDC
17 def is_power_of_two(x):
27 assert(is_power_of_two(2048))
33 lowest_curv_bound = -0.02
34 uppest_curv_bound = 0.14
37 lower_bound = -width / 2
38 upper_bound = width / 2
40 new_bin_bounds = [(lower_bound, upper_bound)]
42 while upper_bound < uppest_curv_bound
or not is_power_of_two(len(new_bin_bounds)):
49 lower_bound = lower_bound + (1.0 - overlap) * width
51 lower_width = TFCDC.PrecisionUtil.getOriginCurvPrecision(lower_bound)
52 upper_width = TFCDC.PrecisionUtil.getOriginCurvPrecision(lower_bound + lower_width)
53 width = (lower_width + upper_width) / 2
54 width = width
if width > 0.00007
else 0.00007
55 upper_bound = lower_bound + width
56 new_bin_bounds.append((lower_bound, upper_bound))
59 if not -lower_bound < lowest_curv_bound:
60 new_bin_bounds.append((-upper_bound, -lower_bound))
62 new_bin_bounds = sorted(new_bin_bounds)
64 with open(
'new_fine_curv_bounds.txt',
'w')
as curv_bounds_file:
65 for bin_bound
in new_bin_bounds:
66 curv_bounds_file.write(str(bin_bound[0]))
67 curv_bounds_file.write(
'\n')
68 curv_bounds_file.write(str(bin_bound[1]))
69 curv_bounds_file.write(
'\n')
72 if __name__ ==
'__main__':
int main(int argc, char **argv)
Run all tests.