diff --git a/wfsim/core/afterpulse.py b/wfsim/core/afterpulse.py index c7b3302a..c397c5d4 100644 --- a/wfsim/core/afterpulse.py +++ b/wfsim/core/afterpulse.py @@ -33,8 +33,9 @@ def electron_afterpulse(self, signal_pulse, signal_pulse_instruction): delaytime_pmf_hist = self.resource.uniform_to_ele_ap # To save calculation we first find out how many photon will give rise ap + # Number of "created electrons" in liquid xenon n_electron = np.random.poisson(delaytime_pmf_hist.n - * len(signal_pulse._photon_timings) + * len(signal_pulse._photon_timings) # Number of "detected" photons * self.config['photoionization_modifier']) ap_delay = delaytime_pmf_hist.get_random(n_electron) diff --git a/wfsim/load_resource.py b/wfsim/load_resource.py index 65848b47..038e5fc7 100644 --- a/wfsim/load_resource.py +++ b/wfsim/load_resource.py @@ -96,7 +96,6 @@ def config_to_file(config): "s2_luminescence_gg": "garfield_timing_map_gas_gap_sr0.npy", 'gas_gap_map': 'gas_gap_warping_map_January_2021.pkl', 'garfield_gas_gap_map': 'garfield_gas_gap_map_sr0.json', - 'ele_ap_pdfs': 'x1t_se_afterpulse_delaytime.pkl.gz', 'noise_file': 'x1t_noise_170203_0850_00_small.npz', 'fdc_3d': 'XnT_3D_FDC_xyt_dummy_all_zeros_v0.1.json.gz', 'field_dependencies_map': '', @@ -359,7 +358,7 @@ def _rz_map(z, xy, **kwargs): # Electron After Pulses if config.get('enable_electron_afterpulses', False): - self.uniform_to_ele_ap = straxen.get_resource(files['ele_ap_pdfs'], fmt='pkl.gz') + self.uniform_to_ele_ap = straxen.get_resource(config.get('ele_ap_pdfs', ''), fmt='dill') # S2 photons timing optical propagation delays if config.get('s2_time_spline', False):