Skip to content
Discussion options

You must be logged in to vote

For a source that looks like a Box, you can try this:

using SolidStateDetectors, Geant4, Unitful
const G4Ext = Base.get_extension(SolidStateDetectors, :SolidStateDetectorsGeant4Ext)

using SolidStateDetectors: AbstractParticleSource, RealQuantity
using SolidStateDetectors.ConstructiveSolidGeometry: Box, _transform_into_global_coordinate_system

struct MonoenergeticBoxSource <: AbstractParticleSource
    particle_type::String
    energy::RealQuantity
    position::Box
end

function G4Ext.SSDGenerator(source::MonoenergeticBoxSource;  kwargs...)

    data = G4Ext.GeneratorData(; kwargs...)

    function _init(data::G4Ext.GeneratorData, ::Any)
        gun = data.gun = move!(G4ParticleGun())
 …

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
10 replies
@fhagemann
Comment options

@fhagemann
Comment options

Answer selected by fhagemann
@fhagemann
Comment options

@rajxabc
Comment options

@fhagemann
Comment options

@rajxabc
Comment options

Comment options

You must be logged in to vote
1 reply
@rajxabc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants