Skip to content

Check if a point is inside the semiconductor #463

@gabrigarjim

Description

@gabrigarjim

Hello, new user of SSD here!

I am trying to check if a given cartesian point is inside the semiconductor geometry. I saw that in Event.jl (line 101) you check directly for that using

@assert charge_center in det.semiconductor "The center of the charge cloud ($(charge_center)) is not inside the semiconductor."

If I try something like this, what I get is

julia> point in sim.detector.semiconductor
ERROR: MethodError: no method matching iterate(::SolidStateDetectors.Semiconductor{…})
The function `iterate` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  iterate(::Pkg.Types.Manifest)
   @ Pkg /Applications/Julia-1.11.app/Contents/Resources/julia/share/julia/stdlib/v1.11/Pkg/src/Types.jl:308
  iterate(::Pkg.Types.Manifest, ::Int64)
   @ Pkg /Applications/Julia-1.11.app/Contents/Resources/julia/share/julia/stdlib/v1.11/Pkg/src/Types.jl:309
  iterate(::LLVM.FunctionParameterSet)
   @ LLVM ~/.julia/packages/LLVM/b3kFs/src/core/function.jl:209
  ...

Stacktrace:
 [1] in(x::CartesianPoint{…}, itr::SolidStateDetectors.Semiconductor{…})
   @ Base ./operators.jl:1305
 [2] top-level scope
   @ REPL[44]:1
Some type information was truncated. Use `show(err)` to see complete types.

Is there any way of checking this using a built-in feature that I did not noticed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions