PlasmaMLPALLAS
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PlasmaMLPALLASPrimaryGeneratorAction Class Reference

Defines the primary generator action for the simulation. More...

#include <PlasmaMLPALLASPrimaryGeneratorAction.hh>

Inheritance diagram for PlasmaMLPALLASPrimaryGeneratorAction:
Inheritance graph
[legend]
Collaboration diagram for PlasmaMLPALLASPrimaryGeneratorAction:
Collaboration graph
[legend]

Public Member Functions

 PlasmaMLPALLASPrimaryGeneratorAction (size_t N, size_t numThreads, bool pMT)
 Constructor.
 
 ~PlasmaMLPALLASPrimaryGeneratorAction ()
 Destructor.
 
void GeneratePrimaries (G4Event *anEvent) override
 Generate primary particles for the event.
 
void UpdateParticleDefinition ()
 Update the particle definition based on current parameters.
 
Laser & beam parameters (retrieved from OnnxParameters)
double GetML_Xoff () const
 
double GetML_A0 () const
 
double GetML_CN2 () const
 
double GetML_Pressure () const
 
Beam properties
double GetEkin () const
 
double GetdEkin () const
 
double GetQ () const
 
double GetEPSB () const
 

Detailed Description

Defines the primary generator action for the simulation.

Author
Arnaud HUBER huber.nosp@m.@lp2.nosp@m.ib.in.nosp@m.2p3..nosp@m.fr - Alexei SYTOV sytov.nosp@m.@inf.nosp@m.n.it
Date
2025

This class controls the generation of primary particles in the Geant4 simulation.
It integrates ONNX inference for beam parameter prediction and provides methods to configure laser and beam properties in a multithreaded environment.

Constructor & Destructor Documentation

◆ PlasmaMLPALLASPrimaryGeneratorAction()

PlasmaMLPALLASPrimaryGeneratorAction::PlasmaMLPALLASPrimaryGeneratorAction ( size_t  N,
size_t  numThreads,
bool  pMT 
)

Constructor.

Constructor for the primary generator action.

Parameters
NNumber of events to generate.
numThreadsNumber of threads in multithreaded mode.
pMTFlag to enable multithreading.

Initializes the particle gun, particle source, ONNX inference engine, and the associated UI messenger.

Parameters
NTotal number of events to generate.
numThreadsNumber of threads used for multithreaded execution.
pMTFlag indicating whether multithreading is enabled.

◆ ~PlasmaMLPALLASPrimaryGeneratorAction()

PlasmaMLPALLASPrimaryGeneratorAction::~PlasmaMLPALLASPrimaryGeneratorAction ( )

Destructor.

Cleans up allocated resources such as the particle gun and particle source.

Member Function Documentation

◆ GeneratePrimaries()

void PlasmaMLPALLASPrimaryGeneratorAction::GeneratePrimaries ( G4Event *  anEvent)
override

Generate primary particles for the event.

Generate primary particles for a simulation event.

Parameters
anEventPointer to the current G4Event.

Depending on the ONNX status, this function either:

  • Uses the ONNX model inference to generate beam parameters and configure the particle gun.
  • Uses the Geant4 GeneralParticleSource (GPS) to generate the particle.
Parameters
anEventPointer to the Geant4 event where primary particles are generated.

◆ GetdEkin()

double PlasmaMLPALLASPrimaryGeneratorAction::GetdEkin ( ) const
inline

Get energy spread (%)

◆ GetEkin()

double PlasmaMLPALLASPrimaryGeneratorAction::GetEkin ( ) const
inline

Get kinetic energy (MeV)

◆ GetEPSB()

double PlasmaMLPALLASPrimaryGeneratorAction::GetEPSB ( ) const
inline

Get beam emittance (µm)

◆ GetML_A0()

double PlasmaMLPALLASPrimaryGeneratorAction::GetML_A0 ( ) const
inline

Get amplitude from ONNX parameters

◆ GetML_CN2()

double PlasmaMLPALLASPrimaryGeneratorAction::GetML_CN2 ( ) const
inline

Get CN2 turbulence parameter

◆ GetML_Pressure()

double PlasmaMLPALLASPrimaryGeneratorAction::GetML_Pressure ( ) const
inline

Get pressure value

◆ GetML_Xoff()

double PlasmaMLPALLASPrimaryGeneratorAction::GetML_Xoff ( ) const
inline

Get X-offset from ONNX parameters

◆ GetQ()

double PlasmaMLPALLASPrimaryGeneratorAction::GetQ ( ) const
inline

Get charge (pC)

◆ UpdateParticleDefinition()

void PlasmaMLPALLASPrimaryGeneratorAction::UpdateParticleDefinition ( )

Update the particle definition based on current parameters.


The documentation for this class was generated from the following files: