diff --git a/__pycache__/helperfunctions.cpython-37.pyc b/__pycache__/helperfunctions.cpython-37.pyc index 2e2f31f..b44a3ac 100644 --- a/__pycache__/helperfunctions.cpython-37.pyc +++ b/__pycache__/helperfunctions.cpython-37.pyc Binary files differ diff --git a/__pycache__/pdg_const.cpython-37.pyc b/__pycache__/pdg_const.cpython-37.pyc index 2577d57..648d836 100644 --- a/__pycache__/pdg_const.cpython-37.pyc +++ b/__pycache__/pdg_const.cpython-37.pyc Binary files differ diff --git a/__pycache__/raremodel.cpython-37.pyc b/__pycache__/raremodel.cpython-37.pyc index 3c2256b..5e5d2bf 100644 --- a/__pycache__/raremodel.cpython-37.pyc +++ b/__pycache__/raremodel.cpython-37.pyc Binary files differ diff --git "a/data/slim_points/slim_points_toy_0_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_0_range\0503150-3650\051.pkl" index 92922bc..4a1949a 100644 --- "a/data/slim_points/slim_points_toy_0_range\0503150-3650\051.pkl" +++ "b/data/slim_points/slim_points_toy_0_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_1_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_1_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..e96b9d7 --- /dev/null +++ "b/data/slim_points/slim_points_toy_1_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_2_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_2_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..9abc622 --- /dev/null +++ "b/data/slim_points/slim_points_toy_2_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_3_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_3_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..d9a489a --- /dev/null +++ "b/data/slim_points/slim_points_toy_3_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_4_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_4_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..ff198fa --- /dev/null +++ "b/data/slim_points/slim_points_toy_4_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_5_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_5_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..b804e14 --- /dev/null +++ "b/data/slim_points/slim_points_toy_5_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_6_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_6_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..899d634 --- /dev/null +++ "b/data/slim_points/slim_points_toy_6_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_7_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_7_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..9df505e --- /dev/null +++ "b/data/slim_points/slim_points_toy_7_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_8_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_8_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..8e1a57a --- /dev/null +++ "b/data/slim_points/slim_points_toy_8_range\0503150-3650\051.pkl" Binary files differ diff --git "a/data/slim_points/slim_points_toy_9_range\0503150-3650\051.pkl" "b/data/slim_points/slim_points_toy_9_range\0503150-3650\051.pkl" new file mode 100644 index 0000000..7caf7c2 --- /dev/null +++ "b/data/slim_points/slim_points_toy_9_range\0503150-3650\051.pkl" Binary files differ diff --git a/plots/points/ff.png b/plots/points/ff.png index 0dafc99..4dc00f8 100644 --- a/plots/points/ff.png +++ b/plots/points/ff.png Binary files differ diff --git a/plots/points/histo.png b/plots/points/histo.png index 4dd311c..85beed2 100644 --- a/plots/points/histo.png +++ b/plots/points/histo.png Binary files differ diff --git a/plots/points/histo_raw.png b/plots/points/histo_raw.png index 2c7d09f..bbb0dd6 100644 --- a/plots/points/histo_raw.png +++ b/plots/points/histo_raw.png Binary files differ diff --git a/plots/points/pdf_and_parts.png b/plots/points/pdf_and_parts.png index bd2d16b..c2acc0e 100644 --- a/plots/points/pdf_and_parts.png +++ b/plots/points/pdf_and_parts.png Binary files differ diff --git a/plots/points/vec_axiv.png b/plots/points/vec_axiv.png index 3aaa557..c8daa9a 100644 --- a/plots/points/vec_axiv.png +++ b/plots/points/vec_axiv.png Binary files differ diff --git a/raremodel.py b/raremodel.py index 5c1e659..e4495a7 100644 --- a/raremodel.py +++ b/raremodel.py @@ -272,7 +272,7 @@ #Prepare variables - set_sizes = np.random.normal(set_size, np.sqrt(set_size), nr_of_toys) + set_sizes = np.random.poisson(set_size, nr_of_toys) def total_pdf_neg(q2): return -1*self.total_pdf(q2) @@ -285,7 +285,7 @@ set_size_intermed = 0 - print("Generating set of size {}...".format(int(set_sizes[toy]))) + print("Generating toy {0} of size {1}...".format(toy+1, int(set_sizes[toy]))) x_part = [] @@ -293,17 +293,17 @@ while set_size_intermed < set_sizes[toy]: - x_part_raw = np.random.uniform(low = x_min, high = x_max, size = 1000000) + x_part_raw = np.random.uniform(low = x_min, high = x_max, size = 2000000) # print(x_part_raw[:40]) - y_part_raw = np.random.uniform(low = 0.0, high = maxi, size = 1000000) + y_part_raw = np.random.uniform(low = 0.0, high = maxi, size = 2000000) # print(y_part_raw[:40]) choose = np.where(y_part_raw < self.total_pdf(np.power(x_part_raw, 2)), True, False) - print(choose[:40]) + # print(choose[:40]) x_part_intermed = list(compress(x_part_raw, choose)) @@ -315,7 +315,7 @@ x_part = np.array(x_part) - print(" Toy {0} of {1} generated!".format(toy, nr_of_toys)) + print(" Toy {0} of {1} generated!".format(toy+1, nr_of_toys)) #Save the set @@ -555,6 +555,13 @@ print("Generating plots") + if mode == "true_data": + folder = mode + elif mode == "fast_binned": + folder = mode + else: + folder = "points" + #Load variables mB = self.mB @@ -594,7 +601,7 @@ prepare_plot("Formfactors") - plt.savefig("./plots/{0}/ff.png".format(mode)) + plt.savefig("./plots/{0}/ff.png".format(folder)) print(" ff.png created") @@ -608,7 +615,7 @@ prepare_plot("Nonresonant parts") - plt.savefig("./plots/{0}/vec_axiv.png".format(mode)) + plt.savefig("./plots/{0}/vec_axiv.png".format(folder)) print(" vec_axiv.png created") @@ -637,9 +644,12 @@ # plt.ylim(0, 2*self.param_val[1]) - plt.savefig("./plots/{0}/pdf_and_parts.png".format(mode)) + plt.savefig("./plots/{0}/pdf_and_parts.png".format(folder)) - print(" pdf_and_parts.png created") + if mode == "no_data": + print(" pdf_and_parts.png created\n") + else: + print(" pdf_and_parts.png created") #Create histo with pdf @@ -921,7 +931,7 @@ i += 1 print(" {0}. {1}: {2}".format(i, key, dic[key])) - print + print("") def add_nonres(self): @@ -931,7 +941,6 @@ def nonres_func(q2, param_val, absolut = False): return self.total_nonres(q2, parameters = param_val, name = name, absolut = absolut) self.total_pdf_list += [nonres_func] - print("Func added") # self.nr_of_part_listnr_of_part) self.total_pdf_names += [name] diff --git a/test.py b/test.py index 73b72be..793ea1c 100644 --- a/test.py +++ b/test.py @@ -20,10 +20,10 @@ modl.mode = mode -set_size = 1e5 +set_size = 1e7 nonres_set_size = 44000 # nonres_set_size = 1000 -nr_of_toys = 1 +nr_of_toys = 10 x_min = 3150.0 x_max= 3650.0 @@ -55,10 +55,6 @@ modl.param_list() -q_test = np.linspace(modl.x_min, modl.x_max, 100) - -print(modl.total_pdf(np.power(q_test, 2))) - modl.mode = "no_data" modl.draw_plots(part_set = 1, x_min = x_min, x_max = x_max, mode = "no_data") @@ -81,8 +77,9 @@ counter = set_dic["counter_tot"] else: + start = time.time() part_set = modl.generate_points(set_size, x_min = x_min, x_max = x_max, mode = mode, verbose = 1, nr_of_toys = nr_of_toys, nonres_set_size = nonres_set_size) - + print(time.time() - start) if draw: modl.draw_plots(part_set = part_set, x_min = x_min, x_max = x_max, mode = mode)