53 NumberOfParticlesToBeGenerated = numberofparticles;
54 SetParticleDefinition( particleDef );
81 "G4ParticleGun : Copy constructor should not be used."); }
86 "G4ParticleGun : Equal operator should not be used.");
92 "G4ParticleGun : == operator should not be used.");
98 "G4ParticleGun : != operator should not be used.");
104 if(!aParticleDefinition)
106 G4Exception(
"G4ParticleGun::SetParticleDefinition()",
"Event0101",
114 ED <<
"G4ParticleGun does not support shooting a short-lived particle without a valid decay table." <<
G4endl;
115 ED <<
"G4ParticleGun::SetParticleDefinition for "
117 G4Exception(
"G4ParticleGun::SetParticleDefinition()",
"Event0102",
122 particle_definition = aParticleDefinition;
124 if(particle_momentum>0.0)
126 G4double mass = particle_definition->GetPDGMass();
128 std::sqrt(particle_momentum*particle_momentum+mass*mass)-mass;
142 G4cout <<
" was defined in terms of Momentum: "
144 G4cout <<
" is now defined in terms of KineticEnergy: "
159 G4cout <<
" was defined in terms of KineticEnergy: "
161 G4cout <<
" is now defined in terms Momentum: "
166 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"<<
G4endl;
189 G4cout <<
" was defined in terms of KineticEnergy: "
191 G4cout <<
" is now defined in terms Momentum: "
196 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"<<
G4endl;