36 #include "MedicalBeam.hh"
38 using namespace CLHEP;
46 fparticle = particleTable-> FindParticle(
"proton");
87 while(! (std::abs(x) < xmax && std::abs(y) < ymax) ) {
89 dsin = std::sqrt(1.-
sqr(dcos));
92 x = std::cos(dphi)*dsin*dcos;
93 y = std::sin(dphi)*dsin*dcos;
116 vertex-> SetPrimary(primary);
119 anEvent-> AddPrimaryVertex(vertex);
ThreeVector shoot(const G4int Ap, const G4int Af)
CLHEP::Hep3Vector G4ThreeVector
G4ThreeVector GenerateBeamDirection() const
static constexpr double twopi
static constexpr double m
static constexpr double cm
static G4ParticleTable * GetParticleTable()
G4ThreeVector fsourcePosition
G4ParticleDefinition * fparticle
static constexpr double MeV
virtual void GeneratePrimaries(G4Event *anEvent)