50G4SingleParticleSource::part_prop_t::part_prop_t()
62 NumberOfParticlesToBeGenerated = 1;
105 definition = aParticleDefinition;
111 if (definition ==
nullptr)
117 if (verbosityLevel > 1)
119 G4cout <<
" NumberOfParticlesToBeGenerated: "
120 << NumberOfParticlesToBeGenerated <<
G4endl;
123 part_prop_t& pp = ParticleProperties.
Get();
131 for (
G4int i=0; i<NumberOfParticlesToBeGenerated; ++i)
134 pp.momentum_direction = angGenerator->
GenerateOne();
139 if (verbosityLevel >= 2)
141 G4cout <<
"Creating primaries and assigning to vertex" <<
G4endl;
148 particle->SetKineticEnergy(pp.energy );
149 particle->SetMass( mass );
150 particle->SetMomentumDirection( pp.momentum_direction );
151 particle->SetCharge( charge );
152 particle->SetPolarization(polarization.
x(),
155 if (verbosityLevel > 1)
160 G4cout <<
" Direction: " << pp.momentum_direction <<
G4endl;
174 particle->SetWeight(weight);
175 vertex->SetPrimary(particle);
182 if (verbosityLevel > 1)
G4ThreeVector G4ParticleMomentum
#define G4MUTEXDESTROY(mutex)
#define G4MUTEXINIT(mutex)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
static G4Geantino * GeantinoDefinition()
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
void SetPosDistribution(G4SPSPosDistribution *a)
G4ParticleMomentum GenerateOne()
void SetBiasRndm(G4SPSRandomGenerator *a)
void SetVerbosity(G4int a)
G4double GetArbEneWeight(G4double)
G4double GenerateOne(G4ParticleDefinition *)
G4double GetWeight() const
void SetVerbosity(G4int a)
G4bool IfApplyEnergyWeight() const
void SetBiasRndm(G4SPSRandomGenerator *a)
void SetBiasRndm(G4SPSRandomGenerator *a)
void SetVerbosity(G4int a)
G4ThreeVector GenerateOne()
G4double GetBiasWeight() const
void GeneratePrimaryVertex(G4Event *evt) override
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
~G4SingleParticleSource() override