13def landau(x, a, mu, sigma):
15 if isinstance(x, np.ndarray):
16 return np.array([landau(xi, a, mu, sigma)
for xi
in x])
17 elif isinstance(x, pd.Series):
18 return np.array([landau(xi, a, mu, sigma)
for xi
in x.values])
20 from ROOT
import TMath
21 return a * TMath.Landau(x, mu, sigma,
False)
24def landau_with_gaus(x, a, mu, sigma, b, c, d):
26 if isinstance(x, np.ndarray):
27 from ROOT
import TMath
28 return np.convolve([a * TMath.Landau(xi, mu, sigma,
False)
29 for xi
in x], [b * TMath.Gaus(xi, c, d,
False)
for xi
in x],
"same")
34def gumbel(x, mu, sigma, a):
37 return a * 1 / sigma * np.exp(- (z + np.exp(-z)))
40def norm(x, a, mu, sigma):
42 return a * np.exp(-(x - mu) ** 2 / (2 * sigma ** 2))
45def bifur_norm(x, a, mu, sigma_l, sigma_r):
47 if isinstance(x, np.ndarray):
48 return np.array([bifur_norm(xi, a, mu, sigma_l, sigma_r)
for xi
in x])
52 return norm(x, a, mu, sigma_l)
54 return norm(x, a, mu, sigma_r)
57def double_norm(x, a, mu, sigma, b, mu2, sigma2):
59 return norm(x, a, mu, sigma) + norm(x, b, mu2, sigma2)
62def norm_plus_lin(x, a, mu, sigma, b, c):
64 return norm(x, a, mu, sigma) + b * x + c
67def inverse_squared(x, a, b, c, d):
69 return a / (x - b) ** 2 + c + d * x
72def inverse_sqrt(x, a, b, c, d):
73 return a / (np.sqrt(x - b)) + c + d * x