Defines the primary generator action for the simulation.
More...
#include <PlasmaMLPALLASPrimaryGeneratorAction.hh>
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
- Copyright
- PALLAS Project - GEANT4 Collaboration
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.
◆ PlasmaMLPALLASPrimaryGeneratorAction()
PlasmaMLPALLASPrimaryGeneratorAction::PlasmaMLPALLASPrimaryGeneratorAction |
( |
size_t |
N, |
|
|
size_t |
numThreads, |
|
|
bool |
pMT |
|
) |
| |
Constructor.
Constructor for the primary generator action.
- Parameters
-
N | Number of events to generate. |
numThreads | Number of threads in multithreaded mode. |
pMT | Flag to enable multithreading. |
Initializes the particle gun, particle source, ONNX inference engine, and the associated UI messenger.
- Parameters
-
N | Total number of events to generate. |
numThreads | Number of threads used for multithreaded execution. |
pMT | Flag indicating whether multithreading is enabled. |
◆ ~PlasmaMLPALLASPrimaryGeneratorAction()
PlasmaMLPALLASPrimaryGeneratorAction::~PlasmaMLPALLASPrimaryGeneratorAction |
( |
| ) |
|
Destructor.
Cleans up allocated resources such as the particle gun and particle source.
◆ GeneratePrimaries()
void PlasmaMLPALLASPrimaryGeneratorAction::GeneratePrimaries |
( |
G4Event * |
anEvent | ) |
|
|
override |
Generate primary particles for the event.
Generate primary particles for a simulation event.
- Parameters
-
anEvent | Pointer 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
-
anEvent | Pointer to the Geant4 event where primary particles are generated. |
◆ GetdEkin()
double PlasmaMLPALLASPrimaryGeneratorAction::GetdEkin |
( |
| ) |
const |
|
inline |
◆ GetEkin()
double PlasmaMLPALLASPrimaryGeneratorAction::GetEkin |
( |
| ) |
const |
|
inline |
◆ GetEPSB()
double PlasmaMLPALLASPrimaryGeneratorAction::GetEPSB |
( |
| ) |
const |
|
inline |
◆ 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 |
◆ GetML_Xoff()
double PlasmaMLPALLASPrimaryGeneratorAction::GetML_Xoff |
( |
| ) |
const |
|
inline |
Get X-offset from ONNX parameters
◆ GetQ()
double PlasmaMLPALLASPrimaryGeneratorAction::GetQ |
( |
| ) |
const |
|
inline |
◆ UpdateParticleDefinition()
void PlasmaMLPALLASPrimaryGeneratorAction::UpdateParticleDefinition |
( |
| ) |
|
Update the particle definition based on current parameters.
The documentation for this class was generated from the following files: