wfsim package
Submodules
wfsim.load_resource module
- class wfsim.load_resource.DummyMap(const, shape=())[source]
Bases:
object
Return constant results the length match the length of input but from the second dimensions the shape is user defined input
- class wfsim.load_resource.Resource(config=None)[source]
Bases:
object
- Get the configs needed for running WFSim. Configs can be obtained in
two ways: 1. Get it directly from the mongo database. This only needs the
name of the file.
- Load it with straxen get_resource, this can either:
Download from a public repository Read from local cache Download from a private repository if credentials are properly setup
- static config_to_file(config)[source]
Find and complete all file paths
returns dictionary mapping item name to path
- static get_file_path(base, fname)[source]
Find the full path to the resource file Try 4 methods in the following order 1. The base is not url, return base + name 2. If ntauxfiles (straxauxfiles) is installed, return will be package dir + name
pip install won’t work, try python setup.py in the packages
Download the latest version using straxen mongo downloader from database, return the cached file path + md5
Download using straxen get_resource from the url (github raw) simply return base + name
Be careful with the forth options, straxen creates cache files that might not be updated with the latest github commit.
wfsim.pax_interface module
- class wfsim.pax_interface.PaxEventSimulator(config=None)[source]
Bases:
object
Simulate wf from instruction and stored in wfsim.pax_datastructure.datastructure.Event mimicing pax.datastructure.Event Then pickled, compressed and saved mimicing pax raw data zips.
Call compute to start the simulation process.
- class WriteZipped(config)[source]
Bases:
object
- close_current_file()[source]
Closes the currently open file, if there is one. Also handles temporary file renaming.
- file_extension = 'zip'
wfsim.strax_interface module
- class wfsim.strax_interface.ChunkRawRecords(config, rawdata_generator=<class 'wfsim.core.rawdata.RawData'>, **kwargs)[source]
Bases:
object
- class wfsim.strax_interface.RawRecordsFromFax1T[source]
Bases:
RawRecordsFromFaxNT
- class wfsim.strax_interface.RawRecordsFromFaxNT[source]
Bases:
SimulatorPlugin
- class wfsim.strax_interface.RawRecordsFromFaxOpticalNT[source]
Bases:
RawRecordsFromFaxNT
- class wfsim.strax_interface.RawRecordsFromFaxnVeto[source]
Bases:
RawRecordsFromMcChain
- class wfsim.strax_interface.RawRecordsFromMcChain[source]
Bases:
SimulatorPlugin
- data_kind: Union[str, immutabledict, dict] = immutabledict({'raw_records': 'raw_records', 'raw_records_he': 'raw_records_he', 'raw_records_aqmon': 'raw_records_aqmon', 'raw_records_nv': 'raw_records_nv', 'truth': 'truth', 'truth_nv': 'truth_nv'})
- gain_model_nv
Dispatch on URL protocol.
unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.
- get_instructions()[source]
Run epix and save instructions as self.instructions_epix epix_config with all the epix run arguments is passed as a dictionary, where source_rate must be set to 0 (epix default), since time handling is done outside epix.
epix needs to be imported in here to avoid circle imports
- provides: tuple = ('raw_records', 'raw_records_he', 'raw_records_aqmon', 'raw_records_nv', 'truth', 'truth_nv')
- set_timing()[source]
Set timing information in such a way to synchronize instructions for the TPC and nVeto
- takes_config = immutabledict({'gain_model_mc': <straxen.url_config.URLConfig object>, 'detector': <strax.config.Option object>, 'event_rate': <strax.config.Option object>, 'chunk_size': <strax.config.Option object>, 'n_chunk': <strax.config.Option object>, 'per_pmt_truth': <strax.config.Option object>, 'fax_file': <strax.config.Option object>, 'fax_config': <strax.config.Option object>, 'fax_config_override': <strax.config.Option object>, 'fax_config_override_from_cmt': <strax.config.Option object>, 'channel_map': <strax.config.Option object>, 'n_tpc_pmts': <strax.config.Option object>, 'n_top_pmts': <strax.config.Option object>, 'right_raw_extension': <strax.config.Option object>, 'seed': <strax.config.Option object>, 'gain_model_nv': <straxen.url_config.URLConfig object>, 'epix_config': <strax.config.Option object>, 'entry_start': <strax.config.Option object>, 'entry_stop': <strax.config.Option object>, 'fax_config_nveto': <strax.config.Option object>, 'fax_config_override_nveto': <strax.config.Option object>, 'targets': <strax.config.Option object>})
- class wfsim.strax_interface.RawRecordsFromMcChain1T[source]
Bases:
RawRecordsFromMcChain
- wfsim.strax_interface.extra_truth_dtype_per_pmt(n_pmt: bool | int) List[tuple] [source]
Generate the extra - truth dtype output
Return total/bottom seperation from truth_extra_dtype if n_pmt is False
- Parameters:
n_pmt – Number of PMTs, when false (no PMTs, use total/bottom separation)
- Returns:
dtype list
wfsim.units module
Define unit system for pax (i.e., seconds, etc.) This sets up variables for the various unit abbreviations, ensuring we always have a ‘consistent’ unit system. There are almost no cases that you should change this without talking with a maintainer.
wfsim.utils module
- wfsim.utils.find_intervals_below_threshold(w, threshold, holdoff, result_buffer)[source]
Fills result_buffer with l, r bounds of intervals in w < threshold. :param w: Waveform to do hitfinding in :param threshold: Threshold for including an interval :param holdoff: Holdoff number of samples after the pulse return back down to threshold :param result_buffer: numpy N*2 array of ints, will be filled by function.
if more than N intervals are found, none past the first N will be processed.
:returns : number of intervals processed Boundary indices are inclusive, i.e. the right boundary is the last index which was < threshold
- wfsim.utils.optical_adjustment(instructions, timings, channels)[source]
Helper function to process optical instructions so that for each entry 1) Move the instruction timing to the first photon in the entry and move photon timings 2) Split photon timing into maximum interval of PULSE_MAX_DURATION default 1us
The split photon are put into new instruction append at the end of the instructions