109 const std::string& punit,
110 const std::string& randomMomentumModel,
113 const std::string& thetaModel,
116 const std::string& aunit,
123 const std::string& vunit,
124 const std::string& randomVertexModel,
125 const std::shared_ptr<GLogger>& logger);
162 void shootParticle(G4ParticleGun* particleGun, G4Event* anEvent);
177 return std::make_shared<Gparticle>(
240 G4ThreeVector delta_v;
246 std::shared_ptr<GLogger> log;
249 [[nodiscard]]
double get_mass()
const;
261 friend std::ostream&
operator<<(std::ostream& os,
const std::shared_ptr<Gparticle>& ptr) {
262 if (ptr)
return os << *ptr;
263 else return os <<
"<null Gparticle>";
274 [[nodiscard]]
double randomizeNumberFromSigmaWithModel(
double center,
279 double calculateMomentum();
286 double calculateKinEnergy(
double mass);
289 G4ThreeVector calculateBeamDirection();
292 G4ThreeVector calculateVertex();
Lightweight particle specification and primary vertex shooter.
void shootParticle(G4ParticleGun *particleGun, G4Event *anEvent)
Shoots this particle configuration into a Geant4 event.
friend std::ostream & operator<<(std::ostream &os, const Gparticle &gp)
Stream insertion operator used for pretty-printing configuration summaries.
Gparticle(const Gparticle &)=delete
Copying is disabled.
friend std::ostream & operator<<(std::ostream &os, const std::shared_ptr< Gparticle > &ptr)
Stream insertion operator overload for shared pointers.
static std::shared_ptr< Gparticle > create_default_gparticle(const std::shared_ptr< GLogger > &log)
Creates a minimal default particle configuration.
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)
Constructs a particle configuration from user-facing parameters.
~Gparticle()
Destructor emits a debug-level lifecycle message.
Gparticle & operator=(const Gparticle &)=delete
Copy assignment is disabled.
std::shared_ptr< Gparticle > GparticlePtr
Shared pointer type used for Gparticle instances.