12from ROOT
import Belle2
13from ROOT.Belle2
import TrackFindingCDC
as TFCDC
16def is_power_of_two(x):
26assert (is_power_of_two(2048))
32 lowest_curv_bound = -0.02
33 uppest_curv_bound = 0.14
36 lower_bound = -width / 2
37 upper_bound = width / 2
39 new_bin_bounds = [(lower_bound, upper_bound)]
41 while upper_bound < uppest_curv_bound
or not is_power_of_two(len(new_bin_bounds)):
48 lower_bound = lower_bound + (1.0 - overlap) * width
50 lower_width = TFCDC.PrecisionUtil.getOriginCurvPrecision(lower_bound)
51 upper_width = TFCDC.PrecisionUtil.getOriginCurvPrecision(lower_bound + lower_width)
52 width = (lower_width + upper_width) / 2
53 width = width
if width > 0.00007
else 0.00007
54 upper_bound = lower_bound + width
55 new_bin_bounds.append((lower_bound, upper_bound))
58 if not -lower_bound < lowest_curv_bound:
59 new_bin_bounds.append((-upper_bound, -lower_bound))
61 new_bin_bounds = sorted(new_bin_bounds)
63 with open(
'new_fine_curv_bounds.txt',
'w')
as curv_bounds_file:
64 for bin_bound
in new_bin_bounds:
65 curv_bounds_file.write(str(bin_bound[0]))
66 curv_bounds_file.write(
'\n')
67 curv_bounds_file.write(str(bin_bound[1]))
68 curv_bounds_file.write(
'\n')
71if __name__ ==
'__main__':