Public API
Documentation for Geant4.jl public interface.
Index - Types
Geant4.G4JLApplicationGeant4.G4JLDetectorGDMLGeant4.G4JLMagneticFieldGeant4.G4JLMagneticFieldGeant4.G4JLMagneticFieldGeant4.G4JLPrimaryGeneratorGeant4.G4JLScoringMeshGeant4.G4JLSensitiveDetector
Index - Functions
Geant4.G4JL_printlnGeant4.GetVolumeGeant4.GetWorldVolumeGeant4.beamOnGeant4.configureGeant4.getSDdataGeant4.getSIMdataGeant4.getfieldGeant4.initializeGeant4.move!Geant4.reinitialize
Types
Geant4.G4JLApplication — MethodG4JLApplication(<keyword arguments>)Initialize a G4JLApplication with its associated tyopes and methods.
Arguments
detector::G4JLDetector: detector description objectsimdata=G4JLNoData(): simulation data objectgenerator=G4JLParticleGun(): primary particle generatorfield=nothing: magnetic fieldevtdisplay=nothing: event display (visualization)nthreads=0: number of Geant4 worker threads ( >0 implies MT)verbose=0: default verbority level (physics, ...)runmanager_type=G4RunManager: run manager typebuilder_type=G4JLDetectorConstruction: detector builder type (the default should be fine most cases)physics_type=FTFP_BERT: physics list typestepaction_type=G4JLSteppingAction: stepping action type (the default should be fine most cases)trackaction_type=G4JLTrackingAction: rtacking action type (the default should be fine most cases)runaction_type=G4JLRunAction: run action type (the default should be fine most cases)eventaction_type=G4JLEventAction: event action type (the default should be fine most cases)stepaction_method=nothing: stepping action method with signature(::G4Step, ::G4JLApplication)::Nothingpretrackaction_method=nothing: pre-tracking action method with signature(::G4Track, ::G4JLApplication)::Nothingposttrackaction_method=nothing: post-tracking action method with signature(::G4Track, ::G4JLApplication)::Nothingbeginrunaction_method=nothing: begin run action method with signature(::G4Run, ::G4JLApplication)::Nothingendrunaction_method=nothing: end run action method with signature(::G4Run, ::G4JLApplication)::Nothingbegineventaction_method=nothing: begin event action method with signature(::G4Event, ::G4JLApplication)::Nothingendeventaction_method=nothing: end event action method with signature(::G4Event, ::G4JLApplication)::Nothingstackaction_method=nothing: stacking classification of new track with signature(::G4Track, ::G4JLApplication)::G4ClassificationOfNewTrackstatechange_method=nothing: state change notifycation method with signature(from::G4ApplicationState, to::G4ApplicationState, ::G4JLApplication)::Boolsdetectors::Vector{}=[]: vector of pairslv::String => sd::G4JLSensitiveDetectorto associate logical volumes to sensitive detectorscorers::Vector{}=[]: vector ofG4JLScoringMeshs
Geant4.G4JLDetectorGDML — MethodG4JLDetectorGDML(gdmlfile::String; check_overlap::Bool, validate_schema::Bool, init_method::Union{Function,Nothing})Initialize a G4JLDetector from a GDML file. The GDML file is parsed at this moment.
Arguments
gdmlfile::String: GDML file namecheck_overlap::Bool=false: check for overlapsvalidate_schema::Bool=true: validate the schemainit_method::Union{Function,Nothing}=nothing: initialization method to be called when the detector is constructed
Geant4.G4JLMagneticField — TypeCustom Magnetic FieldGeant4.G4JLMagneticField — MethodG4JLUniformMagField(field::G4ThreeVector)Create a Uniform magnetic field
Arguments
field::G4ThreeVector: magnetic field vector
Geant4.G4JLMagneticField — MethodG4JLMagneticField(name::String, data::DATA; <keyword arguments>) where DATA<:G4JLGeneratorDataCreate a G4JLMagneticField with its name and associated DATA structure
Arguments
name::String: magnetic field namedata::DATA: data structure associated to the magnetic fieldgetfield_method=nothing: user providedgetfieldfunction with signature:(result::G4ThreeVector, position::G4ThreeVector, ::DATA)
Geant4.G4JLPrimaryGenerator — MethodG4JLPrimaryGenerator(name::String, data::DATA; <keyword arguments>) where DATA<:G4JLGeneratorDataCreatre a G4JLPrimaryGenerator with its name and associated DATA structure
Arguments
Geant4.G4JLScoringMesh — MethodG4JLScoringMesh(name, mesh; <keyword arguments>)Create a scoring mesh to be added to the Geant4 application.
Arguments
name::String: scoring mech namemesh::AbstractMesh: mesh instance. Either aBoxMeshorCylinderMeshbins::Tuple: tuple with number on bins in x, y, z (default 30, 30, 30)translation::Tuple: position (x,y,z) with respect the mesh respect to the world volume. Default is (0,0,0).rotation::Tuple: rotation of the mesh with respect the world volume. Default (0,0,0)quantities::Vector: vector of quanties to be scored (e.g.energyDeposit,doseDeposit,nOfStep)
Geant4.G4JLSensitiveDetector — MethodG4JLSensitiveDetector(name::String, data::DATA; <keyword arguments>) where DATA<:G4JLSDDataInitialize a G4JLSensitiveDetector with its name and associated DATA structure.
Arguments
name::String: Sensitive detector namedata::DATA: Data structure associted to the sensitive detectorprocesshits_method=nothing: processHit function with signature:(data::DATA, step::G4Step, ::G4TouchableHistory)::Boolinitialize_method=nothing: intialize function with signature:(data::DATA, ::G4HCofThisEvent)::Nothingendofevent_method=nothing: endOfEvent function with signature:(data::DATA, ::G4HCofThisEvent)::Nothing
Functions
Geant4.G4JL_println — FunctionG4JL_println(::AbstractString)Print the string to the Geant4 output in a thread safe manner prefixing the string with the thread ID.
Arguments
s::AbstractString: string to be printed
Geant4.GetVolume — MethodGetVolume(name::String)Get the the G4LogicalVolume with this name.
Arguments
name::String: logical volume name
Geant4.GetWorldVolume — MethodGetWorldVolume()Get the world volume of the currently instantiated detector geometry.
Geant4.beamOn — MethodbeamOn(app::G4JLApplication, nevents::Int)Start a new run with nevents events. In case of multi-threading, the function enters a GC safe state before starting the run.
Arguments
app::G4JLApplication: Geant4 applicationnevents::Int: number of events
Geant4.configure — Methodconfigure(app::G4JLApplication)Configure the Geant4 application. It sets the declared user actions, event generator, and physcis list.
Arguments
app::G4JLApplication: Geant4 application
Geant4.getSDdata — MethodgetSDdata(app::G4JLApplication, name::String)Get the data associated to the Sentitive Detector with a given name taking into account the current worker thread ID
Arguments
app::G4JLApplication: Geant4 applicationname::String: sensitive detector name
Geant4.getSIMdata — MethodgetSIMdata(app::G4JLApplication)Get the Simulation Data taking into account the current worker thread ID
Arguments
app::G4JLApplication: Geant4 application
Geant4.getfield — Methodgetfield(pos::G4ThreeVector, bfield::G4JLMagneticField)Function to exercise a custom magnetic field
Arguments
pos::G4ThreeVector: positionbfield::G4JLMagneticField: magnetic field object
Geant4.initialize — Methodinitialize(app::G4JLApplication)Initialize the Geant4 application. It initializes the G4RunManager, which constructs the detector geometry, and sets the declared sensitive detectors. In case of multi-threading, the function enters a GC safe state before initializing the application, which will be calling thebuild()` functions by the worker threads.
Arguments
app::G4JLApplication: Geant4 application
Geant4.move! — Methodmove!(o)Move ownerhip of C++ object to receiver. The object cannot not be used anymore after this call.
Geant4.reinitialize — Methodreinitialize(app::G4JLApplication, det::G4JLDetector)Re-initialize the Geant4 application with a new detector defintion.
Arguments
app::G4JLApplication: Geant4 applicationdet::G4JLDetector: new detector definition