### SSD_examples Constant Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Accessing example detector configuration files provided by the package. ```APIDOC ## SSD_examples ### Description A dictionary containing paths to example detector configuration files. Use `keys(SSD_examples)` to list available configurations. ### Usage Example ```julia path_to_config_file = SSD_examples[:InvertedCoax] sim = Simulation(path_to_config_file) ``` ``` -------------------------------- ### Configure Box Geometry Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example configurations for defining a Box in a configuration file. ```yaml box: widths: [2, 4, 6] # => hX = 1; hY = 2; hZ = 3; origin: [0, 0, 0] # [x, y, z] - Optional; Default: [0, 0, 0] rotate: # Optional; Default: no rotation Z: 0 ``` ```yaml box: halfwidths: [1, 2, 3] # => hX = 1; hY = 2; hZ = 3; ``` ```yaml box: hX: 1 hY: 2 hZ: 3 ``` -------------------------------- ### SolidStateDetectors.get_path_to_example_config_files Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Returns the file path to the example detector configuration files included with the package. ```APIDOC ## GET /api/get_path_to_example_config_files ### Description Returns the path to the example detector configuration files provided by the package. ### Method GET ### Endpoint /api/get_path_to_example_config_files ### Response #### Success Response (200) - **path** (String) - The absolute path to the example configuration files. #### Response Example ```json { "path": "/path/to/SolidStateDetectors/examples/config" } ``` ``` -------------------------------- ### Create MonoenergeticSource instances Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Examples of creating isotropic and directed ray particle sources. ```julia # Isotropic emission when no direction is passed m1 = MonoenergeticSource("gamma", 2.615u"MeV", CartesianPoint(0.04, 0, 0.05)) # Directed ray emission when no opening_angle is passed m2 = MonoenergeticSource("gamma", 2.615u"MeV", CartesianPoint(0.04, 0, 0.05), CartesianVector(-1, 0, 0)) ``` -------------------------------- ### Define a Cone in Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example of defining a partial cone with varying radii in a configuration file. ```yaml cone: r: bottom: from: 1.0 to: 2.0 top: from: 1.0 to: 4.0 # => r = ((1.0, 2.0), (1.0, 4.0)) phi: from: 0.0° to: 180.0° # => φ = π h: 2.0 # => hZ = 1.0 ``` -------------------------------- ### Define a FullSphere in Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example of defining a full sphere with a radius of 2 in the geometry configuration file. ```yaml sphere: r: 2 ``` -------------------------------- ### Define a Tube in Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example of defining a hollow cylinder (tube) in a configuration file. ```yaml tube: r: from: 1.0 to: 2.0 # => r = (1.0, 2.0) h: 2.0 # => hZ = 1.0 origin: z: 1.0 # => origin = [0.0, 0.0, 1.0] ``` -------------------------------- ### CartesianPoint Constructor Example Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Create a CartesianPoint with x, y, and z coordinates. Use subtraction with cartesian_zero to obtain a CartesianVector. ```julia pt = CartesianPoint(x, y, z) ``` -------------------------------- ### CartesianVector Constructor Example Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Create a CartesianVector with x, y, and z components. Use addition with cartesian_zero to obtain a CartesianPoint. ```julia v = CartesianPoint(Δx, Δy, Δz) ``` -------------------------------- ### Define Semiconductor Configuration in YAML Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example configuration for a Semiconductor in a detector's definition file. Specifies material, temperature, and optional models for impurity density, charge drift, charge trapping, and geometry. ```yaml semiconductor: material: HPGe temperature: 78 impurity_density: # ... charge_drift_model: # ... charge_trapping_model: # ... geometry: # ... ``` -------------------------------- ### Define Full Torus Geometry Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example definition of a full Torus in a configuration file, covering the entire 2π range for phi and theta angles. ```yaml torus: r_torus: 10.0 # => r_torus = 10.0 r_tube: 2 # => r_tube = 2.0 phi: from: 0.0° to: 360.0° # => φ = nothing theta: from: 0.0° to: 360.0° # => θ = nothing ``` -------------------------------- ### Simulate event waveforms Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates drift paths and generates waveforms for a given event and simulation setup. ```julia simulate!(evt, sim, Δt = 1u"ns", verbose = false) ``` -------------------------------- ### GET /scaling_factor_for_permittivity_in_undepleted_region Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates the scaling factor for electric permittivity in undepleted regions of a semiconductor. ```APIDOC ## GET /scaling_factor_for_permittivity_in_undepleted_region ### Description Calculates the scaling factor for electric permittivity in undepleted regions of a semiconductor. This is an experimental feature intended to be overwritten by the user. ### Method GET ### Parameters #### Query Parameters - **sc** (Semiconductor{T}) - Required - The semiconductor object for which permittivity should be scaled. ``` -------------------------------- ### Define a Sphere with Inner Cut-out Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example of using CSGDifference to create a sphere with an inner radius of 1 and an outer radius of 2. ```yaml difference: - sphere: r: 2 - sphere: r: 1 ``` -------------------------------- ### Drift Charges Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates electron and hole drift paths for an event within a simulation setup. ```julia drift_charges!(evt::Event{T}, sim::Simulation{T}; kwargs...)::Nothing where {T <: SSDFloat} ``` ```julia drift_charges!(evt, sim, Δt = 1u"ns", verbose = false) ``` -------------------------------- ### Get electron and hole contribution Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates the contribution of electrons and holes to a contact's waveform. Requires drift paths to be calculated via drift_charges! prior to invocation. ```julia using Plots using SolidStateDetector T = Float32 simulation = Simulation{T}(SSD_examples[:InvertedCoax]) simulate!(simulation) event = Event([CartesianPoint{T}(0.02,0.01,0.05)]) simulate!(event, simulation) contact_id = 1 wf = get_electron_and_hole_contribution(evt, sim, contact_id) ``` -------------------------------- ### Define Polycone Geometry Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example definition of a Polycone in a configuration file. Used for defining complex shapes like the semiconductor of an inverted coaxial detector. ```yaml polycone: r: [0, 35, 35, 24.42, 5, 5, 0, 0] z: [0, 0, 20, 80, 80, 25, 25, 0] origin: z: 1.0 # => origin = [0.0, 0.0, 1.0] ``` -------------------------------- ### POST /simulate! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Performs a full chain simulation for a given Simulation object, including electric potential, electric field, and weighting potential calculations. ```APIDOC ## POST /simulate! ### Description Performs a full chain simulation for a given Simulation object, calculating electric potential, electric field, and weighting potential for each contact. ### Method POST ### Parameters #### Request Body - **sim** (Simulation{T}) - Required - The simulation object to perform the chain on. #### Query Parameters - **convergence_limit** (Real) - Optional - Convergence limit for relaxation (default 1e-7 * bias voltage). - **refinement_limits** (Real/Tuple/Vector) - Optional - Defines maximum relative potential differences for grid refinement. - **min_tick_distance** (Tuple{Quantity, Quantity, Quantity}) - Optional - Minimum allowed distance between grid ticks. - **max_tick_distance** (Tuple{Quantity, Quantity, Quantity}) - Optional - Maximum allowed distance between grid ticks. - **max_distance_ratio** (Real) - Optional - Maximum allowed ratio between distances to neighboring grid points. - **depletion_handling** (Bool) - Optional - Enables handling of undepleted regions (default false). - **use_nthreads** (Int) - Optional - Number of threads to use for computation. ``` -------------------------------- ### Define HexagonalPrism Geometry Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example definition of a HexagonalPrism in a configuration file. This is a type of RegularPrism. ```yaml HexagonalPrism: r: 1.0 # => r = 1.0 h: 2.0 # => hZ = 1.0 ``` -------------------------------- ### Apply Initial State for Electric Potential Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Applies the initial state for the electric potential calculation. Use `paint_contacts = false` to improve performance by only painting surfaces without checking if points are inside contacts. ```julia apply_initial_state!(sim, ElectricPotential, paint_contacts = false) ``` -------------------------------- ### Get Active Volume Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Approximates the active detector volume by summing volumes of depleted cells. ```julia get_active_volume(point_types::PointTypes{T}) where {T} ``` ```julia get_active_volume(sim.point_types) ``` -------------------------------- ### Apply Initial State Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Method to initialize simulation fields based on detector material properties. ```julia apply_initial_state!(sim::Simulation{T}, ::Type{ElectricPotential}, grid::Grid{T} = Grid(sim); not_only_paint_contacts::Bool = true, paint_contacts::Bool = true)::Nothing where {T <: SSDFloat} ``` -------------------------------- ### Instantiate NBodyChargeCloud with platonic solid shells Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Creates a charge cloud using platonic solids for shell geometry. Requires Unitful.jl for energy units. ```julia center = CartesianPoint{T}(0,0,0) energy = 1460u"keV" NBodyChargeCloud(center, energy, number_of_shells = 3, shell_structure = SolidStateDetectors.Icosahedron) ``` -------------------------------- ### NBodyChargeCloud Constructor (Platonic Solids) Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Creates an NBodyChargeCloud with charges distributed using platonic solids for shell geometry. ```APIDOC ## NBodyChargeCloud(center, energy, particle_type) ### Description Returns an NBodyChargeCloud for a given energy deposition at a position, given by a center charge surrounded by shells consisting of platonic solids. ### Parameters #### Arguments - **center** (CartesianPoint{T}) - Required - Center position of the NBodyChargeCloud. - **energy** (RealQuantity) - Required - Deposited energy with units. - **particle_type** (Type{PT}) - Optional - ParticleType of the particle that deposited the energy. Default is Gamma. #### Keywords - **radius** (T) - Optional - Estimate for the radius of the NBodyChargeCloud. - **number_of_shells** (Int) - Optional - Number of shells around the center point. Default is 2. - **shell_structure** (Geometry) - Optional - Geometry with which the charges are distributed in the shells. Default is Dodecahedron. ``` -------------------------------- ### Read SigGen Configuration File Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads a SigGen configuration file and returns a dictionary of parameters. Non-existing parameters default to 0. ```julia readsiggen(file_path::String; T::Type) ``` -------------------------------- ### readsiggen Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads a SigGen configuration file and returns its parameters. ```APIDOC ## readsiggen ### Description Reads a SigGen configuration file (ending in `.config`) in `file_path` and returns a dictionary of all parameters. Non-existing parameters are set to `0`. ### Method `readsiggen` ### Parameters #### Path Parameters - **file_path** (String) - Required - File path leading to the SigGen configuration file. #### Keyword Parameters - **T** (Type) - Optional - Type of the parameters in the output dictionary. Default is `Float64`. ### Request Example ```julia params = readsiggen("path/to/your/detector.config") ``` ### Response #### Success Response (200) - **Dictionary** - A dictionary containing all parameters from the SigGen configuration file. ``` -------------------------------- ### Grid Initialization Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Initializes a Grid object based on a Simulation, defining the spatial discretization for potential and field calculations. ```APIDOC ## Grid(sim::Simulation) ### Description Initializes a `Grid` based on the objects defined in a `Simulation`. The grid samples important points from objects and can be tuned via keyword arguments. ### Method Constructor ### Parameters #### Request Body - **sim** (Simulation) - Required - The simulation object for which the grid will be defined. #### Keywords - **max_tick_distance** (Quantity/Tuple) - Optional - Maximum distance between neighbouring ticks. - **max_distance_ratio** (Real) - Optional - Ratio threshold for adding additional ticks to prevent uneven spacing. - **add_ticks_between_important_ticks** (Bool) - Optional - Whether to add points between important simulation object points. - **for_weighting_potential** (Bool) - Optional - If true, optimizes grid for ElectricPotential; if false, for WeightingPotential. ``` -------------------------------- ### Define Torus Geometry with Inner Cut-out Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Example definition of a Torus with an inner cut-out in the tube radius, specified by 'from' and 'to' values. ```yaml torus: r_torus: 10.0 # => r_torus = 10.0 r_tube: from: 1.0 to: 2.0 # => r_tube = (1.0, 2.0) phi: from: 0.0° to: 360.0° # => φ = nothing theta: from: 0.0° to: 360.0° # => θ = nothing ``` -------------------------------- ### SolidStateDetectors.PotentialCalculationSetup Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Holds the grid, fields, and precalculated parameters for electric potential calculations. ```APIDOC ## SolidStateDetectors.PotentialCalculationSetup ### Description Holds the grid, fields, and precalculated fixed parameters for electric potential calculations. This struct is recalculated after each refinement as it depends on the grid. ### Fields - `grid`: The 3-dimensional grid (Cartesian or cylindrical) for field calculation. - `potential`: 4-dimensional array of the extended 3D potential array (includes red-black division for parallelization). - `point_types`: 4-dimensional array storing `PointType` values, similar structure to `potential`. - `volume_weights`: 4-dimensional array storing volume weights. - `q_eff_imp`: 4-dimensional array storing effective charge densities for impurities. - `imp_scale`: 4-dimensional array storing impurity scaling factors. - `q_eff_fix`: 4-dimensional array storing effective fixed charge densities. - `ϵ_r`: 3-dimensional array of relative permittivity values for each octant around grid points. ``` -------------------------------- ### SolidStateDetectors.apply_initial_state! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Applies the initial state for the calculation of the ElectricPotential. ```APIDOC ## Method apply_initial_state!(sim::Simulation{T}, ::Type{ElectricPotential}, grid::Grid{T} = Grid(sim); not_only_paint_contacts::Bool = true, paint_contacts::Bool = true)::Nothing where {T <: SSDFloat} ### Description Applies the initial state for the calculation of the `ElectricPotential`. It overwrites `sim.electric_potential`, `sim.q_eff_imp`, `sim.q_eff_fix`, `sim.ϵ` and `sim.point_types` with the material properties and fixed potentials defined in `sim.detector`. ### Arguments - **sim** (Simulation{T}) - `Simulation` for which the initial state should be applied. - **grid** (Grid{T}) - `Grid` to apply the initial state on. If no `grid` is given, a default `Grid` is determined from `sim`. ### Keywords - **not_only_paint_contacts** (Bool) - Defaults to `true`. - **paint_contacts** (Bool) - Defaults to `true`. ``` -------------------------------- ### Passive Component Definition Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Defines the properties of a passive component within a detector setup. Passives can be defined with material, geometry, and optionally name, ID, potential, temperature, and charge density. ```APIDOC ## Passive Component Definition ### Description Defines a passive component in a detector or surroundings. Requires `material` and `geometry`. Optional fields include `name`, `id`, `potential`, `temperature`, and `charge_density`. ### Fields - `potential::T`: Electric potential (in V) for fixed passives. `NaN` for floating passives. - `temperature::T`: Temperature (in K) of the passive. - `material::MT`: Material of the passive. - `charge_density_model::CDM`: Charge density model for the passive's interior. - `geometry::G`: Geometric definition of the passive (CSG). ### Configuration Example ``` passives: - name: Passivated Surface material: HPGe charge_density: # ... geometry: # ... - name: Cryostat id: 3 potential: 0 temperature: 293K material: Al geometry: # ... ``` ``` -------------------------------- ### Parse Configuration File Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads and parses a configuration file (YAML, JSON, or SigGen format) into a dictionary. Supports specifying the dictionary type for the output. ```julia parse_config_file(filename::AbstractString; dicttype::Type = Dict)::dicttype ``` -------------------------------- ### POST /siggentodict Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Converts a SigGen configuration dictionary into a format compatible with SolidStateDetectors.jl. ```APIDOC ## POST /siggentodict ### Description Converts the dictionary containing parameters from a SigGen configuration file to a dictionary understood by SolidStateDetectors.jl. ### Method POST ### Parameters #### Request Body - **config** (AbstractDict) - Required - Dictionary containing SigGen parameters. - **dicttype** (Type) - Required - Type of the dictionary returned. - **units** (AbstractDict) - Required - Units used in SigGen configuration (must contain 'length', 'angle', 'potential', 'temperature'). ``` -------------------------------- ### Initialize MonoenergeticSource with directed cone emission Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Creates a monoenergetic source with a specified opening angle for directed emission. ```julia m3 = MonoenergeticSource("gamma", 2.615u"MeV", CartesianPoint(0.04, 0, 0.05), CartesianVector(-1, 0, 0), 10u"°") ``` -------------------------------- ### ssd_write Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Writes a Simulation object to an HDF5 file. ```APIDOC ## ssd_write ### Description Converts a `Simulation` to a `NamedTuple` and writes it to a HDF5 file. Note: If the file exists, it will be overwritten. ### Parameters #### Arguments - **filename** (AbstractString) - Required - Filename of the HDF5 file. - **sim** (Simulation) - Required - The simulation object to write. ### Request Example ```julia ssd_write("example_sim.h5", sim) ``` ``` -------------------------------- ### apply_initial_state! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Applies the initial state for the calculation of the WeightingPotential for a specific contact. ```APIDOC ## apply_initial_state!(sim::Simulation{T}, ::Type{WeightingPotential}, contact_id::Int, grid::Grid{T}) ### Description Applies the initial state for the calculation of the WeightingPotential for the Contact with the id contact_id. It overwrites sim.weighting_potentials[contact_id] with the fixed values on the Contact. ### Parameters #### Arguments - **sim** (Simulation{T}) - Required - Simulation for which the initial state should be applied. - **contact_id** (Int) - Required - The id of the Contact for which the WeightingPotential is to be calculated. - **grid** (Grid{T}) - Optional - Grid to apply the initial state on. #### Keywords - **not_only_paint_contacts** (Bool) - Optional - Whether to only use the painting algorithm of the surfaces of Contact without checking if points are actually inside them. - **paint_contacts** (Bool) - Optional - Enable or disable the painting of the surfaces of the Contact onto the grid. ``` -------------------------------- ### Instantiate NBodyChargeCloud with spherical shells Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Creates a charge cloud using spherical shells of point charges. Requires Unitful.jl for energy units. ```julia center = CartesianPoint{T}(0,0,0) energy = 1460u"keV" NBodyChargeCloud(center, energy, 200, number_of_shells = 3) ``` -------------------------------- ### Simulate Waveforms with Standard Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Basic usage of simulate_waveforms to generate waveforms from event data and simulation parameters. ```julia simulate_waveforms(mcevents, sim, Δt = 1u"ns", verbose = false) # => returns the input table `mcevents` with an additional column `waveform` in which the generated waveforms are stored ``` -------------------------------- ### Simulate detector grid refinement Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Executes a simulation with specified refinement limits and iteration constraints. ```julia simulate!(sim, refinement_limits = [0.3, 0.1, 0.05], max_distance_ratio = 4, max_n_iterations = 20000) ``` -------------------------------- ### Define Linear Charge Density in Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Configure a linear charge density in a file with 'name: linear'. Specify 'offset' for density at origin and 'gradient' for slopes in x, y, and/or z. ```yaml # charge density with linear gradient in x charge_density: name: linear offset: 1.0e-10 # C/m³ gradient: x: 1.0e-11 # C/m⁴ ``` -------------------------------- ### Convert SigGen configuration to SolidStateDetectors format Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Converts parameters from a SigGen configuration file into a format compatible with SolidStateDetectors.jl. ```julia siggentodict(config::AbstractDict; dicttype::Type, units::AbstractDict) ``` -------------------------------- ### Apply Initial State for Weighting Potential Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Applies the initial state for the weighting potential calculation for a specific contact. It overwrites the weighting potentials with fixed values on the contact surface. ```julia apply_initial_state!(sim, WeightingPotential, 1) # => applies initial state for weighting potential of contact with id 1 ``` -------------------------------- ### NBodyChargeCloud Constructor (Spherical Shells) Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Creates an NBodyChargeCloud with charges distributed on spherical shells. ```APIDOC ## NBodyChargeCloud(center, energy, N, particle_type) ### Description Returns an NBodyChargeCloud for a given energy deposition at a position, given by a center charge surrounded by shells of approximately N point charges equally distributed on the surface of a sphere. ### Parameters #### Arguments - **center** (CartesianPoint{T}) - Required - Center position of the NBodyChargeCloud. - **energy** (RealQuantity) - Required - Deposited energy with units. - **N** (Integer) - Required - Approximate number of charges in the NBodyChargeCloud. - **particle_type** (Type{PT}) - Optional - ParticleType of the particle that deposited the energy. Default is Gamma. #### Keywords - **radius** (T) - Optional - Estimate for the radius of the NBodyChargeCloud. - **number_of_shells** (Int) - Optional - Number of shells around the center point. Default is 2. ``` -------------------------------- ### ssd_read Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads a Simulation object from an HDF5 file. ```APIDOC ## ssd_read ### Description Reads a `Simulation` from a HDF5 file with a given filename using LegendHDF5IO.jl. ### Parameters #### Arguments - **filename** (AbstractString) - Required - Filename of the HDF5 file. ### Request Example ```julia using SolidStateDetectors using LegendHDF5IO sim = ssd_read("example_sim.h5", Simulation) ``` ``` -------------------------------- ### Querying PointType Information Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Demonstrates how to query information from a PointType variable using bitwise AND operations. Checks for specific properties like update status, depletion state, and material type. ```julia point_type & update_bit == 0 point_type & update_bit > 0 point_type & undepleted_bit > 0 point_type & pn_junction_bit > 0 point_type & bulk_bit > 0 point_type & inactive_layer_bit > 0 point_type & inactive_contact_bit > 0 ``` -------------------------------- ### Lithium Saturation Parameters Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Parameters for calculating lithium saturated density. ```APIDOC ## LithiumSaturationParameters ### Description Set of experimental fit parameters to calculate the lithium saturated density `N_s` in 1/cm³ at a given annealing temperature `T_an` using the formula: `N_s(T_an) = 10^(a - b/T_an)`. ### Parametric Types - `T`: Precision type. ### Fields - **a** (T) - Required - Fit parameter. - **b** (T) - Required - Fit parameter. ``` -------------------------------- ### drift_charges! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates electron and hole drift paths for a given event and simulation. ```APIDOC ## drift_charges! ### Description Calculates the electron and hole drift paths for the given Event and Simulation and stores them in evt.drift_paths. ### Parameters #### Arguments - **evt** (Event) - Required - Event for which the charges should be drifted. - **sim** (Simulation) - Required - Simulation which defines the setup. #### Keywords - **max_nsteps** (Int) - Optional - Maximum number of steps in the drift of each hit (default: 1000). - **Δt** (RealQuantity) - Optional - Time step used for the drift (default: 5u"ns"). - **diffusion** (Bool) - Optional - Activate or deactive diffusion (default: false). - **self_repulsion** (Bool) - Optional - Activate or deactive self-repulsion (default: false). - **end_drift_when_no_field** (Bool) - Optional - Terminate drift when electric field is zero (default: true). - **geometry_check** (Bool) - Optional - Perform extra geometry checks (default: false). - **verbose** (Bool) - Optional - Activate or deactivate info output (default: true). ``` -------------------------------- ### refine! (ElectricPotential) Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Refines the electric potential grid of a simulation. ```APIDOC ## refine! (ElectricPotential) ### Description Takes the current state of `sim.electric_potential` and refines it with respect to the input arguments `max_diffs` and `minimum_distances`. This involves extending the grid, refining axes based on potential difference and distance constraints, and interpolating new data. ### Method `refine!` ### Endpoint `SolidStateDetectors.refine!(sim, ElectricPotential, ...)` ### Parameters #### Path Parameters - **sim** (Simulation{T}) - Required - The `Simulation` object for which `sim.electric_potential` will be refined. - **Type** (Type{ElectricPotential}) - Required - Specifies that the electric potential is being refined. #### Keyword Parameters - **max_diffs** (Tuple{<:Real,<:Real,<:Real}) - Required - Maximum potential difference between two discrete ticks of `sim.electric_potential.grid` after refinement. - **minimum_distances** (Tuple{<:Real,<:Real,<:Real}) - Required - Minimum distance (in SI Units) between two discrete ticks of `sim.electric_potential.grid` after refinement. ### Request Example ```julia refine!(sim, ElectricPotential, max_diffs = (100, 100, 100), minimum_distances = (0.01, 0.02, 0.01)) ``` ### Response #### Success Response (200) - **Void** - The function modifies the `sim.electric_potential` in place. ``` -------------------------------- ### Extend Waveform Baseline Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Method to prepend a zero-valued baseline and extend the tail of a waveform. ```julia add_baseline_and_extend_tail(wv::RadiationDetectorSignals.RDWaveform{T,U,TV,UV}, n_baseline_samples::Int, total_waveform_length::Int) where {T,U,TV,UV} ``` ```julia add_baseline_and_extend_tail(wv, 1000, 5000) ``` -------------------------------- ### parse_config_file Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads a configuration file and returns a parsed dictionary containing all specified information. Supports YAML, JSON, and SigGen formats. ```APIDOC ## GET parse_config_file ### Description Reads in a configuration file and returns a parsed dictionary which holds all the information specified in the configuration file. Find detailed information on configuration files in Configuration Files. ### Method GET ### Endpoint /websites/juliaphysics_github_io_solidstatedetectors_jl_stable/parse_config_file ### Parameters #### Query Parameters - **filename** (AbstractString) - Required - File name of the configuration file. If the file is not in the same directory, a path to the file is required. - **dicttype** (Type) - Optional - Type of the dictionary returned. Defaults to Dict. ### Response #### Success Response (200) - **dicttype** - A dictionary containing the parsed configuration. ``` -------------------------------- ### Run Geant4 Simulation Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Simulates a Geant4 application for a specified number of events, with an optional energy threshold for recording events. Events with non-zero energy depositions are recorded by default. ```julia run_geant4_simulation(app::Geant4.G4JLApplication, number_of_events::Int; energy_threshold::Unitful.Energy) ``` ```julia run_geant4_simulation(app, 1000) ``` -------------------------------- ### Calculate New Potential by Neighbors (3D) Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates the new potential value for a grid point using the potentials of its six neighbors and the corresponding weights. This method is detailed in Chapter 5.2.2 of the provided reference. ```julia function calc_new_potential_by_neighbors_3D( volume_weight::T, weights::NTuple{6,T}, neighbor_potentials::NTuple{6,T}, ) where {T} ``` -------------------------------- ### Handle Undepleted Grid Points in Detector Simulation Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Handles grid points with volumes that are not fully depleted. Scales impurity density if potential undershoots or overshoots neighbor potentials, as potential should increase monotonically in a semiconductor detector. ```julia function handle_depletion( new_potential::T, imp_scale::T, neighbor_potentials::NTuple{6,T}, q_eff_imp::T, volume_weight::T, )::Tuple{T, PointType} where {T} ``` -------------------------------- ### Simulate Waveforms with LegendHDF5IO Integration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Usage of simulate_waveforms when LegendHDF5IO.jl is loaded to save output directly to HDF5 files. ```julia using LegendHDF5IO simulate_waveforms(mcevents, sim, "output_dir", "my_basename", Δt = 1u"ns", verbose = false) ``` -------------------------------- ### Semiconductor Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Defines the structure and configuration requirements for a Semiconductor object within the simulation. ```APIDOC ## Semiconductor Configuration ### Description A Semiconductor represents the bulk volume of a SolidStateDetector where charge drift occurs. It is defined via the configuration file. ### Fields - **temperature** (T) - Temperature in Kelvin. - **material** (MT) - Material of the semiconductor. - **impurity_density_model** (IDM) - Model for impurity density. - **charge_drift_model** (CDM) - Model for charge drift. - **charge_trapping_model** (CTM) - Model for charge trapping. - **geometry** (G) - Geometry of the semiconductor. ### Request Example semiconductor: material: HPGe temperature: 78 impurity_density: # ... charge_drift_model: # ... charge_trapping_model: # ... geometry: # ... ``` -------------------------------- ### Define World Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Structure defining the finite volume for simulation performance. ```julia struct World{T <: SSDFloat, N, S} <: AbstractWorld{T, N} ``` -------------------------------- ### SolidStateDetectors Simulation Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Configuration options for SolidStateDetectors simulations. ```APIDOC ## Simulation Configuration Options ### Description These options configure the behavior of the simulation, affecting grid calculations, iteration limits, and surface painting algorithms. ### Parameters - **sor_consts** (`Union{<:Real, NTuple{2, <:Real}}`) - Optional - SOR constants for `r` (cylindrical) or a single value (Cartesian). Default is `[1.4, 1.85]`. - **max_n_iterations** (`Int`) - Optional - Maximum number of iterations after grid refinement. `-1` means no limit. Default is no limit. - **not_only_paint_contacts** (`Bool`) - Optional - Whether to only use the painting algorithm of `Contact` surfaces without checking if points are inside. Default is `true`. - **paint_contacts** (`Bool`) - Optional - Enable or disable the painting of `Contact` surfaces onto the grid. Default is `true`. - **verbose** (`Bool`) - Optional - Whether to produce info output. Default is `true`. ### Example ```julia # Example of setting configuration options (conceptual, actual usage depends on API) sim_config = SolidStateDetectors.SimulationConfiguration( sor_consts = [1.5, 1.9], max_n_iterations = 10000, verbose = false ) ``` ``` -------------------------------- ### Calculate Electric Potential Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates the ElectricPotential on an adaptive grid using successive over relaxation. Various keyword arguments are available to tune the calculation process. ```julia calculate_electric_potential!(sim::Simulation{T}; kwargs...)::Nothing ``` -------------------------------- ### simulate_waveforms Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Simulates charge carrier drift and diffusion to generate waveforms. ```APIDOC ## simulate_waveforms ### Description Simulates the drift of charge carriers within a detector setup and generates waveforms based on the provided event data and simulation parameters. It returns the input table with an additional 'waveform' column. ### Method `simulate_waveforms(mcevents, sim, ...)` ### Arguments - **mcevents** (`mcevents::TypedTables.Table`): Table containing information about events in the simulated setup. - **sim** (`sim::Simulation{T}`): `Simulation` object defining the detector setup for charge drift. ### Additional Arguments (if LegendHDF5IO.jl is loaded) - **output_dir** (`AbstractString`): Directory to save HDF5 output files. - **output_base_name** (`AbstractString`): Basename for HDF5 output files (default: "generated_waveforms"). ### Keywords - **max_nsteps** (`Int`): Maximum number of steps for each hit's drift (default: 1000). - **Δt** (`RealQuantity`): Time step for drift simulation (default: 4 ns). - **diffusion** (`Bool`): Activate/deactivate charge carrier diffusion (default: false). - **self_repulsion** (`Bool`): Activate/deactivate self-repulsion of charge carriers (default: false). - **number_of_carriers** (`Int`): Number of charge carriers for N-Body simulation (default: 1). - **number_of_shells** (`Int`): Number of shells around the energy deposition center (default: 1). - **signal_unit** (`Unitful.Units`): Unit for the returned waveform (charge or energy) (default: e_au). - **max_interaction_distance** (`NaN`): Maximum distance for charge cloud interaction (default: NaN, independent drift). - **end_drift_when_no_field** (`Bool`): Terminate drift when electric field is zero (default: true). - **geometry_check** (`Bool`): Perform extra geometry checks for contact detection (default: false). - **verbose** (`Bool`): Activate/deactivate verbose output (default: false). - **chunk_n_physics_events** (`Int`) (LegendHDF5IO only): Number of events per HDF5 file (default: 1000). ### Request Example ```julia simulate_waveforms(mcevents, sim, Δt = 1u"ns", verbose = false) ``` ### Response - **mcevents** (`mcevents::TypedTables.Table`): The input table with an added `waveform` column. ### Response Example ```julia # Returns the input table `mcevents` with an additional column `waveform` in which the generated waveforms are stored ``` ### Example with LegendHDF5IO ```julia using LegendHDF5IO simulate_waveforms(mcevents, sim, "output_dir", "my_basename", Δt = 1u"ns", verbose = false) ``` ``` -------------------------------- ### update_till_convergence! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Updates the electric or weighting potential of a simulation until it converges. ```APIDOC ## update_till_convergence! ### Description Updates the potential state of a simulation until the maximum difference between iterations falls below the convergence limit. ### Parameters #### Arguments - **sim** (Simulation{T}) - Required - The simulation object. - **type** (Type{ElectricPotential} or Type{WeightingPotential}) - Required - The type of potential to update. - **convergence_limit** (Real) - Required - The limit for convergence relative to bias voltage. - **contact_id** (Int) - Optional - Required only when updating WeightingPotential. #### Keywords - **n_iterations_between_checks** (Int) - Optional - Default 500. - **max_n_iterations** (Int) - Optional - Default -1 (no limit). - **depletion_handling** (Bool) - Optional - Default false. - **use_nthreads** (Int) - Optional - Default Base.Threads.nthreads(). ### Request Example ```julia SolidStateDetectors.update_till_convergence!(sim, ElectricPotential, 1e-6, depletion_handling = true) ``` ``` -------------------------------- ### Create IsotopeSource for Directed Cone Emission Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Use IsotopeSource with a direction vector and opening angle for directed cone emission. Requires atomic number, mass number, ion charge, excitation energy, position, direction, and opening angle. ```julia i3 = IsotopeSource(82, 212, 0, 0, CartesianPoint(0.04, 0, 0.05), CartesianVector(-1, 0, 0), 10u"°") ``` -------------------------------- ### Define DiscreteAxis with Ticks Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Constructs a DiscreteAxis with specified endpoints, boundary conditions, boundary types, and tick values. Boundary conditions can be :periodic, :reflecting, :infinite, :r0, :fixed. Boundary types can be :closed or :open. ```julia DiscreteAxis(-2.0, 2.0, :infinite, :infinite, :closed, :closed, collect(-2:0.1:2)) ``` -------------------------------- ### Constant Charge Density Model Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Assumes a constant charge density everywhere. Defined in config with name: constant and a value for ρ. ```julia struct ConstantChargeDensity{T <: SSDFloat} <: AbstractChargeDensity{T} ρ::T end ``` ```yaml charge_density: name: constant value: 1.0e-10 # C/m³ ``` -------------------------------- ### Update Simulation Convergence Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Updates the weighting potential for a specific contact until convergence is reached. ```julia SolidStateDetectors.update_till_convergence!(sim, WeightingPotential, 1, 1e-6, use_nthreads = 4) ``` -------------------------------- ### Perform full chain detector simulation Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Executes the full simulation chain including electric potential, electric field, and weighting potential calculations. Results are stored directly in the provided Simulation object. ```julia simulate!( sim::Simulation{T}; kwargs...) where {T, S} ``` -------------------------------- ### Lithium Diffusion Parameters Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Parameters for calculating lithium diffusivity. ```APIDOC ## LithiumDiffusionParameters ### Description Set of parameters to calculate the lithium diffusivity `D` at a given annealing temperature `T_an` using the formula: `D(T_an) = D0 * exp(-H / (R * T_an))`. ### Parametric Types - `T`: Precision type. ### Fields - **T_min** (T) - Required - Minimum temperature (in K) for which the parameters are valid. - **T_max** (T) - Required - Maximum temperature (in K) for which the parameters are valid. - **D0** (T) - Required - Diffusivity constant in m²/s. - **H** (T) - Required - Activation energy in cal/mol. ``` -------------------------------- ### Define CSGUnion in Configuration Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Use the 'union' field to define a CSGUnion. All geometries in the array are combined to form the final shape. ```yaml union: # a || b - tube: # a r: 2 h: 1 - tube: # b r: 1 h: 1.5 origin: z: 0.5 ``` -------------------------------- ### refine! (WeightingPotential) Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Refines the weighting potential grid of a simulation for a specific contact. ```APIDOC ## refine! (WeightingPotential) ### Description Takes the current state of `sim.weighting_potentials[contact_id]` and refines it with respect to the input arguments `max_diffs` and `minimum_distances`. This process includes extending the grid, refining axes based on potential difference and distance constraints, and interpolating new data. ### Method `refine!` ### Endpoint `SolidStateDetectors.refine!(sim, WeightingPotential, ...)` ### Parameters #### Path Parameters - **sim** (Simulation{T}) - Required - The `Simulation` object for which `sim.weighting_potentials[contact_id]` will be refined. - **Type** (Type{WeightingPotential}) - Required - Specifies that the weighting potential is being refined. - **contact_id** (Int) - Required - The `id` of the `Contact` for which the `WeightingPotential` is refined. #### Keyword Parameters - **max_diffs** (Tuple{<:Real,<:Real,<:Real}) - Required - Maximum potential difference between two discrete ticks of `sim.weighting_potentials[contact_id].grid` after refinement. - **minimum_distances** (Tuple{<:Real,<:Real,<:Real}) - Required - Minimum distance (in SI Units) between two discrete ticks of `sim.weighting_potentials[contact_id].grid` after refinement. ### Request Example ```julia refine!(sim, WeightingPotential, 1, max_diffs = (0.01, 0.01, 0.01), minimum_distances = (0.01, 0.02, 0.01)) ``` ### Response #### Success Response (200) - **Void** - The function modifies the `sim.weighting_potentials[contact_id]` in place. ``` -------------------------------- ### Write Simulation to HDF5 Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Converts a Simulation object to a NamedTuple and saves it to an HDF5 file. Existing files with the same name will be overwritten. ```julia using SolidStateDetectors using LegendHDF5IO sim = Simulation(SSD_examples[:InvertedCoax]) simulate!(sim) ssd_write("example_sim.h5", sim) ``` -------------------------------- ### Create IsotopeSource for Directed Ray Emission Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Use IsotopeSource with a direction vector for directed ray emission. Requires atomic number, mass number, ion charge, excitation energy, position, and direction. ```julia i2 = IsotopeSource(82, 212, 0, 0, CartesianPoint(0.04, 0, 0.05), CartesianVector(-1, 0, 0)) ``` -------------------------------- ### calculate_electric_field! Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Calculates the ElectricField from the ElectricPotential stored in the simulation. ```APIDOC ## calculate_electric_field!(sim::Simulation{T}; n_points_in_φ::Union{Missing, Int} = missing) ### Description Calculates the ElectricField from the ElectricPotential stored in sim.electric_potential and stores it in sim.electric_field. ### Parameters #### Arguments - **sim** (Simulation{T}) - Required - Simulation for which sim.electric_potential has already been calculated. #### Keywords - **n_points_in_φ** (Union{Missing, Int}) - Optional - For a 2D ElectricPotential, sim.electric_potential is extended to n_points_in_φ layers in φ. ``` -------------------------------- ### LithiumSaturationParameters type definition Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Structure for calculating lithium saturated density using experimental fit parameters. ```julia struct LithiumSaturationParameters{T <: SSDFloat} ``` -------------------------------- ### Define Carrier Drift Parameters Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Defines parameters for electron or hole drift along <100> and <111> axes. Requires VelocityParameters. ```julia struct CarrierParameters{T <: SSDFloat} axis100::VelocityParameters{T} axis111::VelocityParameters{T} end ``` -------------------------------- ### readsiggen Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Reads data from a SigGen file. ```APIDOC ## GET readsiggen ### Description Reads data from a SigGen file. ### Method GET ### Endpoint /websites/juliaphysics_github_io_solidstatedetectors_jl_stable/readsiggen ### Parameters #### Query Parameters - **filename** (AbstractString) - Required - The path to the SigGen file. ### Response #### Success Response (200) - **Data** - The data read from the SigGen file. ``` -------------------------------- ### Calculate Electric Potential Source: https://juliaphysics.github.io/SolidStateDetectors.jl/stable/api Configures and executes the electric potential calculation for a simulation object. ```julia calculate_electric_potential!(sim, refinement_limits = [0.3, 0.1, 0.05], max_distance_ratio = 4, max_n_iterations = 20000) ```