File indexing completed on 2025-08-05 08:18:09
0001
0002
0003 #ifndef G4MAIN_PHG4IONGUN_H
0004 #define G4MAIN_PHG4IONGUN_H
0005
0006 #include "PHG4ParticleGeneratorBase.h"
0007
0008 #include <cmath>
0009 #include <string>
0010
0011 class PHG4Particle;
0012 class PHCompositeNode;
0013
0014 class PHG4IonGun : public PHG4ParticleGeneratorBase
0015 {
0016 public:
0017 PHG4IonGun(const std::string &name = "PHG4IONGUN");
0018 ~PHG4IonGun() override {}
0019 int process_event(PHCompositeNode *topNode) override;
0020 void SetA(const int a) { A = a; }
0021 void SetZ(const int z) { Z = z; }
0022 void SetCharge(const int c);
0023 void ExcitEnergy(const double e) { excitEnergy = e; }
0024 void SetMom(const double px, const double py, const double pz);
0025 void Print(const std::string &what = "ALL") const override;
0026
0027 private:
0028 void UpdateParticle();
0029 PHG4Particle *ion = nullptr;
0030 int A = 0;
0031 int Z = 0;
0032 double mom[3] = {NAN, NAN, NAN};
0033 int ioncharge = 0;
0034 double excitEnergy = 0.;
0035 };
0036
0037 #endif