API

Modules

Types and constants

Functions and macros

Documentation

LegendGeSim.DAQType

The DAQ supertype corresponds to the component of the DAQ and electronics setup that saves the waveform after it triggered

source
LegendGeSim.DAQMethod
DAQ(sim_conf)

LegendGeSimConfig -> <DAQ>

Construct a DAQ supertype struct based on given simulation configuration. Type of returned instance depends on settings in <sim_conf> Currently only one type of DAQ available (GenericDAQ), rendering this function temporarily redundant.

source
LegendGeSim.ElecChainType

The ElecChain supertype corresponds to the chain of electronic components involved in the DAQ setup that appear before the trigger.

source
LegendGeSim.ElecChainMethod
ElecChain(sim_conf)

LegendGeSimConfig -> <ElecChain>

Construct an ElecChain supertype struct based on given simulation configuration. Type of returned instance depends on settings in <sim_conf> Currently only one type of ElecChain available (GenericElecChain), rendering this function temporarily redundant.

source
LegendGeSim.FADCType

The FADC supertype corresponds to the FADC component of the electronics chain in the DAQ setup.

source
LegendGeSim.FADCMethod
FADC(sim_conf)

LegendGeSimConfig -> <FADC>

Construct an FADC supertype instance based on simulation configuration <simconf>. Type of <FADC> depends on the type specified in <simconf> (e.g. generic, Flashcam, Struck)

source
LegendGeSim.GenericDAQType

GenericDAQ is a dummy DAQ model that stores the waveform after it triggered, saving <baseline_length> samples before the trigger index, and in total <nsamples> samples from start to end

source
LegendGeSim.GenericDAQMethod
GenericDAQ(sim_conf)

LegendGeSimConfig -> GenericDAQ

Construct a GenericDAQ struct based on given simulation configuration

source
LegendGeSim.GenericElecChainMethod
GenericElecChain(sim_conf)

LegendGeSimConfig -> GenericElecChain

Construct electronics components based on simulation configuration <sim_conf> and create a GenericChain instance based on these components.

source
LegendGeSim.GenericFADCType

GenericFADC is a dummy FADC model that performs sampling of the input waveform based on the sampling interval <Δt>

source
LegendGeSim.GenericFADCMethod
GenericFADC(sim_conf)

LegendGeSimConfig -> GenericFADC

Construct a GenericFADC instance based on simulation configuration <sim_conf>

source
LegendGeSim.GenericPreAmpType

The GenericPreAmp is a dummy PreAmp model that accounts for effects such as decay and rise time, offset, noise and gain.

This dummy model involves no real electronics response, only gain.

This struct is currently mutable because in the case of noise modelling based on data, the gain has to match the one in the baselines extracted from data, so in that case the PreAmp is initialized with gain = 0, and the gain is calculated later. I assume this is temporary, as the user should know which gain / max_e the data was produced with and give it as simulation input.

source
LegendGeSim.GenericPreAmpMethod
GenericPreAmp(sim_conf)

LegendGeSimConfig -> GenericPreAmp

Construct a GenericPreAmp instance based on given simulation configuration <sim_conf>

source
LegendGeSim.NoiseFromDataType

The NoiseFromData model means instead of simulating given preamp noise, and also gain and offset, these parameters will be accounted for or inferred from real data baselines contained in the <baseline_catalog>

source
LegendGeSim.NoiseFromDataMethod
NoiseFromData(sim_conf)

LegendGeSimConfig -> NoiseFromData

Construct a NoiseFromData struct based on given simulation configuration <sim_conf>

source
LegendGeSim.NoiseFromSimType

The NoiseFromSim model means simulating noise from scratch starting from fano noise of the germanium crystal and ending with noise coming from electronics components.

source
LegendGeSim.NoiseModelType

The NoiseModel supertype corresponds to different methods of simulating noise coming from the electronics chain components.

It is not simply a string in the ElecChain struct because it must exist as a separate instance for the stp->pss step that is independent from the elec simulation, but has to know what type of noise model is used to deal with fano noise.

source
LegendGeSim.NoiseModelMethod
NoiseModel(sim_config)

LegendGeSimConfig -> <NoiseModel>

Constuct a NoiseModel supertype instance based on simulation settings given in <simconfig> Type of <NoiseModel> depends on <simconfig> settings.

source
LegendGeSim.PSSimulatorType

The PSSimulator supertype defines what type of method is used for the simulation of electric field and weighting potential, calculation of detector capacitance etc., as well as simulation of current pulses

source
LegendGeSim.PreAmpMethod
PreAmp(sim_conf)

LegendGeSimConfig -> <PreAmp>

Construct a PreAmp supertype instance based on given simulation configuration <simconf>. Returned type depends on the settings in <simconf>. Currently only GenericPreAmp is available.

source
LegendGeSim.SiggenSimulatorType
SSDSimulator(sim_conf)

LegendGeSimConfig -> SSDSimulator

Construct SSDSimulator instance based on simulation configuration given in <sim_conf>.

Currently SSDSimulator does not have any parameters

source
LegendGeSim.TrapFilterType

The TrapFilter trigger is a dummy simulation of the trapezoidal filter algorithm to produce a trigger if the waveform amplitude passes a certain threshold.

This struct is currently mutable because in case of NoiseFromData modelling, we need to calculate the threshold post-factum after analysing the noise levels in data.

source
LegendGeSim.TrapFilterMethod
TrapFilter(sim_conf)

LegendGeSimConfig -> TrapFilter

Construct a TrapFilter instance based on simulation configuration given in <sim_conf>.

source
LegendGeSim.TriggerMethod
Trigger(sim_conf)

LegendGeSimConfig -> <Trigger>

Construct a Trigger supertype instance based on settings given in <sim_conf>. The returned type depends on the given settings.

Currently only TrapFilter type is implemented.

source
LegendGeSim.add_tail_and_baselineMethod
add_tail_and_baseline(wf, fadc, daq)

RDWaveform, GenericFADC, GenericDAQ -> RDWaveform

Extend tail and add baseline of <wf> based on <fadc> and <daq> parameters.

Extended conservatively to ensure enough samples for the future sliding trap filter window and the resulting DAQ baseline.

source
LegendGeSim.baseline_catalogMethod
baseline_catalog(raw_filename)

AbstractString -> Table

Look up stored table of baselines corresponding to given raw data <raw_filename>. If does not exist, construct such table.

source
LegendGeSim.baseline_catalogMethod
baseline_catalog(raw_table)

Table -> Table

Construct table of baselines extracted from the waveforms contained in the given raw data table <raw_table>

source
LegendGeSim.construct_ssd_simulationMethod
construct_ssd_simulation(det_meta, env, sim_settings)

PropDict, Environment, SSDSimulator -> SSD.Simulation

Construct a SolidStateDetectors.Simulation based on geometry as given in LEGEND metadata det_meta and on envorinmental settings specified in env and on simulational settings specified in sim_settings.

source
LegendGeSim.extend_baselineMethod
extend_baseline(baseline, wf)

RDWaveform, RDWaveform -> RDWaveform

Take a given <baseline> and extend it to match the length (and sampling) of the given waveform <wf>

source
LegendGeSim.fano_noiseMethod
fano_noise(events, ::PropDict, ::Environment, ::NoiseFromData)

Table -> Table

Do nothing since we do not need to simulate fano noise separately when using data baselines to account for noise levels.

source
LegendGeSim.fano_noiseMethod
fano_noise(events, det_meta, env, ::NoiseFromSim)

Table, PropDict, Environment -> Table

Calculate fano noise level based on the detector specification provided in LEGEND metadata <det_meta> and environment settings provided in <env>, and add it to given <events>

source
LegendGeSim.filenameMethod
filename(path)

Sring -> String

Extract core name of the file from path

E.g. filename("/some/path/to/filename.ext") -> "filename"

source
LegendGeSim.group_by_columnMethod
group_by_column(table, colname)

TypedTables.Table, Symbol -> TypedTables.Table

Group table <table> by given column <colname>.

I think this function already exists somewhere. Gotta ask Oliver and maybe use that package instead.

source
LegendGeSim.impurity_density_modelMethod

Convert fit parameters from crystal metadata units (1e9 e/cm^3 VS mm) into SSD units (e/m^3 VS m) and return SolidStateDetector impurity density type RadfordImpurityDensity to be later used when constructing SSD object.

source
LegendGeSim.impurity_density_modelMethod
impurity_density_model(crystal_metadata)

PropDict -> Vector{Float64}

Fit the impurity measurements in the crystal metadata with David Radford's empirical function a + bz + cexp((z-L)/tau) where z is crystal coordinate from seed end (z=0) to crystal length(z=L)

The fit is performed in crystal metadata coordinates i.e. distance in mm and impurity values in 1e9 e/cm^3 which determines the units of the parameters a,b,c,tau returned in the vector of Float32.

source
LegendGeSim.pet_to_rawMethod
pet_to_raw(pet_file_path, sim_config, config_name)

AbstractString, PropDict, AbstractString -> Table

[WIP] Full simulation chain pet->stp->pss->raw based on simulated energy depositions contained in the HDF5 file found in <petfilepath> and simulation settings given in <sim_config>.

The output name <config_name> is used to construct filenames for cached simulation files (currently the same as the simulation config basename)

source
LegendGeSim.pet_to_stpMethod
pet_to_stp(pet_table, detector_SSD)

Table, SolidStateDetectors.Simulation -> Table

Construct a table with "stepping info" based on position-energy-time information of simulated energy depositions given in <pettable> and detector geometry given in <detectorSSD>.

Current steps include: - removing events outside of detector PV - clustering - grouping by detector - removing events reconstructed to be outisde of the detector

source
LegendGeSim.preamp_gainMethod
preamp_gain(preamp, ::NoiseFromSim)

GenericPreAmp -> Float64

Do nothing and return original value of gain parameter in <preamp>, since when NoiseFromSim model is used, gain is provided by the user (or calculated based on user given max energy)

source
LegendGeSim.preamp_gainMethod
preamp_gain(preamp, noise_model)

GenericPreAmp, NoiseFromData -> Real

Calculate gain of <preamp> based on its max energy and the offset observed in data baselines contained in <noise_model>

In principle we should not do this in this simulation, and user has to provide the precise parameters of the electronics chain used in producing data the baselines from which are contained in <noise_model>.

source
LegendGeSim.process_waveformsMethod
process_waveforms(pss_table, elec_chain, trigger, daq, noise_model)

Table, GenericElecChain, Trigger, DAQ, NoiseModel -> Table

Simulate effects of the electronics chain <elecchain>, <trigger> and <daq> settings on the waveforms contained in <psstable>. Noise is simulated based on the given <noise_model>. The output table contains the resulting DAQ waveforms, simulated online energy after tigger, baselines and their RMS, needed for the raw tier table.

source
LegendGeSim.pss_to_rawMethod
pss_to_raw(pss_table, pss_truth, simulation_settings, elec_chain, trigger, daq, noise_model)

Table, Table, SSDSimulator, ElecChain, Trigger, DAQ, NoiseModel -> Table

Simulate effects of the electronics chain <elecchain>, <trigger> and <daq> settings on the waveforms contained in <psstable>. Noise is simulated based on the given <noisemodel>. Construct a table with the format identical to data raw tier. Currently timing information in <psstruth> is used for dummy timestamps in the output raw tier table.

source
LegendGeSim.remove_negativeMethod
remove_negative(value)

Real -> Real

Replace negative values by zeros.

Used to remove a glitch in SSD pulses as a quick fix while the glitch is being debugged.

source
LegendGeSim.simulateMethod
simulate(wf, elec_chain, ::NoiseFromSim)

RDWaveform, ElecChain -> RDWaveform

Simulate effects of the electronics chain on the waveform modelling noise based on each component.

source
LegendGeSim.simulateMethod
simulate(wf, elec_chain)

RDWaveform, ElecChain -> RDWaveform

Simulate effects of the electronics chain components on the waveform.

source
LegendGeSim.simulateMethod
simulate(wf, elec_chain, noise_model)

RDWaveform, GenericElecChain, NoiseFromData -> RDWaveform

Simulate effects of the electronics chain on the waveform modelling noise based on baselines extracted from data (note: also takes preamp offset into account)

source
LegendGeSim.simulateMethod
simulate(wf, fadc)

RDWaveform, GenericFADC -> RDWaveform

Simulate effects of FADC module <fadc> on the waveform <wf> (sampling and digitization)

source
LegendGeSim.simulateMethod
simulate(wf, preamp)

RDWaveform, GenericPreAmp -> RDWaveform

Simulate the effecs of the preamp on the waveform.

source
LegendGeSim.simulateMethod
simulate(wf, trap_filter)

RDWaveform, TrapFilter -> Int, Real

Simulate the results of applying <trapfilter> to <wf> Returns the index on which <wf> triggered, and the estimated online energy based on <trapfilter> output.

source
LegendGeSim.simulateMethod
simulate(wf, trigger_index, daq)

RDWaveform, Int, DAQ -> RDWaveform

Simulate how the DAQ stores the waveform after it receives a trigger.

source
LegendGeSim.simulate_noiseMethod
simulate_noise(wf, noise_model)

RDWaveform, NoiseFromData -> RDWaveform

Simulate noise and offset by picking a random baseline from the baseline catalog contained in <noise_model> and slapping it on top of the given waveform <wf>.

source
LegendGeSim.simulate_noiseMethod
simulate_noise(wf, preamp)

RDWaveform, PreAmp -> RDWaveform

Simulate effects of the preamplifier <preamp> on the given waveform <wf>.

source
LegendGeSim.simulate_waveformsMethod
simulate_waveforms(stp_events, detector)

Table, SolidStateDetectors.Simulation -> Table, Table

Simulate pulses based on events given in <stp_events> using the given SSD detector simulation instance <detector>

Constructs and returns a table with resulting pulses and a pss truth table (may be abolished in the future as unnecessary)

source
LegendGeSim.stp_to_pssMethod
stp_to_pss(stp_table, det_meta, env, ps_simulator, config_name)

Table, PropDict, Env, PSSimulator, NoiseModel, AbstractString -> Table, Table

  • NOTE * Lukas removed NoiseModel from here for some reason (search for fano_noise in old files)

Simulate waveforms based on stepping info given in <stptable>, LEGEND detector metadata <detmeta>, environment settings given in <env>, pulse shape simulation method <pssimulator>, and <noisemodel>

The output is a table with simulated pulses, and a table with simulation truth (may be abolished in the future since basically corresponds to stp table)

source
LegendGeSim.trigger_thresholdMethod
trigger_threshold(trigger, preamp, noise_model)

Trigger, GenericPreAmp, NoiseFromData -> Real

In NoiseFromData setting, if trigger threshold in keV is not provided, it is calculated based on noise levels in the baselines contained in <noise_model>. Otherwise the final threshold is calculated based on <preamp> gain.

source
LegendGeSim.trigger_thresholdMethod
trigger_threshold(trigger, preamp, ::NoiseFromSim)

Trigger, GenericPreAmp -> Real

In NoiseFromSim setting, non-zero trigger threshold in keV MUST be given by the user. Calculate final threshold based the value contained in <trigger>, and <preamp> gain.

source