diff --git a/LightSimtastic.py b/LightSimtastic.py index bc6ddb91afb698b2b4079a7909d4ee8db410de1f..ff58b539c3055fa426c61146f0165734f143a15b 100644 --- a/LightSimtastic.py +++ b/LightSimtastic.py @@ -336,6 +336,9 @@ class SiPMSimulation: npXT_sum = np.sum(npXT) + nPG_pXT_sum = nPG_sum + npXT_sum + + pg_l_d = np.ones(nlight_sum) pg_l_t = np.asarray(ns.dist_ftlight.rvs(size=nlight_sum)) @@ -359,8 +362,6 @@ class SiPMSimulation: pg_t = [np.concatenate(elem) for elem in zip(pg_l_t, pg_dc_t)] - - pbar.update(1) pbar.set_description("{0}".format(self.pb_ag_text[2])) @@ -434,32 +435,21 @@ class SiPMSimulation: ] - - - ag_d = [ - np.concatenate(elem) for elem in zip(pg_d, pXT_d, dXT_d) - ] - - ag_t = [ - np.concatenate(elem) for elem in zip(pg_t, pXT_t, dXT_t) - ] - - pbar.update(1) pbar.set_description("{0}".format(self.pb_ag_text[4])) - + + apg_d = [np.concatenate(elem) for elem in zip(pg_d, pXT_n, dXT_n)] + apg_t = [np.concatenate(elem) for elem in zip(pg_t, pXT_t, dXT_t)] Ap_d = [] Ap_t = [] - - for list_ag_d, list_ag_t in zip(ag_d, ag_t): - - _list_Ap_d = [] - _list_Ap_t = [] + for list_apg_d, list_apg_t in zip(apg_d, apg_t): + _Apd_list = [] + _Apt_list = [] - for d, t in zip(list_ag_d, list_ag_t): + for d, t in zip(list_apg_d, list_apg_t): if(d>0): @@ -488,11 +478,11 @@ class SiPMSimulation: _Apd = [] _Apt = [] - _list_Ap_d.extend(list(_Apd)) - _list_Ap_t.extend(list(_Apt)) + _Apd_list.extend(list(_Apd)) + _Apt_list.extend(list(_Apt)) - Ap_d.append(_list_Ap_d) - Ap_t.append(_list_Ap_t) + Ap_d.append(_Apd_list) + Ap_t.append(_Apt_list) Ap_d = np.array(Ap_d) Ap_t = np.array(Ap_t) @@ -502,18 +492,16 @@ class SiPMSimulation: pbar.update(1) pbar.set_description("{0}".format(self.pb_ag_text[5])) - ag_d = [ - np.concatenate(elem) - for elem in zip(ag_d, Ap_d) + np.concatenate( (list_pg_d, list_pXT_d, list_dXT_d, list_Ap_d)) + for list_pg_d, list_pXT_d, list_dXT_d, list_Ap_d, in zip(pg_d, pXT_d, dXT_d, Ap_d) ] ag_t = [ - np.concatenate(elem) - for elem in zip(ag_t, Ap_t) + np.concatenate( (list_pg_t, list_pXT_t, list_dXT_t, list_Ap_t)) + for list_pg_t, list_pXT_t, list_dXT_t, list_Ap_t, in zip(pg_t, pXT_t, dXT_t, Ap_t) ] - ns.ag_d = ag_d ns.ag_t = ag_t