@@ -11,14 +11,14 @@ using SolidStateDetectors
1111T = Float64
1212
1313# the geometry parameters of the model for following display
14- mm= T (1 / 1000 )
15- det_rin= 1 * mm
16- det_z= det_r= 10 * mm
17- z_draw= det_z/ 2
18- pn_r= 8.957282 * mm # this one was calculated by searching the zero impurity point (displayed in the following section)
14+ mm = T (1 / 1000 )
15+ det_rin = 1 * mm
16+ det_z = det_r = 10 * mm
17+ z_draw = det_z/ 2
18+ pn_r = 8.957282 * mm # this one was calculated by searching the zero impurity point (displayed in the following section)
1919
2020sim = Simulation {T} (SSD_examples[:TrueCoaxial ])
21- cfn= SSD_examples[:TrueCoaxial ]
21+ cfn = SSD_examples[:TrueCoaxial ]
2222print (open (f -> read (f, String), cfn))
2323plot (sim. detector, xunit = u " mm" , yunit = u " mm" , zunit = u " mm" )
2424# jl savefig("tutorial_det_dl.pdf") # hide
@@ -28,10 +28,10 @@ plot(sim.detector, xunit = u"mm", yunit = u"mm", zunit = u"mm")
2828
2929# ## Display the impurity profile defined
3030# > Above position of the PN junction boundary `pn_r` is calculate by searching the point on the curve where the density is zero.
31- r_list= (0 * mm): (0.01 * mm): det_r
31+ r_list = (0 * mm): (0.01 * mm): det_r
3232imp_list = T[]
3333for r in r_list
34- pt= CylindricalPoint {T} (r, 0 , z_draw)
34+ pt = CylindricalPoint {T} (r, 0 , z_draw)
3535 push! (imp_list, SolidStateDetectors. get_impurity_density (sim. detector. semiconductor. impurity_density_model, pt))
3636end
3737imp_list = imp_list ./ 1e6 # in cm^-3
@@ -47,12 +47,11 @@ vline!([pn_r/mm], lw = 2, ls = :dash, color = :darkred, label = "PN junction bou
4747using SolidStateDetectors: Electron, Hole
4848cdm = sim. detector. semiconductor. charge_drift_model
4949depth_list = 0 : (0.01 * mm): (det_r- pn_r)
50- hole_mobility_list= []
51- electron_mobility_list= []
50+ hole_mobility_list = []
51+ electron_mobility_list = []
5252for depth in depth_list
53- r= det_r- depth
54- pt = CylindricalPoint {T} ([r, 0 , z_draw])
55- pt = CartesianPoint {T} (pt)
53+ r = det_r- depth
54+ pt = CartesianPoint {T} (r, 0 , z_draw)
5655 push! (hole_mobility_list, SolidStateDetectors. calculate_mobility (cdm, pt, Hole))
5756 push! (electron_mobility_list, SolidStateDetectors. calculate_mobility (cdm, pt, Electron))
5857end
@@ -70,9 +69,9 @@ plot!(ylabel = "Mobility [cm\$^2\$/V/s]", xlabel = "Depth to surface [mm]",
7069calculate_electric_potential! (sim, max_n_iterations = 10 , grid = Grid (sim), verbose = false , depletion_handling = true )
7170g = sim. electric_potential. grid
7271ax1, ax2, ax3 = g. axes
73- bulk_tick_dis= 0.05 * mm
74- dl_tick_dis= 0.01 * mm
75- user_additional_ticks_ax1= sort (vcat (ax1. interval. left: bulk_tick_dis: pn_r, pn_r: dl_tick_dis: ax1. interval. right))
72+ bulk_tick_dis = 0.05 * mm
73+ dl_tick_dis = 0.01 * mm
74+ user_additional_ticks_ax1 = sort (vcat (ax1. interval. left: bulk_tick_dis: pn_r, pn_r: dl_tick_dis: ax1. interval. right))
7675user_ax1 = typeof (ax1)(ax1. interval, user_additional_ticks_ax1)
7776user_g = typeof (g)((user_ax1, ax2, ax3))
7877calculate_electric_potential! (sim, refinement_limits = 0.1 , use_nthreads = 8 , grid = user_g, depletion_handling = true )
@@ -81,7 +80,7 @@ calculate_weighting_potential!(sim, 1, use_nthreads = 8, depletion_handling = tr
8180calculate_weighting_potential! (sim, 2 , use_nthreads = 8 , depletion_handling = true );
8281plot (
8382 begin
84- imp= plot (sim. imp_scale, φ = 0 , xunit = u " mm" , yunit = u " mm" , title = " impurity scale" )
83+ imp = plot (sim. imp_scale, φ = 0 , xunit = u " mm" , yunit = u " mm" , title = " impurity scale" )
8584 vline! ([pn_r/ mm], lw = 2 , ls = :dash , color = :darkred , label = " PN junction boundary" , legendfontsize = 6 )
8685 end ,
8786 begin
@@ -109,25 +108,25 @@ pulse_list = []
109108totTime = 5 # us
110109totEnergy = 1 # 1 keV --> simulating ~339 carrier pairs
111110max_nsteps = Int (totTime * 1000 )
112- N= Int (totEnergy* 1000 ÷ 2.95 )
111+ N = Int (totEnergy* 1000 ÷ 2.95 )
113112for depth in depth_list
114- r= det_r- depth
113+ r = det_r- depth
115114 energy_depos = fill (T (2.95 / 1000 ), N) * u " keV"
116- starting_positions = repeat ([CylindricalPoint {T} (r, deg2rad (0 ), z_draw)], N)
115+ starting_positions = repeat ([CartesianPoint {T} (r, deg2rad (0 ), z_draw)], N)
117116 evt = Event (starting_positions, energy_depos);
118117 simulate! (evt, sim, Δt = 1 u " ns" , max_nsteps = max_nsteps, diffusion = true , end_drift_when_no_field = false , self_repulsion = false )
119- charge= ustrip (evt. waveforms[1 ]. signal)
118+ charge = ustrip (evt. waveforms[1 ]. signal)
120119 push! (pulse_list, charge)
121120end
122- pulse_plot= plot ()
121+ pulse_plot = plot ()
123122eff_list = []
124123for (i, depth) in enumerate (depth_list)
125- depth= round (depth/ mm, digits = 1 )
124+ depth = round (depth/ mm, digits = 1 )
126125 plot! (pulse_list[i], label = " Depth: $(depth) mm" , lw = 2 , xlabel = " Time [ns]" , ylabel = " Amplitude [e]" ,
127126 legend = :topright , grid = :on , minorgrid = :on , frame = :box )
128127 push! (eff_list, maximum (pulse_list[i])/ N)
129128end
130- cce_plot= plot (depth_list/ mm, eff_list, xlabel = " Depth to surface [mm]" , lw = 2 , ylabel = " Charge collection efficiency" ,
129+ cce_plot = plot (depth_list/ mm, eff_list, xlabel = " Depth to surface [mm]" , lw = 2 , ylabel = " Charge collection efficiency" ,
131130 frame = :box , grid = :on , minorgrid = :on , xticks = 0 : 0.2 : 1.2 , yticks = 0 : 0.1 : 1 , dpi = 500 , color = :black , label = " " )
132131plot (pulse_plot, cce_plot, layout = (1 , 2 ), size = (1000 , 400 ), margin = 5 Plots. mm)
133132# jl savefig("tutorial_pulse_cce_dl.pdf") # hide
0 commit comments