11from ROOT
import Belle2
12from ROOT
import gSystem
13import matplotlib.pyplot
as plt
17import matplotlib
as mpl
21gSystem.Load(
'libframework')
22gSystem.Load(
'libtracking')
23gSystem.Load(
'libtracking_trackFindingCDC')
27 return logging.getLogger(__name__)
30CONTACT =
"oliver.frost@desy.de"
37center_phi = np.arctan2(center_y, center_x)
48curvature_estimates = []
49curvature_variances = []
53 for i_toy
in range(n_toys):
56 chis = np.random.uniform(0, np.pi, n_points)
59 chis = np.linspace(0, np.pi, n_points)
61 ls = np.random.normal(0, 10 * np.sqrt(pos_var), n_points)
62 dls = np.random.normal(0, np.sqrt(pos_var), n_points)
64 xs = (radius + ls + dls) * np.cos(chis + center_phi - np.pi) + center_x
65 ys = (radius + ls + dls) * np.sin(chis + center_phi - np.pi) + center_y
69 for x, y, l
in zip(xs, ys, ls):
71 observations.fill(x, y, l, weight)
74 trajectory = fitter.fit(observations)
76 circle = trajectory.getGlobalCircle()
77 if circle.curvature() < 0:
80 curvature_estimates.append(circle.curvature())
81 curvature_variances.append(trajectory.getLocalVariance(0))
82 chi2s.append(trajectory.getChi2())
84 circle_points = [circle.atArcLength(chi * radius)
for chi
in np.linspace(0, np.pi, 50)]
85 circle_xs = [p.x()
for p
in circle_points]
86 circle_ys = [p.y()
for p
in circle_points]
89 plt.plot(circle_xs, circle_ys)
94 curvature_residuals = np.array(curvature_estimates) - 1 / radius
96 plt.hist(curvature_residuals, bins=100)
97 plt.title(
"Curvature residual")
100 plt.hist(curvature_residuals / np.sqrt(curvature_variances), bins=100, normed=
True)
102 normal_xs = np.linspace(-4, 4, 50)
103 normal_ys = np.exp(-normal_xs * normal_xs / 2) / np.sqrt(2 * np.pi)
104 plt.plot(normal_xs, normal_ys)
105 plt.title(
"Curvature pull")
108 plt.hist(chi2s, bins=100)
112 p_values = prob(chi2s, ndfs)
113 plt.hist(p_values, bins=100, normed=
True)
114 plt.plot([0, 1], [1, 1])
118if __name__ ==
"__main__":
Class serving as a storage of observed drift circles to present to the Riemann fitter.
static const CDCRiemannFitter & getFitter()
Static getter for a general Riemann fitter.