diff --git a/notebooks/.gitignore b/notebooks/.gitignore
new file mode 100644
index 00000000..4e38c559
--- /dev/null
+++ b/notebooks/.gitignore
@@ -0,0 +1,4 @@
+.ipynb_checkpoints
+resource_cache
+strax_data
+*.csv
\ No newline at end of file
diff --git a/notebooks/Advanced_tricks.ipynb b/notebooks/Advanced_tricks.ipynb
index 0189a7c2..2512a1cf 100644
--- a/notebooks/Advanced_tricks.ipynb
+++ b/notebooks/Advanced_tricks.ipynb
@@ -384,7 +384,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -398,7 +398,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.5"
+ "version": "3.9.17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
diff --git a/notebooks/Getting_started_wfsim.ipynb b/notebooks/Getting_started_wfsim.ipynb
index d93f4ea5..c50c3281 100644
--- a/notebooks/Getting_started_wfsim.ipynb
+++ b/notebooks/Getting_started_wfsim.ipynb
@@ -50,6 +50,110 @@
"import json"
]
},
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ntauxfiles is not installed\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "
\n",
" \n",
" 0 | \n",
+ " gain_model_mc | \n",
+ " cmt://to_pe_model?version=ONLINE&run_id=plugin... | \n",
+ " cmt://to_pe_model?run_id=00001&version=ONLINE | \n",
+ " (raw_records, raw_records_he, raw_records_aqmo... | \n",
+ " PMT gain model. Specify as (model_type, model_... | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
" detector | \n",
" XENONnT | \n",
" XENONnT | \n",
@@ -595,7 +709,7 @@
" | \n",
"
\n",
" \n",
- " 1 | \n",
+ " 2 | \n",
" event_rate | \n",
" 1000 | \n",
" 5 | \n",
@@ -603,23 +717,31 @@
" Average number of events per second | \n",
"
\n",
" \n",
- " 2 | \n",
+ " 3 | \n",
" chunk_size | \n",
" 100 | \n",
- " 10 | \n",
+ " 1 | \n",
" (raw_records, raw_records_he, raw_records_aqmo... | \n",
" Duration of each chunk in seconds | \n",
"
\n",
" \n",
- " 3 | \n",
- " nchunk | \n",
+ " 4 | \n",
+ " n_chunk | \n",
" 10 | \n",
- " 1 | \n",
+ " <OMITTED> | \n",
" (raw_records, raw_records_he, raw_records_aqmo... | \n",
" Number of chunks to simulate | \n",
"
\n",
" \n",
- " 4 | \n",
+ " 5 | \n",
+ " per_pmt_truth | \n",
+ " False | \n",
+ " <OMITTED> | \n",
+ " (raw_records, raw_records_he, raw_records_aqmo... | \n",
+ " Store the info per channel in the truth file | \n",
+ "
\n",
+ " \n",
+ " 6 | \n",
" fax_file | \n",
" None | \n",
" path_to_g4_file | \n",
@@ -627,7 +749,7 @@
" Directory with fax instructions | \n",
"
\n",
" \n",
- " 5 | \n",
+ " 7 | \n",
" fax_config | \n",
" fax_config_nt_design.json | \n",
" fax_config_nt_design.json | \n",
@@ -635,7 +757,7 @@
" | \n",
"
\n",
" \n",
- " 6 | \n",
+ " 8 | \n",
" fax_config_override | \n",
" None | \n",
" <OMITTED> | \n",
@@ -643,7 +765,7 @@
" Dictionary with configuration option overrides | \n",
"
\n",
" \n",
- " 7 | \n",
+ " 9 | \n",
" fax_config_override_from_cmt | \n",
" None | \n",
" {'drift_time_gate': ('cmt_run_id', '00001', 'e... | \n",
@@ -651,15 +773,7 @@
" Dictionary of fax parameter names (key) mapped... | \n",
"
\n",
" \n",
- " 8 | \n",
- " gain_model_mc | \n",
- " (to_pe_per_run, to_pe_nt.npy) | \n",
- " (cmt_run_id, 00001, to_pe_model, v4, True) | \n",
- " (raw_records, raw_records_he, raw_records_aqmo... | \n",
- " PMT gain model. Specify as (model_type, model_... | \n",
- "
\n",
- " \n",
- " 9 | \n",
+ " 10 | \n",
" channel_map | \n",
" <OMITTED> | \n",
" (tpc, he, aqmon, aqmon_nv, tpc_blank, mv, aux_... | \n",
@@ -667,7 +781,7 @@
" immutabledict mapping subdetector to (min, max... | \n",
"
\n",
" \n",
- " 10 | \n",
+ " 11 | \n",
" n_tpc_pmts | \n",
" <OMITTED> | \n",
" 494 | \n",
@@ -675,7 +789,7 @@
" Number of pmts in tpc. Provided by context | \n",
"
\n",
" \n",
- " 11 | \n",
+ " 12 | \n",
" n_top_pmts | \n",
" <OMITTED> | \n",
" 253 | \n",
@@ -683,7 +797,7 @@
" Number of pmts in top array. Provided by context | \n",
"
\n",
" \n",
- " 12 | \n",
+ " 13 | \n",
" right_raw_extension | \n",
" 100000 | \n",
" <OMITTED> | \n",
@@ -691,7 +805,7 @@
" | \n",
"
\n",
" \n",
- " 13 | \n",
+ " 14 | \n",
" seed | \n",
" False | \n",
" <OMITTED> | \n",
@@ -699,15 +813,15 @@
" Option for setting the seed of the random numb... | \n",
"
\n",
" \n",
- " 14 | \n",
- " neutron_veto | \n",
- " False | \n",
+ " 15 | \n",
+ " gain_model_nv | \n",
" <OMITTED> | \n",
+ " cmt://to_pe_model_nv?run_id=00001&version=ONLINE | \n",
" (raw_records, raw_records_he, raw_records_aqmo... | \n",
- " Flag for nVeto optical simulation instead of TPC | \n",
+ " nveto gain model, provided by context | \n",
"
\n",
" \n",
- " 15 | \n",
+ " 16 | \n",
" epix_config | \n",
" {} | \n",
" path_to_config | \n",
@@ -715,7 +829,7 @@
" Dict with epix configuration | \n",
"
\n",
" \n",
- " 16 | \n",
+ " 17 | \n",
" entry_start | \n",
" 0 | \n",
" <OMITTED> | \n",
@@ -723,7 +837,7 @@
" | \n",
"
\n",
" \n",
- " 17 | \n",
+ " 18 | \n",
" entry_stop | \n",
" None | \n",
" <OMITTED> | \n",
@@ -731,7 +845,7 @@
" G4 id event number to stop at. If -1 process t... | \n",
"
\n",
" \n",
- " 18 | \n",
+ " 19 | \n",
" fax_config_nveto | \n",
" None | \n",
" path_to_nveto_config_file | \n",
@@ -739,7 +853,7 @@
" | \n",
"
\n",
" \n",
- " 19 | \n",
+ " 20 | \n",
" fax_config_override_nveto | \n",
" None | \n",
" <OMITTED> | \n",
@@ -747,14 +861,6 @@
" Dictionary with configuration option overrides | \n",
"
\n",
" \n",
- " 20 | \n",
- " gain_model_nv | \n",
- " <OMITTED> | \n",
- " (cmt_run_id, 00001, to_pe_model_nv, v2, True) | \n",
- " (raw_records, raw_records_he, raw_records_aqmo... | \n",
- " nveto gain model, provided by context | \n",
- "
\n",
- " \n",
" 21 | \n",
" targets | \n",
" (tpc,) | \n",
@@ -767,52 +873,76 @@
""
],
"text/plain": [
- " option default \\\n",
- "0 detector XENONnT \n",
- "1 event_rate 1000 \n",
- "2 chunk_size 100 \n",
- "3 nchunk 10 \n",
- "4 fax_file None \n",
- "5 fax_config fax_config_nt_design.json \n",
- "6 fax_config_override None \n",
- "7 fax_config_override_from_cmt None \n",
- "8 gain_model_mc (to_pe_per_run, to_pe_nt.npy) \n",
- "9 channel_map \n",
- "10 n_tpc_pmts \n",
- "11 n_top_pmts \n",
- "12 right_raw_extension 100000 \n",
- "13 seed False \n",
- "14 neutron_veto False \n",
- "15 epix_config {} \n",
- "16 entry_start 0 \n",
- "17 entry_stop None \n",
- "18 fax_config_nveto None \n",
- "19 fax_config_override_nveto None \n",
- "20 gain_model_nv \n",
- "21 targets (tpc,) \n",
+ " option \\\n",
+ "0 gain_model_mc \n",
+ "1 detector \n",
+ "2 event_rate \n",
+ "3 chunk_size \n",
+ "4 n_chunk \n",
+ "5 per_pmt_truth \n",
+ "6 fax_file \n",
+ "7 fax_config \n",
+ "8 fax_config_override \n",
+ "9 fax_config_override_from_cmt \n",
+ "10 channel_map \n",
+ "11 n_tpc_pmts \n",
+ "12 n_top_pmts \n",
+ "13 right_raw_extension \n",
+ "14 seed \n",
+ "15 gain_model_nv \n",
+ "16 epix_config \n",
+ "17 entry_start \n",
+ "18 entry_stop \n",
+ "19 fax_config_nveto \n",
+ "20 fax_config_override_nveto \n",
+ "21 targets \n",
+ "\n",
+ " default \\\n",
+ "0 cmt://to_pe_model?version=ONLINE&run_id=plugin... \n",
+ "1 XENONnT \n",
+ "2 1000 \n",
+ "3 100 \n",
+ "4 10 \n",
+ "5 False \n",
+ "6 None \n",
+ "7 fax_config_nt_design.json \n",
+ "8 None \n",
+ "9 None \n",
+ "10 \n",
+ "11 \n",
+ "12 \n",
+ "13 100000 \n",
+ "14 False \n",
+ "15 \n",
+ "16 {} \n",
+ "17 0 \n",
+ "18 None \n",
+ "19 None \n",
+ "20 None \n",
+ "21 (tpc,) \n",
"\n",
" current \\\n",
- "0 XENONnT \n",
- "1 5 \n",
- "2 10 \n",
+ "0 cmt://to_pe_model?run_id=00001&version=ONLINE \n",
+ "1 XENONnT \n",
+ "2 5 \n",
"3 1 \n",
- "4 path_to_g4_file \n",
- "5 fax_config_nt_design.json \n",
- "6 \n",
- "7 {'drift_time_gate': ('cmt_run_id', '00001', 'e... \n",
- "8 (cmt_run_id, 00001, to_pe_model, v4, True) \n",
- "9 (tpc, he, aqmon, aqmon_nv, tpc_blank, mv, aux_... \n",
- "10 494 \n",
- "11 253 \n",
- "12 \n",
+ "4 \n",
+ "5 \n",
+ "6 path_to_g4_file \n",
+ "7 fax_config_nt_design.json \n",
+ "8 \n",
+ "9 {'drift_time_gate': ('cmt_run_id', '00001', 'e... \n",
+ "10 (tpc, he, aqmon, aqmon_nv, tpc_blank, mv, aux_... \n",
+ "11 494 \n",
+ "12 253 \n",
"13 \n",
"14 \n",
- "15 path_to_config \n",
- "16 \n",
+ "15 cmt://to_pe_model_nv?run_id=00001&version=ONLINE \n",
+ "16 path_to_config \n",
"17 \n",
- "18 path_to_nveto_config_file \n",
- "19 \n",
- "20 (cmt_run_id, 00001, to_pe_model_nv, v2, True) \n",
+ "18 \n",
+ "19 path_to_nveto_config_file \n",
+ "20 \n",
"21 \n",
"\n",
" applies_to \\\n",
@@ -840,31 +970,31 @@
"21 (raw_records, raw_records_he, raw_records_aqmo... \n",
"\n",
" help \n",
- "0 \n",
- "1 Average number of events per second \n",
- "2 Duration of each chunk in seconds \n",
- "3 Number of chunks to simulate \n",
- "4 Directory with fax instructions \n",
- "5 \n",
- "6 Dictionary with configuration option overrides \n",
- "7 Dictionary of fax parameter names (key) mapped... \n",
- "8 PMT gain model. Specify as (model_type, model_... \n",
- "9 immutabledict mapping subdetector to (min, max... \n",
- "10 Number of pmts in tpc. Provided by context \n",
- "11 Number of pmts in top array. Provided by context \n",
- "12 \n",
- "13 Option for setting the seed of the random numb... \n",
- "14 Flag for nVeto optical simulation instead of TPC \n",
- "15 Dict with epix configuration \n",
- "16 \n",
- "17 G4 id event number to stop at. If -1 process t... \n",
- "18 \n",
- "19 Dictionary with configuration option overrides \n",
- "20 nveto gain model, provided by context \n",
+ "0 PMT gain model. Specify as (model_type, model_... \n",
+ "1 \n",
+ "2 Average number of events per second \n",
+ "3 Duration of each chunk in seconds \n",
+ "4 Number of chunks to simulate \n",
+ "5 Store the info per channel in the truth file \n",
+ "6 Directory with fax instructions \n",
+ "7 \n",
+ "8 Dictionary with configuration option overrides \n",
+ "9 Dictionary of fax parameter names (key) mapped... \n",
+ "10 immutabledict mapping subdetector to (min, max... \n",
+ "11 Number of pmts in tpc. Provided by context \n",
+ "12 Number of pmts in top array. Provided by context \n",
+ "13 \n",
+ "14 Option for setting the seed of the random numb... \n",
+ "15 nveto gain model, provided by context \n",
+ "16 Dict with epix configuration \n",
+ "17 \n",
+ "18 G4 id event number to stop at. If -1 process t... \n",
+ "19 \n",
+ "20 Dictionary with configuration option overrides \n",
"21 tuple with what data to simulate (tpc, nveto o... "
]
},
- "execution_count": 14,
+ "execution_count": 86,
"metadata": {},
"output_type": "execute_result"
}
@@ -882,7 +1012,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 87,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:14.750813Z",
@@ -896,7 +1026,7 @@
"'fax_config_nt_design.json'"
]
},
- "execution_count": 15,
+ "execution_count": 87,
"metadata": {},
"output_type": "execute_result"
}
@@ -914,7 +1044,7 @@
},
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 88,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:15.048319Z",
@@ -925,10 +1055,10 @@
{
"data": {
"text/plain": [
- "dict_keys(['s1_model_type', 's2_luminescence_model', 'enable_gas_gap_warping', 'enable_pmt_afterpulses', 'enable_electron_afterpulses', 'enable_noise', 'field_distortion_on', 'enable_field_dependencies', 'url_base', 'photon_area_distribution', 's1_pattern_map', 's2_pattern_map', 'photon_ap_cdfs', 's2_luminescence', 'gas_gap_map', 'temperature', 'pressure', 'lxe_dielectric_constant', 'tpc_length', 'tpc_radius', 'anode_wire_radius', 'anode_field_domination_distance', 'elr_gas_gap_length', 'gate_to_anode_distance', 'drift_field', 'anode_voltage', 'diffusion_constant_longitudinal', 'diffusion_constant_transverse', 'drift_time_gate', 'drift_velocity_liquid', 'singlet_fraction_gas', 'singlet_lifetime_gas', 'singlet_lifetime_liquid', 'triplet_lifetime_gas', 'triplet_lifetime_liquid', 's1_ER_alpha_singlet_fraction', 's1_ER_primary_singlet_fraction', 's1_ER_recombination_fraction', 's1_ER_recombination_time', 's1_ER_secondary_singlet_fraction', 's1_NR_singlet_fraction', 'maximum_recombination_time', 's1_decay_spread', 's1_decay_time', 's1_detection_efficiency', 's2_mean_area_fraction_top', 's2_secondary_sc_gain', 's2_time_spread', 'electron_extraction_yield', 'electron_lifetime_liquid', 'electron_trapping_time', 'gas_drift_velocity_slope', 'p_double_pe_emision', 'pe_pulse_ts', 'pe_pulse_ys', 'pmt_ap_modifier', 'pmt_ap_t_modifier', 'pmt_pulse_time_rounding', 'pmt_transit_time_mean', 'pmt_transit_time_spread', 'photoelectric_modifier', 'photoelectric_p', 'photoelectric_t_center', 'photoelectric_t_spread', 'photoionization_modifier', 'sample_duration', 'samples_after_pulse_center', 'samples_before_pulse_center', 'samples_to_store_after', 'samples_to_store_before', 'pmt_circuit_load_resistor', 'external_amplification', 'high_energy_deamplification_factor', 'trigger_window', 'digitizer_bits', 'digitizer_reference_baseline', 'digitizer_voltage_range', 'special_thresholds', 'zle_threshold'])"
+ "dict_keys(['s1_model_type', 's2_time_model', 's2_luminescence_model', 's2_garfield_confine_position', 'se_gain_from_map', 'ext_eff_from_map', 'enable_gas_gap_warping', 'enable_pmt_afterpulses', 'enable_electron_afterpulses', 'enable_noise', 'field_distortion_on', 'field_distortion_model', 'enable_field_dependencies', 'url_base', 'photon_area_distribution', 's1_pattern_map', 's2_pattern_map', 's1_lce_correction_map', 's2_correction_map', 'se_gain_map', 's1_time_spline', 's2_time_spline', 'field_distortion_comsol_map', 'photon_ap_cdfs', 'noise_file', 's2_luminescence_gg', 's2_luminescence', 'gas_gap_map', 'garfield_gas_gap_map', 'field_dependencies_map', 'temperature', 'pressure', 'lxe_dielectric_constant', 'tpc_length', 'tpc_radius', 'anode_wire_radius', 'anode_field_domination_distance', 'elr_gas_gap_length', 'gate_to_anode_distance', 'drift_field', 'anode_voltage', 'diffusion_constant_longitudinal', 'diffusion_constant_transverse', 'drift_time_gate', 'drift_velocity_liquid', 'singlet_fraction_gas', 'singlet_lifetime_gas', 'singlet_lifetime_liquid', 'triplet_lifetime_gas', 'triplet_lifetime_liquid', 's1_ER_alpha_singlet_fraction', 's1_ER_primary_singlet_fraction', 's1_ER_recombination_fraction', 's1_ER_recombination_time', 's1_ER_secondary_singlet_fraction', 's1_NR_singlet_fraction', 'maximum_recombination_time', 's1_decay_spread', 's1_decay_time', 's1_detection_efficiency', 's2_mean_area_fraction_top', 's2_aft_sigma', 's2_aft_skewness', 's2_secondary_sc_gain', 's2_time_spread', 'electron_extraction_yield', 'electron_lifetime_liquid', 'electron_trapping_time', 'gas_drift_velocity_slope', 'g2_mean', 'p_double_pe_emision', 'pe_pulse_ts', 'pe_pulse_ys', 'pmt_ap_modifier', 'pmt_ap_t_modifier', 'pmt_pulse_time_rounding', 'pmt_transit_time_mean', 'pmt_transit_time_spread', 'photoelectric_modifier', 'photoelectric_p', 'photoelectric_t_center', 'photoelectric_t_spread', 'photoionization_modifier', 'sample_duration', 'samples_after_pulse_center', 'samples_before_pulse_center', 'samples_to_store_after', 'samples_to_store_before', 'pmt_circuit_load_resistor', 'external_amplification', 'high_energy_deamplification_factor', 'trigger_window', 'digitizer_bits', 'digitizer_reference_baseline', 'digitizer_voltage_range', 'special_thresholds', 'zle_threshold'])"
]
},
- "execution_count": 16,
+ "execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
@@ -947,7 +1077,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 89,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:15.055554Z",
@@ -976,7 +1106,7 @@
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 90,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:15.063269Z",
@@ -1036,7 +1166,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 91,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:15.088492Z",
@@ -1046,12 +1176,12 @@
"outputs": [],
"source": [
"st = straxen.contexts.xenonnt_simulation(cmt_run_id_sim='00001')\n",
- "st.set_config(dict(nchunk=1, event_rate=5, chunk_size=5, fax_file=None))"
+ "st.set_config(dict(event_rate=5, chunk_size=1, fax_file=None))"
]
},
{
"cell_type": "code",
- "execution_count": 20,
+ "execution_count": 92,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:48.016971Z",
@@ -1063,7 +1193,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "369591f713184bd3b1ebffec562ecc5d",
+ "model_id": "de3ee32e0c354d6ba875c1855eb5d05e",
"version_major": 2,
"version_minor": 0
},
@@ -1077,7 +1207,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "7e690535c119454eb967a508ddc2c1e0",
+ "model_id": "fa9964d51b74435691e1df2f49253f04",
"version_major": 2,
"version_minor": 0
},
@@ -1109,7 +1239,7 @@
},
{
"cell_type": "code",
- "execution_count": 21,
+ "execution_count": 93,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:55.867868Z",
@@ -1120,7 +1250,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "809fba5e30704dfb9293479dd4037abd",
+ "model_id": "37817cd1ea694f1ba80da900b7c911fb",
"version_major": 2,
"version_minor": 0
},
@@ -1138,7 +1268,7 @@
},
{
"cell_type": "code",
- "execution_count": 22,
+ "execution_count": 94,
"metadata": {
"ExecuteTime": {
"end_time": "2021-05-10T12:46:55.889545Z",
@@ -1171,9 +1301,11 @@
" endtime | \n",
" center_time | \n",
" area | \n",
+ " n_hits | \n",
" n_channels | \n",
" max_pmt | \n",
" max_pmt_area | \n",
+ " n_saturated_channels | \n",
" range_50p_area | \n",
" range_90p_area | \n",
" area_fraction_top | \n",
@@ -1182,232 +1314,286 @@
" rise_time | \n",
" tight_coincidence | \n",
" type | \n",
+ " max_diff | \n",
+ " min_diff | \n",
"
\n",
" \n",
"