149 while (!found && i<(
G4int)PVStore->size())
151 tempPV = (*PVStore)[i];
152 found = tempPV->
GetName() == theRequiredVolumeName;
155 <<
" " << theRequiredVolumeName <<
" " << found <<
G4endl;
169 G4cout <<
" **** Error: Volume does not exist **** " <<
G4endl;
191 G4cout <<
"Error SourcePosType is not set to Point" <<
G4endl;
203 if(
Shape ==
"Sphere") {
212 x = (x*2.*
Radius) - Radius;
213 y = (y*2.*
Radius) - Radius;
214 z = (z*2.*
Radius) - Radius;
218 else if(
Shape ==
"Cylinder") {
232 G4cout <<
"Error: Volume Shape Does Not Exist" <<
G4endl;
269 particle_momentum_direction = aDirection.
unit();
279 G4double sintheta, sinphi, costheta, cosphi;
282 sintheta = std::sqrt(1. - costheta*costheta);
286 sinphi = std::sin(
Phi);
287 cosphi = std::cos(
Phi);
289 px = -sintheta * cosphi;
290 py = -sintheta * sinphi;
293 G4double ResMag = std::sqrt((px*px) + (py*py) + (pz*pz));
333 particle_definition = aParticleDefinition;
350 while(srcconf ==
false) {
369 if(LoopCount == 100000) {
370 G4cout <<
"*************************************" <<
G4endl;
372 G4cout <<
"Either the source distribution >> confinement" <<
G4endl;
373 G4cout <<
"or any confining volume may not overlap with" <<
G4endl;
374 G4cout <<
"the source distribution or any confining volumes" <<
G4endl;
376 G4cout <<
"If you have set confine then this will be ignored" <<
G4endl;
378 G4cout <<
"*************************************" <<
G4endl;
389 G4cout <<
"Error: AngDistType has unusual value" <<
G4endl;
394 G4cout <<
"Error: EnergyDisType has unusual value" <<
G4endl;
401 G4cout <<
"Creating primaries and assigning to vertex" <<
G4endl;
405 G4double pmom = std::sqrt(energy*energy-mass*mass);
411 G4cout <<
"Particle name: "
416 G4cout <<
" NumberOfParticlesToBeGenerated: "
void SetEnergyDisType(G4String)
G4ThreeVector CentreCoords
G4bool IsSourceConfined()
G4ThreeVector G4ParticleMomentum
static constexpr double MeV
void SetParticleMomentumDirection(G4ParticleMomentum)
G4ParticleMomentum particle_momentum_direction
void GenerateMonoEnergetic()
const G4String & GetParticleName() const
G4double GetPDGCharge() const
G4Navigator * GetNavigatorForTracking() const
G4double GetPDGMass() const
void SetCentreCoords(G4ThreeVector)
DMXParticleSourceMessenger * theMessenger
G4ParticleDefinition * particle_definition
G4int NumberOfParticlesToBeGenerated
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
void SetPolarization(const G4ThreeVector &pol)
void SetPrimary(G4PrimaryParticle *pp)
static constexpr double twopi
void SetCharge(G4double chg)
void GeneratePointSource()
void GeneratePrimaryVertex(G4Event *evt)
void GenerateIsotropicFlux()
static G4TransportationManager * GetTransportationManager()
static G4PhysicalVolumeStore * GetInstance()
void SetAngDistType(G4String)
void GeneratePointsInVolume()
void ConfineSourceToVolume(G4String)
G4GLOB_DLL std::ostream G4cout
G4ThreeVector particle_polarization
void SetMonoEnergy(G4double)
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
static constexpr double pi
G4ThreeVector particle_position
void SetPosDisShape(G4String)
void SetPosDisType(G4String)
void SetMass(G4double mas)
const G4String & GetName() const