Skip to content

Point types documentation and FDD calculation - #616

Merged
fhagemann merged 9 commits into
JuliaPhysics:mainfrom
claudiaalvgar:point_types_documentation
Jul 28, 2026
Merged

fhagemann merged 9 commits into
JuliaPhysics:mainfrom
claudiaalvgar:point_types_documentation

Conversation

@claudiaalvgar

Copy link
Copy Markdown
Collaborator

A new manual page is added to document the PointTypes behaviour. The six bit flags, their combined values, how they are used by is_depleted, get_active_volume, and estimate_depletion_voltage to exclude the inactive layer, how mark_inactivelayer_bits! propagates the inactive layer flag outward from the doped contact, and a detailed description of how the new get_FDD function extracts the two contours and computes the FDD thickness.

Example plots show the inner contour overlaid on the point-type map and a heat-map of FDD thickness across the detector cross-section.
FDD_example

The new function get_FDD, computes the Full Depletion Depth (FDD), the thickness of the inactive lithium-doped layer. For each inner contour point it returns the coordinates of the transition between the inactive layer and the active bulk (r_inner/z_inner), the coordinates of the nearest point on the doped contact surface (r_outer/z_outer), and the perpendicular thickness of the inactive layer.
When the impurity model is PtypePNJunctionImpurityDensity or ThermalDiffusionLithiumDensity, the thickness is computed analytically via ConstructiveSolidGeometry.distance_to_surface, giving exact perpendicular distances for any surface orientation (vertical, horizontal, or diagonal). For other models it falls back to the Euclidean distance to the nearest contact-surface grid tick. Both Cylindrical and Cartesian variants are implemented.

The outer contour (r_outer/z_outer) is collected from grid ticks that carry inactive_contact_bit directly, which lie on the contact surface itself since SSD places grid ticks at contact boundaries. This means that for axis-aligned surfaces the Euclidean distance between inner and outer contour points equals the analytical thickness exactly; for diagonal surfaces (e.g. a cone face) a small residual difference remains because the nearest contact tick is not the exact perpendicular foot.
A helper function _dist_to_inactive_contact is added to extract the distance_to_contact from the impurity density model, or return nothing to trigger the Euclidean fallback. Tests for get_FDD are added to test_depletion.jl

Comment thread docs/src/man/point_types.md Resolved
Comment thread docs/src/man/point_types.md Resolved
Comment thread docs/src/man/point_types.md Resolved
Comment thread docs/src/man/point_types.md Resolved
Comment thread docs/src/man/point_types.md Resolved
Comment thread src/Simulation/Depletion.jl Resolved
Comment thread src/Simulation/Depletion.jl Resolved
Comment thread src/SolidStateDetectors.jl Resolved
Comment thread test/test_depletion.jl Resolved
Comment thread test/test_depletion.jl Resolved
Comment thread src/Simulation/Depletion.jl Resolved
@fhagemann

Copy link
Copy Markdown
Collaborator

I just merged #624, so that should hopefully fix the failing windows test. Rerunning the tests for this PR now.

@fhagemann fhagemann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two minor comments and still the open question whether we want to keep calling it get_fdd or something else.

Based on the fact that we also call it get_active_volume or calculate_capacitance, I might be slightly in favor to avoid using the abbreviation fdd but call it get_full_depletion_depth. Thoughts?

Comment thread docs/src/man/point_types.md Resolved
Comment thread docs/src/man/point_types.md Resolved
@claudiaalvgar

Copy link
Copy Markdown
Collaborator Author

In the last commit I changed get_fdd by get_full_depletion_depth, I think it's more intuitive too, I used initially the abreviation because it's shorter

Comment thread docs/src/man/point_types.md Resolved
Comment thread test/test_depletion.jl Resolved

@fhagemann fhagemann left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed the last changes. I will wait and see that the tests pass and then continue with merging this :)

@fhagemann
fhagemann merged commit 5a0e7a7 into JuliaPhysics:main Jul 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants