Skip to content

Commit 3e5cb97

Browse files
authored
Merge branch 'main' into fix/issue-#523
2 parents 7050781 + 7747a8b commit 3e5cb97

File tree

54 files changed

+1785
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1785
-736
lines changed

.github/workflows/DocPreviewCleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
contents: write
1717
steps:
1818
- name: Checkout gh-pages branch
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020
with:
2121
ref: gh-pages
2222
- name: Delete preview and history + push changes

.github/workflows/Downgrade.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
matrix:
2222
version: ['1.10', '1.12']
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2525
- uses: julia-actions/setup-julia@v2
2626
with:
2727
version: ${{ matrix.version }}

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
arch: x86
5656
threads: 4
5757
steps:
58-
- uses: actions/checkout@v5
58+
- uses: actions/checkout@v6
5959
- uses: julia-actions/setup-julia@v2
6060
with:
6161
version: ${{ matrix.version }}
@@ -86,7 +86,7 @@ jobs:
8686
name: Documentation
8787
runs-on: ubuntu-latest
8888
steps:
89-
- uses: actions/checkout@v5
89+
- uses: actions/checkout@v6
9090
- uses: julia-actions/setup-julia@v2
9191
with:
9292
version: '1.10'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Geant4 = "0.1.13, 0.2"
6060
Interpolations = "0.14, 0.15, 0.16"
6161
IntervalSets = "0.6, 0.7"
6262
InverseFunctions = "0.1"
63-
JSON = "0.21.2, 1.1"
63+
JSON = "1.1"
6464
KernelAbstractions = "0.8, 0.9"
6565
LaTeXStrings = "1.1"
6666
LightXML = "0.9"

docs/src/man/charge_drift.md

Lines changed: 87 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ In order to set the `ElectricFieldChargeDriftModel` for the simulation, the prec
2727

2828
```julia
2929
T = SolidStateDetectors.get_precision_type(sim) # e.g. Float32
30-
charge_drift_model = ElectricFieldChargeDriftModel(T)
30+
charge_drift_model = ElectricFieldChargeDriftModel(T=T)
3131
sim.detector = SolidStateDetector(sim.detector, charge_drift_model)
3232
```
3333

@@ -44,7 +44,7 @@ On each axes, $v_{l}$ can be described through the parametrization proposed by [
4444
v_l = \frac{\mu_0 E}{(1 + (E/E_0 )^{\beta})^{1/ \beta}} - \mu_{n} E.
4545
```
4646

47-
The parameters $\mu_{0}$, $E_{0}$ and $\beta$ differ for electrons and holes, and $\mu_{n}$ is only relevant for electrons. These parameters were obtained by [B. Bruyneel et al.](https://www.sciencedirect.com/science/article/pii/S0168900206015166) by measuring the drift velocities of electrons and holes in the $\langle$100$\rangle$ and $\langle$111$\rangle$ directions in high purity germanium at a temperature of 78 K. These parameters are stored in a configuration file, "drift\_velocity\_config.yaml", located in `<package_directory>/example/example_config_files/ADLChargeDriftModel`. The configuration file is expressed as following:
47+
The parameters $\mu_{0}$, $E_{0}$ and $\beta$ differ for electrons and holes, and $\mu_{n}$ is only relevant for electrons. These parameters were obtained by [B. Bruyneel et al.](https://www.sciencedirect.com/science/article/pii/S0168900206015166) in 2006 and by [B. Bruyneel et al.](https://link.springer.com/article/10.1140/epja/i2016-16070-9) in 2016 by measuring the drift velocities of electrons and holes in the $\langle$100$\rangle$ and $\langle$111$\rangle$ directions in high purity germanium at a temperature of 77 K. These parameters are stored in a configuration file, "drift\_velocity\_config.yaml" and "drift\_velocity\_config\_2016.yaml" respectively, located in `<package_directory>/example/example_config_files/ADLChargeDriftModel`. The configuration file is expressed as following:
4848

4949

5050
```yaml
@@ -75,22 +75,61 @@ drift:
7575
E0: 182V/cm
7676
```
7777
78-
where the parameters are stored under the keys `e100`, `e111`, `h100` and `h111`, in which `e` and `h` stand for electrons and holes, respectively, and `100` and `111`, for the principal axes $\langle$100$\rangle$ and $\langle$111$\rangle$.
78+
where the parameters are stored under the keys `e100`, `e111`, `h100` and `h111`, in which `e` and `h` stand for electrons and holes, respectively, and `100` and `111`, for the principal axes $\langle$100$\rangle$ and $\langle$111$\rangle$. In the 2016 publication, no `e111` is given, instead the electron inter valley scattering rate is given. With these parameters the drift velocity can be calculated for the other axes.
79+
80+
```yaml
81+
model: ADL2016ChargeDriftModel
82+
phi110: -45°
83+
material: HPGe
84+
drift:
85+
velocity:
86+
model: Bruyneel2016
87+
parameters:
88+
e100:
89+
mu0: 37165cm^2/(V*s)
90+
beta: 0.804
91+
E0: 507.7V/cm
92+
mun: -145cm^2/(V*s)
93+
escattering:
94+
eta0: 0.496
95+
b: 0.0296
96+
Eref: 1200V/cm
97+
h100:
98+
mu0: 62934cm^2/(V*s)
99+
beta: 0.735
100+
E0: 181.9V/cm
101+
h111:
102+
mu0: 62383cm^2/(V*s)
103+
beta: 0.749
104+
E0: 143.9V/cm
105+
```
106+
79107
By default, in `SolidStateDetectors.jl` the $\langle$001$\rangle$ axis is aligned with the Z-axis of the coordinate system of the simulation. The crystal orientation can be set through the `phi110` parameter, where the $\langle$001$\rangle$ axis is still aligned with the Z-axis and the angle between the $\langle$110$\rangle$ principal direction of the crystal and the X-axis is given by `phi110`. Alternatively, the crystal orientation can be set by passing a rotation matrix that describes the rotation from the global coordinate system to the crystal orientation system.
80108

81109

82110
If the electric field is not aligned with any of the crystal axes, the charge drift velocity is not necessarily aligned with the electric field. In the [`ADLChargeDriftModel`](@ref), two models are implemented to describe the charge drift of electrons and holes between the axes. Detailed information about the charge drift models is provided in the papers from [L. Mihailescu et al. ](https://www.sciencedirect.com/science/article/pii/S0168900299012863) for electrons and from [B.Bruyneel et al.](https://www.sciencedirect.com/science/article/pii/S0168900206015166) for holes. Find the detailed calculations and modifications from the publications as implemented in SolidStateDetectors.jl [here](../assets/ADLChargeDriftModel.pdf).
83111

84112

85-
In order to perform the calculation of the drift velocities, a configuration file containing the parametrization values like the "drift\_velocity\_config.yaml" (with Bruyneel's data or modified values), has to be passed as an argument to the `ADLChargeDriftModel` function. The precision of the the calculation `T` (`Float32` or `Float64`) has to be given as a keyword `T`. Note that `T` has to be of the same type as the chosen in the simulation:
113+
In order to perform the calculation of the drift velocities, a configuration file containing the parametrization values like the "drift\_velocity\_config.yaml" (with Bruyneel's data or modified values), has to be passed as an argument to the `ADLChargeDriftModel` or `ADL2016ChargeDriftModel` function. The precision of the calculation `T` (`Float32` or `Float64`) has to be given as a keyword `T`. Note that `T` has to be of the same type as the chosen in the simulation:
86114

87115
```julia
88116
T = SolidStateDetectors.get_precision_type(sim) # e.g. Float32
89-
charge_drift_model = ADLChargeDriftModel("<path_to_ADL_configuration_file>", T=T)
117+
charge_drift_model = ADL2016ChargeDriftModel("<path_to_ADL_configuration_file>", T=T)
90118
sim.detector = SolidStateDetector(sim.detector, charge_drift_model)
91119
```
92120

121+
Default constructors such as `ADL2016ChargeDriftModel()` and `ADL2016ChargeDriftModel(T=T)` are also available. These automatically load the parameters from the files in `<package_directory>/example/example_config_files/ADLChargeDriftModel`
122+
93123
The `ÀDLChargeDriftModel` can also be specified already in the configuration file as field `charge_drift_model` of the `semiconductor` of a detector, e.g.
124+
```yaml
125+
detectors:
126+
semiconductor:
127+
# ...
128+
charge_drift_model:
129+
include: ADLChargeDriftModel/drift_velocity_config_2016.yaml
130+
```
131+
or
132+
94133
```yaml
95134
detectors:
96135
semiconductor:
@@ -121,27 +160,57 @@ The `charge_drift_model` needs:
121160
- `material` (optional): the semiconductor material. If no material is given, the `material` of the semiconductor is taken by default.
122161
- `drift`: the parameters needed to describe the longitudinal drift velocity along the $\langle$100$\rangle$ and $\langle$111$\rangle$ axes, see above.
123162

124-
The values from the default configuration file correspond to germanium at 78 K. Calculations of the drift velocities at other temperatures are also supported by the `ADLChargeDriftModel`. While experimental observations suggest that the charge mobilities of electrons and holes in the crystal are temperature dependent, the dependency law has not yet been established. Several models have been proposed to reproduce the experimental behavior, and some examples of them can be found in the directory `<package_directory>/src/ChargeDriftModels/ADL/`. The examples include a linear model, a Boltzmann model and a power-law model. To use these models in the calculation of the drift velocities, the corresponding configuration file, the temperature and the precision must be given to the function. As an example, in order to use the Boltzmann model at a temperature of 100 K:
163+
The values from the default configuration file correspond to germanium at 77 K. Calculations of the drift velocities at other temperatures are also supported by the `ADLChargeDriftModel`. A parametrization for the temperature dependence of drift velocity, as a function of the electric
164+
field strength, $E$, was proposed by [M.A. Omar and L. Reggiani](https://www.sciencedirect.com/science/article/pii/0038110187900633):
165+
```math
166+
\quad\mu_0(T) = A/T^P~, \quad V_s(T) = B\tanh^{1/2}(\theta/2T)
167+
```
168+
Note that the saturation velocity, $V_s$, is related to $E_0$ via
169+
```math
170+
E_0(T) = V_s(T)/\mu_0(T)
171+
```
172+
The four parameters, $A$, $P$, $B$, $\theta$, are different for electrons and holes.
173+
This model can be used to scale the $\mu_{0}$ and $E_{0}$ parameters of the `ADLChargeDriftModel` directly as follows:
174+
```math
175+
\mu_0(T) = \mu_0(77K) \left(\frac{T}{77K}\right)^{-P}~, \quad E_0(T) = E_0(77K) \sqrt{\frac{\tanh(\theta/2T)}{\tanh(\theta/2 \cdot 77K)}} \frac{\mu_0(77K)}{\mu_0(T)}
176+
```
177+
178+
The implementation of the model can be found in the directory `<package_directory>/src/ChargeDriftModels/ADLChargeDriftModel/TemperatureModels`. To use this in the calculation of the drift velocities, the corresponding configuration file, the temperature and the precision must be given to the function.
125179

126180
```julia
127181
T = SolidStateDetectors.get_precision_type(sim) # e.g. Float32
128-
charge_drift_model = ADLChargeDriftModel("<path_to_drift_velocity_config_boltzmann.yaml>", T = T, temperature = 100)
182+
charge_drift_model = ADL2016ChargeDriftModel("<path_to_ADL_configuration_file>", T = T, temperature = 100u"K")
129183
sim.detector = SolidStateDetector(sim.detector, charge_drift_model)
130184
```
131185

132186

133-
If no temperature is given as a parameter, the calculations will be performed at a default temperature of 78 K.
187+
If no temperature is given as a parameter, the calculations will be performed at a default temperature of 77 K. If no configuration file is given, the default config file `<package_directory>/example/example_config_files/ADLChargeDriftModel/drift_velocity_config_2016.yaml` is loaded. In charge drift configuration files, the M.A. Omar and L. Reggiani parametrization can be used by adding the following `temperature_dependence` field like this:
134188

135-
It should be noted that the correct model has not yet been identified, and the parameters inside these configuration files -besides the default ADL ones- are just educated guesses.
189+
```yaml
190+
temperature_dependence:
191+
reference_temperature: 77K
192+
model: Omar1987
193+
parameters:
194+
e:
195+
p: 1.68
196+
theta: 200K
197+
h:
198+
p: 2.4
199+
theta: 200K
200+
```
136201

202+
For convenience, this model can already be found in the `drift_velocity_config.yaml` and `drift_velocity_config_2016.yaml` example config files.
203+
204+
!!! note
205+
The default parameters used in this model were calculated by [M.A. Omar and L. Reggiani](https://www.sciencedirect.com/science/article/pii/0038110187900633) before the publication of the `ADLChargeDriftModel` parameters, with $\beta = 2$. Thus, the use of this model to scale the drift parameters in `ADLChargeDriftModel` or `ADL2016ChargeDriftModel` is considered experimental.
137206

138207
### Inactive Layer Charge Drift Model
139208

140209
The [`InactiveLayerChargeDriftModel`](@ref) describes a system in which electrons and holes move along the electric field lines. The mobilities for electrons and holes are scalar ($+$ for holes, and $-$ for electrons), and thus, the velocity field has the same (or opposite) direction as the electric field.
141210

142211
The mobilities are calculated considering three major scattering process: scattering off ionized impurities, neutral impurities and acoustic phonons. Thus, the mobilities depend on the impurity concentrations and temperature.
143212

144-
The precision of the the calculation `T` (`Float32` or `Float64`) has to be given as a keyword `T`. Note that `T` has to be of the same type as the chosen in the simulation:
213+
The precision of the calculation `T` (`Float32` or `Float64`) has to be given as a keyword `T`. Note that `T` has to be of the same type as the chosen in the simulation:
145214

146215
The `InactiveLayerChargeDriftModel` can be specified in the configuration file as field `charge_drift_model` of the `semiconductor` of a detector, e.g.
147216

@@ -416,7 +485,7 @@ using SolidStateDetectors #hide
416485
using Unitful #hide
417486
using Plots #hide
418487
T = Float64 #hide
419-
center = CartesianPoint{T}([0,0,0])
488+
center = CartesianPoint{T}(0,0,0)
420489
energy = 1460u"keV"
421490
nbcc = NBodyChargeCloud(center, energy)
422491
plot(nbcc)
@@ -428,7 +497,7 @@ plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-
428497
For an [`NBodyChargeCloud`](@ref) consisting of more than around 50 charges, the shells should consist of more than 20 point charges and the approach with using [Platonic Solids](@ref) for the shell structure might not be favored anymore. For this, a [second algorithm](https://www.cmu.edu/biolphys/deserno/pdf/sphere_equi.pdf) was implemented that generates point charges equally distributed on the surface of a regular sphere. The approximate number of charges needs to be passed to the constructor of [`NBodyChargeCloud`](@ref) to use this method.
429498

430499
````@example NBodyChargeCloud
431-
center = CartesianPoint{T}([0,0,0])
500+
center = CartesianPoint{T}(0,0,0)
432501
energy = 1460u"keV"
433502
nbcc = NBodyChargeCloud(center, energy, 100)
434503
plot(nbcc)
@@ -441,11 +510,11 @@ plot(nbcc, color = :red, size = (500,500), xlims = (-0.0012, 0.0012), ylims = (-
441510
Diffusion describes the random thermal motion of charge carriers. In SolidStateDetectors.jl, diffusion is simulated using a random walk algorithm. Diffusion is simulated using fixed-step vectors where the magnitude of the step vectors depends on the diffusion constant $D$ and the time steps $\Delta t$.
442511

443512
```julia
444-
center = CartesianPoint{T}([0,0,0])
513+
center = CartesianPoint{T}(0,0,0)
445514
energy = 1460u"keV"
446515
nbcc = NBodyChargeCloud(center, energy, 100)
447516
evt = Event(nbcc)
448-
simulate!(evt, sim, diffusion = true)
517+
simulate!(evt, sim, diffusion = true, end_drift_when_no_field = true)
449518
```
450519
![Diffusion](../assets/diffusion.gif)
451520

@@ -478,11 +547,11 @@ After the creation electron-hole pairs, both the electron and the hole clouds re
478547
SolidStateDetectors.jl does not account for attraction of electron and holes but only for repulsion of charge carriers of the same type. The determination of the electric field vector is calculated pair-wise for each pair of charge carriers.
479548

480549
```julia
481-
center = CartesianPoint{T}([0,0,0])
550+
center = CartesianPoint{T}(0,0,0)
482551
energy = 1460u"keV"
483552
nbcc = NBodyChargeCloud(center, energy, 100)
484553
evt = Event(nbcc)
485-
simulate!(evt, sim, self_repulsion = true)
554+
simulate!(evt, sim, self_repulsion = true, end_drift_when_no_field = true)
486555
```
487556
![SelfRepulsion](../assets/self_repulsion.gif)
488557

@@ -491,11 +560,11 @@ simulate!(evt, sim, self_repulsion = true)
491560

492561
[Diffusion](@ref) and [Self-Repulsion](@ref) can be simulated both at once to get the most realistic picture:
493562
```julia
494-
center = CartesianPoint{T}([0,0,0])
563+
center = CartesianPoint{T}(0,0,0)
495564
energy = 1460u"keV"
496565
nbcc = NBodyChargeCloud(center, energy, 100)
497566
evt = Event(nbcc)
498-
simulate!(evt, sim, diffusion = true, self_repulsion = true)
567+
simulate!(evt, sim, diffusion = true, self_repulsion = true, end_drift_when_no_field = true)
499568
```
500569
![GroupEffects](../assets/group_effects.gif)
501570

docs/src/man/config_files.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ units:
8787
```
8888
will lead to all `length` values to be parsed in units of `mm`, while all `angle` values will be parsed in units of `deg` (degree).
8989

90-
The configuration files also allow for directly passing units to the values that will be parsed using `uparse` from the [Unitful.jl](https://github.com/PainterQubits/Unitful.jl) package, e.g.
90+
The configuration files also allow for directly passing units to the values that will be parsed using `uparse` from the [Unitful.jl](https://github.com/JuliaPhysics/Unitful.jl) package, e.g.
9191
```yaml
9292
units:
9393
length: mm
@@ -114,7 +114,7 @@ tube:
114114
to: 4cm
115115
h: 6cm
116116
```
117-
In the last example, even if the `length` unit was set to `mm`, the values will be parsed in units of `cm`. Please note to not leave a white space between the value and the unit and to use the [Unitful.jl](https://github.com/PainterQubits/Unitful.jl) notation.
117+
In the last example, even if the `length` unit was set to `mm`, the values will be parsed in units of `cm`. Please note to not leave a white space between the value and the unit and to use the [Unitful.jl](https://github.com/JuliaPhysics/Unitful.jl) notation.
118118

119119

120120

docs/src/tutorials/geant4_ssd_lit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ events = run_geant4_simulation(app, N_events)
8989

9090
plot(sim.detector, show_passives = false, size = (500,500), fmt = :png)
9191
plot!(source_1)
92-
plot!(ustrip.(u"m", flatview(events[1:1000].pos)), ms = 0.5, msw = 0, color=:black, label = "")
92+
plot!(flatview(events[1:1000].pos), ms = 0.5, msw = 0, color=:black, label = "")
9393
#jl savefig("events.pdf") # hide
9494
#md savefig("events.pdf") # hide
9595
#md savefig("events.svg"); nothing # hide
@@ -150,4 +150,4 @@ plot(w[1:20], label = "")
150150
#jl savefig("wf_and_amplitude.pdf") # hide
151151
#md savefig("wf_and_amplitude.pdf") # hide
152152
#md savefig("wf_and_amplitude.svg"); nothing # hide
153-
#md # [![wf_and_amplitude](wf_and_amplitude.svg)](wf_and_amplitude.pdf)
153+
#md # [![wf_and_amplitude](wf_and_amplitude.svg)](wf_and_amplitude.pdf)
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
model: ADLChargeDriftModel
2-
phi110: 0
2+
phi110: 0°
33
material: Si
44
drift:
55
velocity:
66
model: Bruyneel2006
7-
temperature: 300
87
parameters:
98
e100:
10-
mu0: 0.144
9+
mu0: 1440cm^2/(V*s)
1110
beta: 0.992
12-
E0: 731944
13-
mun: 0
11+
E0: 7319.44V/cm
12+
mun: 0cm^2/(V*s)
1413
e111:
15-
mu0: 0.144
14+
mu0: 1440cm^2/(V*s)
1615
beta: 1.075
17-
E0: 731944
18-
mun: 0
16+
E0: 7319.44V/cm
17+
mun: 0cm^2/(V*s)
1918
h100:
20-
mu0: 0.0474
19+
mu0: 474cm^2/(V*s)
2120
beta: 1.181
22-
E0: 1983122
21+
E0: 19831.22V/cm
2322
h111:
24-
mu0: 0.0474
23+
mu0: 474cm^2/(V*s)
2524
beta: 0.924
26-
E0: 1983122
25+
E0: 19831.22V/cm
26+
temperature_dependence:
27+
reference_temperature: 300K

examples/example_config_files/ADLChargeDriftModel/drift_velocity_config.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,14 @@ drift:
2222
h111:
2323
mu0: 61215cm^2/(V*s)
2424
beta: 0.662
25-
E0: 182V/cm
25+
E0: 182V/cm
26+
temperature_dependence:
27+
reference_temperature: 78K
28+
model: Omar1987
29+
parameters:
30+
e:
31+
p: 1.68
32+
theta: 200K
33+
h:
34+
p: 2.4
35+
theta: 200K

examples/example_config_files/ADLChargeDriftModel/drift_velocity_config_2016.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,14 @@ drift:
2121
h111:
2222
mu0: 62383cm^2/(V*s)
2323
beta: 0.749
24-
E0: 143.9V/cm
24+
E0: 143.9V/cm
25+
temperature_dependence:
26+
reference_temperature: 77K
27+
model: Omar1987
28+
parameters:
29+
e:
30+
p: 1.68
31+
theta: 200K
32+
h:
33+
p: 2.4
34+
theta: 200K

0 commit comments

Comments
 (0)