|
| | Gparticle (const std::string &name, int multiplicity, double p, double delta_p, const std::string &punit, const std::string &randomMomentumModel, double theta, double delta_theta, const std::string &thetaModel, double phi, double delta_phi, const std::string &aunit, double avx, double avy, double avz, double adelta_vx, double adelta_vy, double adelta_vz, const std::string &vunit, const std::string &randomVertexModel, const std::shared_ptr< GLogger > &logger, int generator_type=1) |
| | Constructs a particle configuration from user-facing parameters.
|
| |
| | 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.
|
| |
| int | getGeneratorType () const |
| | Returns the generator source type.
|
| |
| const std::vector< GparticleRuntimeRecord > & | getRuntimeRecords () const |
| | Returns the runtime records from the most recent shoot.
|
| |
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 & | punit, |
|
|
const std::string & | randomMomentumModel, |
|
|
double | theta, |
|
|
double | delta_theta, |
|
|
const std::string & | thetaModel, |
|
|
double | phi, |
|
|
double | delta_phi, |
|
|
const std::string & | aunit, |
|
|
double | avx, |
|
|
double | avy, |
|
|
double | avz, |
|
|
double | adelta_vx, |
|
|
double | adelta_vy, |
|
|
double | adelta_vz, |
|
|
const std::string & | vunit, |
|
|
const std::string & | randomVertexModel, |
|
|
const std::shared_ptr< GLogger > & | logger, |
|
|
int | generator_type = 1 ) |
This constructor converts user-facing numeric values paired with unit strings into internal numeric values (in the unit system returned by gutilities helpers), and converts randomization model strings into gutilities::randomModel values.
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 (interpreted together with punit). |
| delta_p | Spread parameter for momentum randomization (interpreted with punit). |
| punit | Unit string used to interpret p and delta_p (e.g. "MeV", "GeV"). |
| randomMomentumModel | Random model name for momentum (e.g. "uniform", "gaussian"). |
| theta | Nominal polar angle (interpreted together with aunit). |
| delta_theta | Spread parameter for theta (interpreted with aunit). |
| thetaModel | Random model name for theta (e.g. "uniform", "cosine", "gaussian"). |
| phi | Nominal azimuthal angle (interpreted together with aunit). |
| delta_phi | Spread parameter for phi (interpreted with aunit). |
| aunit | Unit string used to interpret angles (typically "deg" or "rad"). |
| avx | Nominal vertex x component (interpreted together with vunit). |
| avy | Nominal vertex y component (interpreted together with vunit). |
| avz | Nominal vertex z component (interpreted together with vunit). |
| adelta_vx | Spread parameter for vertex x (interpreted with vunit). |
| adelta_vy | Spread parameter for vertex y (interpreted with vunit). |
| adelta_vz | Spread parameter for vertex z (interpreted with vunit). |
| vunit | Unit string used to interpret vertex components (e.g. "cm", "mm"). |
| 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 22 of file gparticle.cc.