|
| | Gparticle (const std::string &name, int multiplicity, double p, double delta_p, const std::string &randomMomentumModel, double theta, double delta_theta, const std::string &thetaModel, double phi, double delta_phi, double avx, double avy, double avz, double adelta_vx, double adelta_vy, double adelta_vz, const std::string &randomVertexModel, const std::shared_ptr< GLogger > &logger, int generator_type=1) |
| | Constructs a particle configuration from pre-converted G4-unit values.
|
| |
| | Gparticle (const Gparticle &)=delete |
| | Copying is disabled.
|
| |
| Gparticle & | operator= (const Gparticle &)=delete |
| | Copy assignment is disabled.
|
| |
| | ~Gparticle () |
| | Destructor emits a debug-level lifecycle message.
|
| |
| void | shootParticle (G4ParticleGun *particleGun, G4Event *anEvent) |
| | Shoots this particle configuration into a Geant4 event.
|
| |
| const std::string & | getName () const |
| | Returns the particle name stored in this generator definition.
|
| |
| int | getPid () const |
| | Returns the resolved PDG particle id.
|
| |
| int | getMultiplicity () const |
| | Returns how many copies are generated per event.
|
| |
| double | getMomentum () const |
| | Returns the nominal momentum magnitude.
|
| |
| double | getTheta () const |
| | Returns the nominal polar angle.
|
| |
| double | getPhi () const |
| | Returns the nominal azimuthal angle.
|
| |
| const G4ThreeVector & | getVertex () const |
| | Returns the nominal vertex position.
|
| |
| double | getDeltaMomentum () const |
| | Returns the momentum spread parameter (GEMC internal units, MeV).
|
| |
| std::string | getMomentumModel () const |
| | Returns the momentum randomization model as a string token.
|
| |
| double | getDeltaTheta () const |
| | Returns the polar-angle spread parameter (GEMC internal units, radians).
|
| |
| std::string | getThetaModel () const |
| | Returns the theta randomization model as a string token.
|
| |
| double | getDeltaPhi () const |
| | Returns the azimuthal-angle spread parameter (GEMC internal units, radians).
|
| |
| const G4ThreeVector & | getDeltaVertex () const |
| | Returns the vertex spread vector (GEMC internal units, mm).
|
| |
| std::string | getVertexModel () const |
| | Returns the vertex randomization model as a string token.
|
| |
| int | getGeneratorType () const |
| | Returns the generator source type.
|
| |
| const std::vector< GparticleRuntimeRecord > & | getRuntimeRecords () const |
| | Returns the runtime records from the most recent shoot.
|
| |
| void | setName (const std::string &n) |
| |
| void | setMultiplicity (int m) |
| |
| void | setMomentum (double p_mev) |
| |
| void | setDeltaMomentum (double dp) |
| |
| void | setMomentumModel (const std::string &s) |
| |
| void | setTheta (double t_rad) |
| |
| void | setDeltaTheta (double dt) |
| |
| void | setThetaModel (const std::string &s) |
| |
| void | setPhi (double ph_rad) |
| |
| void | setDeltaPhi (double dp) |
| |
| void | setVertexX (double x) |
| |
| void | setVertexY (double y) |
| |
| void | setVertexZ (double z) |
| |
| void | setDeltaVertexX (double x) |
| |
| void | setDeltaVertexY (double y) |
| |
| void | setDeltaVertexZ (double z) |
| |
| void | setVertexModel (const std::string &s) |
| |
A Gparticle instance represents a generator-level particle configuration that can be used to produce primary vertices in a G4Event through a G4ParticleGun.
The class stores:
- Identity: particle name and resolved PDG id
- Multiplicity: number of copies shot per event
- Kinematics: momentum magnitude and angular parameters
- Vertex: position and optional spread/randomization
- Randomization models: selection of uniform/gaussian/cosine (angles) and sphere (vertex)
Configuration is typically created by option parsing utilities and then used during event generation by calling shootParticle().
Logging:
- A logger is provided at construction and retained for diagnostics.
- Verbosity 2 typically prints a full configuration summary via the stream operator.
Definition at line 88 of file gparticle.h.
| Gparticle::Gparticle |
( |
const std::string & | name, |
|
|
int | multiplicity, |
|
|
double | p, |
|
|
double | delta_p, |
|
|
const std::string & | randomMomentumModel, |
|
|
double | theta, |
|
|
double | delta_theta, |
|
|
const std::string & | thetaModel, |
|
|
double | phi, |
|
|
double | delta_phi, |
|
|
double | avx, |
|
|
double | avy, |
|
|
double | avz, |
|
|
double | adelta_vx, |
|
|
double | adelta_vy, |
|
|
double | adelta_vz, |
|
|
const std::string & | randomVertexModel, |
|
|
const std::shared_ptr< GLogger > & | logger, |
|
|
int | generator_type = 1 ) |
All numeric parameters must already be in Geant4 internal units (MeV for momentum, radians for angles, mm for lengths) as returned by gutilities::getG4Number(). Callers — typically option parsers or file readers — are responsible for the conversion.
The particle PDG id is resolved at construction time by consulting the G4ParticleTable using the provided particle name.
- Parameters
-
| name | Particle name as understood by G4ParticleTable (e.g. "e-"). |
| multiplicity | Number of particles to shoot per event. |
| p | Nominal momentum magnitude in G4 internal units (MeV). |
| delta_p | Spread parameter for momentum randomization (same units as p). |
| randomMomentumModel | Random model name for momentum (e.g. "uniform", "gaussian"). |
| theta | Nominal polar angle in G4 internal units (radians). |
| delta_theta | Spread parameter for theta (same units as theta). |
| thetaModel | Random model name for theta (e.g. "uniform", "cosine", "gaussian"). |
| phi | Nominal azimuthal angle in G4 internal units (radians). |
| delta_phi | Spread parameter for phi (same units as phi). |
| avx | Nominal vertex x component in G4 internal units (mm). |
| avy | Nominal vertex y component in G4 internal units (mm). |
| avz | Nominal vertex z component in G4 internal units (mm). |
| adelta_vx | Spread parameter for vertex x (same units as avx). |
| adelta_vy | Spread parameter for vertex y (same units as avy). |
| adelta_vz | Spread parameter for vertex z (same units as avz). |
| randomVertexModel | Random model name for vertex (e.g. "uniform", "gaussian", "sphere"). |
| logger | Logger used for diagnostics and error reporting. |
| generator_type | Generator source type associated with this particle. Inline -gparticle definitions use the default value 1. File-backed particles preserve the source-file type field when the format provides one, such as the Lund type column. |
Definition at line 17 of file gparticle.cc.