QEDjl-project / QEDprocesses.jl

[WIP]: QEDprocesses.jl: Modeling of scattering processes for QED.jl
MIT License
1 stars 3 forks source link

ProcessDefinition interface extension #77

Open AntonReinhard opened 1 week ago

AntonReinhard commented 1 week ago

Extend the number_particles interface function with this function and default implementation:

@inline function number_particles(
    proc_def::AbstractProcessDefinition, dir::DIR, ::PT
) where {DIR<:ParticleDirection,PT<:AbstractParticleType}
    return count(x -> x isa PT, particles(proc_def, dir))
end

Opening this as an issue instead of a PR because of the ongoing refactoring. It will be easier to add this (then in QEDbase.jl) once that is done.