diff --git a/docs/source/build_plugin_pages.py b/docs/source/build_plugin_pages.py index 6e10ddb5..bba3be97 100644 --- a/docs/source/build_plugin_pages.py +++ b/docs/source/build_plugin_pages.py @@ -10,9 +10,9 @@ tpc_interactions="#F44E43", below_cathode_interactions="#F44E43", interactions_in_roi="#56C46C", - S1_photons="#54E4CF", - S2_photons="#54E4CF", - AP_photons="#54E4CF", + s1_photons="#54E4CF", + s2_photons="#54E4CF", + ap_photons="#54E4CF", propagated_photons="#54E4CF", pulse_ids="#54E4CF", pulse_windows="#F78C27", diff --git a/fuse/common.py b/fuse/common.py index caef2102..2c6d3a9f 100644 --- a/fuse/common.py +++ b/fuse/common.py @@ -24,11 +24,9 @@ def dynamic_chunking(data, scale, n_min): if value <= scale: clusters.append(c) n_cluster += 1 - elif n_cluster + 1 < n_min: clusters.append(c) n_cluster += 1 - elif value > scale: c = c + 1 clusters.append(c) diff --git a/fuse/plugin.py b/fuse/plugin.py index ff651c40..58defdd6 100644 --- a/fuse/plugin.py +++ b/fuse/plugin.py @@ -26,12 +26,12 @@ class FuseBasePlugin(strax.Plugin): deterministic_seed = straxen.URLConfig( default=True, type=bool, - help="Set the random seed from lineage and run_id, or pull the seed from the OS.", + help="Set the random seed from lineage and run_id, or pull the seed from the OS", ) user_defined_random_seed = straxen.URLConfig( default=None, - help="Define the random seed manually. You need to set deterministic_seed to False.", + help="Define the random seed manually. You need to set deterministic_seed to False", ) def setup(self): diff --git a/fuse/plugins/detector_physics/csv_input.py b/fuse/plugins/detector_physics/csv_input.py index 47e742b7..949b06a4 100644 --- a/fuse/plugins/detector_physics/csv_input.py +++ b/fuse/plugins/detector_physics/csv_input.py @@ -20,7 +20,7 @@ class ChunkCsvInput(FuseBasePlugin): """Plugin which reads a CSV file containing instructions for the detector physics simulation and returns the data in chunks.""" - __version__ = "0.2.0" + __version__ = "0.2.1" depends_on: Tuple = tuple() provides = "microphysics_summary" @@ -34,9 +34,9 @@ class ChunkCsvInput(FuseBasePlugin): (("x position of the cluster [cm]", "x"), np.float32), (("y position of the cluster [cm]", "y"), np.float32), (("z position of the cluster [cm]", "z"), np.float32), - (("Number of photons at interaction position.", "photons"), np.int32), - (("Number of electrons at interaction position.", "electrons"), np.int32), - (("Number of excitons at interaction position.", "excitons"), np.int32), + (("Number of photons at interaction position", "photons"), np.int32), + (("Number of electrons at interaction position", "electrons"), np.int32), + (("Number of excitons at interaction position", "excitons"), np.int32), (("Electric field value at the cluster position [V/cm]", "e_field"), np.float32), (("Energy of the cluster [keV]", "ed"), np.float32), (("NEST interaction type", "nestid"), np.int8), @@ -62,15 +62,15 @@ class ChunkCsvInput(FuseBasePlugin): separation_scale = straxen.URLConfig( default=1e8, type=(int, float), - help="separation_scale", + help="Start a new chunk when the previous cluster is separated by this time scale", ) source_rate = straxen.URLConfig( default=1, type=(int, float), - help="Source rate used to generate event times" - "Use a value >0 to generate event times in fuse" - "Use source_rate = 0 to use event times from the input file (only for csv input)", + help="Source rate used to generate event times. " + "Use a value >0 to generate event times in fuse. " + "Use source_rate = 0 to use event times from the input file (only for csv input).", ) n_interactions_per_chunk = straxen.URLConfig( @@ -150,9 +150,9 @@ def __init__( (("x position of the cluster [cm]", "x"), np.float32), (("y position of the cluster [cm]", "y"), np.float32), (("z position of the cluster [cm]", "z"), np.float32), - (("Number of photons at interaction position.", "photons"), np.int32), - (("Number of electrons at interaction position.", "electrons"), np.int32), - (("Number of excitons at interaction position.", "excitons"), np.int32), + (("Number of photons at interaction position", "photons"), np.int32), + (("Number of electrons at interaction position", "electrons"), np.int32), + (("Number of excitons at interaction position", "excitons"), np.int32), (("Electric field value at the cluster position [V/cm]", "e_field"), np.float32), (("Energy of the cluster [keV]", "ed"), np.float32), (("NEST interaction type", "nestid"), np.int8), @@ -225,7 +225,7 @@ def output_chunk(self): chunk_bounds = chunk_end + np.int64(self.chunk_delay_fraction * gap_length) self.chunk_bounds = np.append(chunk_start[0] - self.first_chunk_left, chunk_bounds) else: - log.warning("Only one Chunk! Rate to high?") + log.warning("Only one Chunk! Rate too high?") self.chunk_bounds = [ chunk_start[0] - self.first_chunk_left, chunk_end[0] + self.last_chunk_length, diff --git a/fuse/plugins/detector_physics/electron_timing.py b/fuse/plugins/detector_physics/electron_timing.py index d97dba72..7ca50c20 100644 --- a/fuse/plugins/detector_physics/electron_timing.py +++ b/fuse/plugins/detector_physics/electron_timing.py @@ -20,16 +20,14 @@ class ElectronTiming(FuseBasePlugin): extraction. """ - __version__ = "0.2.0" + __version__ = "0.2.1" - depends_on = ("drifted_electrons", "extracted_electrons", "microphysics_summary") + depends_on = ("microphysics_summary", "drifted_electrons", "extracted_electrons") provides = "electron_time" data_kind = "individual_electrons" save_when = strax.SaveWhen.TARGET - data_kind = "individual_electrons" - dtype = [ (("x position of the electron [cm]", "x"), np.float32), (("y position of the electron [cm]", "y"), np.float32), diff --git a/fuse/plugins/detector_physics/s1_photon_propagation.py b/fuse/plugins/detector_physics/s1_photon_propagation.py index b930b462..62f26a5a 100644 --- a/fuse/plugins/detector_physics/s1_photon_propagation.py +++ b/fuse/plugins/detector_physics/s1_photon_propagation.py @@ -32,11 +32,11 @@ class S1PhotonPropagationBase(FuseBasePlugin): Note: The timing calculation is defined in the child plugin. """ - __version__ = "0.3.0" + __version__ = "0.3.1" - depends_on = ("s1_photons", "microphysics_summary") + depends_on = ("microphysics_summary", "s1_photons") provides = "propagated_s1_photons" - data_kind = "S1_photons" + data_kind = "s1_photons" save_when = strax.SaveWhen.TARGET diff --git a/fuse/plugins/detector_physics/s2_photon_propagation.py b/fuse/plugins/detector_physics/s2_photon_propagation.py index 4b9cef4d..66b11916 100644 --- a/fuse/plugins/detector_physics/s2_photon_propagation.py +++ b/fuse/plugins/detector_physics/s2_photon_propagation.py @@ -32,18 +32,18 @@ class S2PhotonPropagationBase(FuseBaseDownChunkingPlugin): Note: The timing calculation is defined in the child plugin. """ - __version__ = "0.3.2" + __version__ = "0.3.3" depends_on = ( - "electron_time", - "s2_photons", + "microphysics_summary", "extracted_electrons", "drifted_electrons", "s2_photons_sum", - "microphysics_summary", + "electron_time", + "s2_photons", ) provides = "propagated_s2_photons" - data_kind = "S2_photons" + data_kind = "s2_photons" save_when = strax.SaveWhen.TARGET @@ -318,7 +318,7 @@ def rz_map(z, xy, **kwargs): self.field_dependencies_map = rz_map - def compute(self, individual_electrons, interactions_in_roi, start, end): + def compute(self, interactions_in_roi, individual_electrons, start, end): # Just apply this to clusters with photons mask = interactions_in_roi["n_electron_extracted"] > 0 @@ -689,14 +689,14 @@ class S2PhotonPropagationSimple(S2PhotonPropagationBase): default="take://resource://SIMULATION_CONFIG_FILE.json?&fmt=json&take=pressure", type=(int, float), cache=True, - help="pressure", + help="Pressure of liquid xenon [bar/e], while e is the elementary charge", ) temperature = straxen.URLConfig( default="take://resource://SIMULATION_CONFIG_FILE.json?&fmt=json&take=temperature", type=(int, float), cache=True, - help="temperature", + help="Temperature of liquid xenon [K]", ) gas_drift_velocity_slope = straxen.URLConfig( @@ -759,14 +759,14 @@ class S2PhotonPropagationSimple(S2PhotonPropagationBase): "&take=gate_to_anode_distance", type=(int, float), cache=True, - help="gate_to_anode_distance", + help="Top of gate to bottom of anode (not considering perpendicular wires) [cm]", ) anode_voltage = straxen.URLConfig( default="take://resource://SIMULATION_CONFIG_FILE.json?&fmt=json&take=anode_voltage", type=(int, float), cache=True, - help="anode_voltage", + help="Voltage of anode [V]", ) lxe_dielectric_constant = straxen.URLConfig( diff --git a/fuse/plugins/detector_physics/secondary_scintillation.py b/fuse/plugins/detector_physics/secondary_scintillation.py index cb970945..a8811195 100644 --- a/fuse/plugins/detector_physics/secondary_scintillation.py +++ b/fuse/plugins/detector_physics/secondary_scintillation.py @@ -25,10 +25,10 @@ class SecondaryScintillation(FuseBasePlugin): result_name_photons_sum = "s2_photons_sum" depends_on = ( + "microphysics_summary", "drifted_electrons", "extracted_electrons", "electron_time", - "microphysics_summary", ) provides = (result_name_photons, result_name_photons_sum) data_kind = { diff --git a/fuse/plugins/micro_physics/detector_volumes.py b/fuse/plugins/micro_physics/detector_volumes.py index 3cddd71f..18125376 100644 --- a/fuse/plugins/micro_physics/detector_volumes.py +++ b/fuse/plugins/micro_physics/detector_volumes.py @@ -41,7 +41,7 @@ class XENONnT_TPC(VolumePlugin): provides = "tpc_interactions" data_kind = "tpc_interactions" - __version__ = "0.3.0" + __version__ = "0.3.1" # Can we import this from MergeCluster and just add the needed fields? dtype = [ @@ -57,9 +57,9 @@ class XENONnT_TPC(VolumePlugin): (("y position of the primary particle [cm]", "y_pri"), np.float32), (("z position of the primary particle [cm]", "z_pri"), np.float32), (("ID of the cluster", "cluster_id"), np.int32), - (("Xenon density at the cluster position.", "xe_density"), np.float32), - (("ID of the volume in which the cluster occured.", "vol_id"), np.int8), - (("Flag indicating if a cluster can create a S2 signal.", "create_S2"), np.bool_), + (("Xenon density at the cluster position", "xe_density"), np.float32), + (("ID of the volume in which the cluster occured", "vol_id"), np.int8), + (("Flag indicating if a cluster can create a S2 signal", "create_S2"), np.bool_), ] dtype = dtype + strax.time_fields @@ -126,7 +126,7 @@ class XENONnT_BelowCathode(VolumePlugin): provides = "below_cathode_interactions" data_kind = "below_cathode_interactions" - __version__ = "0.3.0" + __version__ = "0.3.1" # Can we import this from MergeCluster and just add the needed fields? dtype = [ @@ -142,9 +142,9 @@ class XENONnT_BelowCathode(VolumePlugin): (("y position of the primary particle [cm]", "y_pri"), np.float32), (("z position of the primary particle [cm]", "z_pri"), np.float32), (("ID of the cluster", "cluster_id"), np.int32), - (("Xenon density at the cluster position.", "xe_density"), np.float32), - (("ID of the volume in which the cluster occured.", "vol_id"), np.int8), - (("Flag indicating if a cluster can create a S2 signal.", "create_S2"), np.bool_), + (("Xenon density at the cluster position", "xe_density"), np.float32), + (("ID of the volume in which the cluster occured", "vol_id"), np.int8), + (("Flag indicating if a cluster can create a S2 signal", "create_S2"), np.bool_), ] dtype = dtype + strax.time_fields @@ -209,7 +209,7 @@ class XENONnT_GasPhase(VolumePlugin): provides = "gas_phase_interactions" data_kind = "gas_phase_interactions" - __version__ = "0.3.0" + __version__ = "0.3.1" # Can we import this from MergeCluster and just add the needed fields? dtype = [ @@ -225,9 +225,9 @@ class XENONnT_GasPhase(VolumePlugin): (("y position of the primary particle [cm]", "y_pri"), np.float32), (("z position of the primary particle [cm]", "z_pri"), np.float32), (("ID of the cluster", "cluster_id"), np.int32), - (("Xenon density at the cluster position.", "xe_density"), np.float32), - (("ID of the volume in which the cluster occured.", "vol_id"), np.int8), - (("Flag indicating if a cluster can create a S2 signal.", "create_S2"), np.bool_), + (("Xenon density at the cluster position", "xe_density"), np.float32), + (("ID of the volume in which the cluster occured", "vol_id"), np.int8), + (("Flag indicating if a cluster can create a S2 signal", "create_S2"), np.bool_), ] dtype = dtype + strax.time_fields @@ -237,31 +237,31 @@ class XENONnT_GasPhase(VolumePlugin): xenonnt_z_top_pmts = straxen.URLConfig( default=7.3936, # cm type=(int, float), - help="xenonnt_z_top_pmts", + help="Position of the top of gas phase [cm]", ) xenonnt_z_lxe = straxen.URLConfig( default=0.416, # cm ... liquid-gas interface type=(int, float), - help="xenonnt_z_lxe", + help="Position of the bottom of gas phase [cm]", ) xenonnt_sensitive_volume_radius = straxen.URLConfig( default=66.4, # cm type=(int, float), - help="xenonnt_sensitive_volume_radius", + help="Radius of the XENONnT TPC [cm]", ) xenon_density_gas_phase = straxen.URLConfig( default=0.0177, type=(int, float), - help="xenon_density", + help="Density of XENON in the gas phase [g/cm3]", ) create_S2_xenonnt_gas_phase = straxen.URLConfig( default=False, type=bool, - help="No S2s in gas", + help="Whether generate S2s in gas phase", ) def compute(self, clustered_interactions): diff --git a/fuse/plugins/micro_physics/electric_field.py b/fuse/plugins/micro_physics/electric_field.py index f81a5a6e..3f223270 100644 --- a/fuse/plugins/micro_physics/electric_field.py +++ b/fuse/plugins/micro_physics/electric_field.py @@ -18,7 +18,7 @@ class ElectricField(FuseBasePlugin): __version__ = "0.2.2" - depends_on = ("interactions_in_roi",) + depends_on = "interactions_in_roi" provides = "electric_field_values" data_kind = "interactions_in_roi" diff --git a/fuse/plugins/micro_physics/input.py b/fuse/plugins/micro_physics/input.py index c18e89c0..276e885a 100644 --- a/fuse/plugins/micro_physics/input.py +++ b/fuse/plugins/micro_physics/input.py @@ -27,7 +27,7 @@ class ChunkInput(FuseBasePlugin): and will create multiple chunks of data if needed. """ - __version__ = "0.3.1" + __version__ = "0.3.2" depends_on: Tuple = tuple() provides = "geant4_interactions" @@ -47,9 +47,9 @@ class ChunkInput(FuseBasePlugin): (("Geant4 process creating the particle", "creaproc"), "