22 def __init__(self, *args, **kwargs):
23 """Constructor"""
24 super().__init__(*args, **kwargs)
25 cosTheta_min = [-0.7, -0.5, 0, 0.2, 0.5, 0.8, 0.9]
26 cosTheta_max = [-0.5, 0, 0.2, 0.5, 0.8, 0.9, 0.95]
27 cosTheta_var = [list(c) for c in zip(cosTheta_min, cosTheta_max)]
28 p_min = [0.5, 1, 2, 3, 4, 5]
29 p_max = [1, 2, 3, 4, 5, 6]
30 charge_var = [[-2, 0], [0, 2]]
31 p_var = [list(p) for p in zip(p_min, p_max)]
32 eff_binning = np.array([list(c) for c in itertools.product(p_var, cosTheta_var, charge_var)]).reshape(-1, 6)
33 p_min = [0.5, 1, 2, 3, 4]
34 p_max = [1, 2, 3, 4, 5]
35 p_var = [list(p) for p in zip(p_min, p_max)]
36 fake_binning = np.array([list(c) for c in itertools.product(p_var, cosTheta_var, charge_var)]).reshape(-1, 6)
37 np.random.seed(0)
38 eff_df = pd.DataFrame(eff_binning, columns=['p_min', 'p_max', 'cosTheta_min', 'cosTheta_max', 'charge_min', 'charge_max'])
39 eff_df['data_MC_ratio'] = np.random.normal(1, 0.1, size=len(eff_df))
40 eff_df['data_MC_uncertainty_stat_dn'] = np.random.uniform(0.001, 0.01, size=len(eff_df))
41 eff_df['data_MC_uncertainty_stat_up'] = np.random.uniform(0.001, 0.01, size=len(eff_df))
42 eff_df['data_MC_uncertainty_sys_up'] = np.random.uniform(0.001, 0.01, size=len(eff_df))
43 eff_df['data_MC_uncertainty_sys_dn'] = np.random.uniform(0.001, 0.01, size=len(eff_df))
44 eff_df['variable'] = 'electronID'
45 eff_df['threshold'] = 0.8
46
47 fake_df = pd.DataFrame(fake_binning, columns=['p_min', 'p_max', 'cosTheta_min', 'cosTheta_max', 'charge_min', 'charge_max'])
48 fake_df['data_MC_ratio'] = np.random.normal(2, 0.2, size=len(fake_df))
49 fake_df['data_MC_uncertainty_stat_dn'] = np.random.uniform(0.01, 0.02, size=len(fake_df))
50 fake_df['data_MC_uncertainty_stat_up'] = np.random.uniform(0.01, 0.02, size=len(fake_df))
51 fake_df['data_MC_uncertainty_sys_up'] = np.random.uniform(0.01, 0.02, size=len(fake_df))
52 fake_df['data_MC_uncertainty_sys_dn'] = np.random.uniform(0.01, 0.02, size=len(fake_df))
53 fake_df['variable'] = 'electronID'
54 fake_df['threshold'] = 0.8
55
56 self.pid_tables = {(11, 11): eff_df, (11, 211): fake_df}
57
58 user_data_dict = {
59 'cosTheta': np.array([0.25, 0.55, 0.85, 0.925]),
60 'p': np.array([1.5, 2.5, 3.5, 4.5]),
61 'charge': np.array([-1, 1, 1, 1]),
62 'electronID': np.array([0.85, 0.9, 0.95, 0.975]),
63 'PDG': np.array([11, -11, -11, -11]),
64 'mcPDG': np.array([11, 211, -11, 211]),
65 'B0_dec_mode': [0, 1, 2, 3],
66 'B0_PDG': [511, -511, 511, -511],
67 'B0_sigProb': [0.02, 0.03, 0.02, 0.9]
68 }
69
70 self.user_data = pd.DataFrame(user_data_dict)
71 print(self.pid_tables)
72 print(self.user_data)
73
74 fei_dict = {'dec_mode': ['All', 'Rest', 'mode0', 'mode2'],
75 'cal': [0.8, 0.85, 0.75, 0.82],
76 'cal_stat_error': [0.1, 0.02, 0.03, 0.05],
77 'cal_sys_error': [0.1, 0.02, 0.03, 0.05],
78 'sig_prob_threshold': [0.01, 0.01, 0.01, 0.01],
79 'Btag': ['B0', 'B0', 'B0', 'B0']
80 }
81
82 self.fei_table = pd.DataFrame(fei_dict)
83