43 #include "PrimaryGeneratorAction.hh"
46 #include "CommandLineParser.hh"
60 using namespace G4DNAPARSER ;
111 G4Orb* mediumSphere = 0;
112 G4Box* boundingSlice = 0;
113 if ( mediumLV && boundingLV)
116 boundingSlice =
dynamic_cast< G4Box*
>(boundingLV->
GetSolid());
118 if ( mediumSphere && boundingSlice)
120 mediumRadius = mediumSphere->
GetRadius();
128 if ( CommandLineParser::GetParser()->GetCommandIfActive(
"-sXY"))
148 else if ( CommandLineParser::GetParser()->GetCommandIfActive(
"-dXY"))
157 while (! (std::sqrt(x0*x0+y0*y0)<= mediumRadius) )
177 G4double sinTheta = std::sqrt(1.-cosTheta*cosTheta);
179 G4ThreeVector positionStart(mediumRadius*sinTheta*std::cos(phi),
180 mediumRadius*sinTheta*std::sin(phi),
181 mediumRadius*cosTheta);
189 (positionDir-positionStart).unit());
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4double GetYHalfLength() const
CLHEP::Hep3Vector G4ThreeVector
static G4ParticleTable * GetParticleTable()
static constexpr double MeV
G4double GetRadius() const
static constexpr double mm
void SetParticlePosition(G4ThreeVector aPosition)
static constexpr double um
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
static constexpr double twopi
G4double GetXHalfLength() const
G4GLOB_DLL std::ostream G4cerr
virtual void GeneratePrimaryVertex(G4Event *evt)
G4VSolid * GetSolid() const
void SetParticleEnergy(G4double aKineticEnergy)
G4ParticleGun * fpParticleGun
void GeneratePrimaries(G4Event *)
static constexpr double pi
G4double GetZHalfLength() const
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
~PrimaryGeneratorAction()
static G4LogicalVolumeStore * GetInstance()
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const