diff --git a/__pycache__/helperfunctions.cpython-37.pyc b/__pycache__/helperfunctions.cpython-37.pyc index b44a3ac..2e2f31f 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 648d836..2577d57 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 5e5d2bf..3c2256b 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 4a1949a..92922bc 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" deleted file mode 100644 index e96b9d7..0000000 --- "a/data/slim_points/slim_points_toy_1_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index 9abc622..0000000 --- "a/data/slim_points/slim_points_toy_2_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index d9a489a..0000000 --- "a/data/slim_points/slim_points_toy_3_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index ff198fa..0000000 --- "a/data/slim_points/slim_points_toy_4_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index b804e14..0000000 --- "a/data/slim_points/slim_points_toy_5_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index 899d634..0000000 --- "a/data/slim_points/slim_points_toy_6_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index 9df505e..0000000 --- "a/data/slim_points/slim_points_toy_7_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index 8e1a57a..0000000 --- "a/data/slim_points/slim_points_toy_8_range\0503150-3650\051.pkl" +++ /dev/null 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" deleted file mode 100644 index 7caf7c2..0000000 --- "a/data/slim_points/slim_points_toy_9_range\0503150-3650\051.pkl" +++ /dev/null Binary files differ diff --git a/plots/points/ff.png b/plots/points/ff.png index 4dc00f8..0dafc99 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 85beed2..4dd311c 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 bbb0dd6..2c7d09f 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 c2acc0e..bd2d16b 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 c8daa9a..3aaa557 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 e4495a7..5c1e659 100644 --- a/raremodel.py +++ b/raremodel.py @@ -272,7 +272,7 @@ #Prepare variables - set_sizes = np.random.poisson(set_size, nr_of_toys) + set_sizes = np.random.normal(set_size, np.sqrt(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 toy {0} of size {1}...".format(toy+1, int(set_sizes[toy]))) + print("Generating set of size {}...".format(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 = 2000000) + x_part_raw = np.random.uniform(low = x_min, high = x_max, size = 1000000) # print(x_part_raw[:40]) - y_part_raw = np.random.uniform(low = 0.0, high = maxi, size = 2000000) + y_part_raw = np.random.uniform(low = 0.0, high = maxi, size = 1000000) # 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+1, nr_of_toys)) + print(" Toy {0} of {1} generated!".format(toy, nr_of_toys)) #Save the set @@ -555,13 +555,6 @@ print("Generating plots") - if mode == "true_data": - folder = mode - elif mode == "fast_binned": - folder = mode - else: - folder = "points" - #Load variables mB = self.mB @@ -601,7 +594,7 @@ prepare_plot("Formfactors") - plt.savefig("./plots/{0}/ff.png".format(folder)) + plt.savefig("./plots/{0}/ff.png".format(mode)) print(" ff.png created") @@ -615,7 +608,7 @@ prepare_plot("Nonresonant parts") - plt.savefig("./plots/{0}/vec_axiv.png".format(folder)) + plt.savefig("./plots/{0}/vec_axiv.png".format(mode)) print(" vec_axiv.png created") @@ -644,12 +637,9 @@ # plt.ylim(0, 2*self.param_val[1]) - plt.savefig("./plots/{0}/pdf_and_parts.png".format(folder)) + plt.savefig("./plots/{0}/pdf_and_parts.png".format(mode)) - if mode == "no_data": - print(" pdf_and_parts.png created\n") - else: - print(" pdf_and_parts.png created") + print(" pdf_and_parts.png created") #Create histo with pdf @@ -931,7 +921,7 @@ i += 1 print(" {0}. {1}: {2}".format(i, key, dic[key])) - print("") + print def add_nonres(self): @@ -941,6 +931,7 @@ 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 793ea1c..73b72be 100644 --- a/test.py +++ b/test.py @@ -20,10 +20,10 @@ modl.mode = mode -set_size = 1e7 +set_size = 1e5 nonres_set_size = 44000 # nonres_set_size = 1000 -nr_of_toys = 10 +nr_of_toys = 1 x_min = 3150.0 x_max= 3650.0 @@ -55,6 +55,10 @@ 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") @@ -77,9 +81,8 @@ 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)