Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
+40 -14
View File
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleGun.hh,v 1.1 1999/01/07 16:06:33 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4ParticleGun.hh,v 1.2.4.1 1999/12/07 20:47:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
#ifndef G4ParticleGun_h
@@ -23,13 +23,36 @@
class G4Event;
class G4ParticleGunMessenger;
// class description:
//
// This is a concrete class of G4VPrimaryGenerator. It shoots a particle of given type
// to a given direction with a given kinetic energy.
// The position and time of the primary particle must be set by the corresponding
// set methods of G4VPrimaryGenerator base class, otherwise zero will be set.
//
// The FAQ to this class is for randomizing position/direction/kinetic energy of primary
// particle. But, G4ParticleGun does NOT have any way of randomization. Instead, the user's
// concrete implementation of G4VUserPrimaryGeneratorAction which transmits G4Event object
// to this particle gun can randomize these quantities and set to this particle gun before
// invoking GeneratePrimaryVertex() method.
// Note that, even if the particle gun shoots more than one particles at one invokation of
// GeneratePrimaryVertex() method, all particles have the same physical quantities. If the
// user wants to shoot two particles with different momentum, position, etc., invoke
// GeneratePrimaryVertex() method twice and set quantities on demand to the particle gun.
//
class G4ParticleGun:public G4VPrimaryGenerator
{
public:
public: // with description
G4ParticleGun();
G4ParticleGun(G4int numberofparticles);
G4ParticleGun(G4ParticleDefinition * particleDef,
G4int numberofparticles = 1);
// costructors. "numberofparticles" is number of particles to be shoot at one invokation
// of GeneratePrimaryVertex() method. All paricles are shoot with the same physical
// quantities.
public:
virtual ~G4ParticleGun();
G4ParticleGun(const G4ParticleGun &right);
@@ -37,17 +60,18 @@ class G4ParticleGun:public G4VPrimaryGenerator
int operator==(const G4ParticleGun &right) const;
int operator!=(const G4ParticleGun &right) const;
public: // with description
virtual void GeneratePrimaryVertex(G4Event* evt);
// Set particle properties to be shoot out
// SetParticleDefinition should be called at first
// Creates a primary vertex at the given point and put primary particles to it.
// Followings are set methods for the particle properties.
// SetParticleDefinition should be called first.
// By using SetParticleMomentum(), both particle_momentum_direction and
// particle_energy(Kinetic Energy) are determined.
void SetParticleMomentum(G4ParticleMomentum aMomentum);
// particle_energy(Kinetic Energy) are set.
//
inline void SetParticleDefinition
(G4ParticleDefinition * aParticleDefinition)
{ particle_definition = aParticleDefinition; }
void SetParticleMomentum(G4ParticleMomentum aMomentum);
inline void SetParticleMomentumDirection
(G4ParticleMomentum aMomentumDirection)
{ particle_momentum_direction = aMomentumDirection.unit(); }
@@ -57,6 +81,12 @@ class G4ParticleGun:public G4VPrimaryGenerator
{ particle_position = aPosition; }
inline void SetParticleTime(G4double aTime)
{ particle_time = aTime; }
inline void SetParticlePolarization(G4ThreeVector aVal)
{ particle_polarization = aVal; }
inline void SetNumberOfParticles(G4int i)
{ NumberOfParticlesToBeGenerated = i; }
public:
inline G4ParticleDefinition* GetParticleDefinition()
{ return particle_definition; }
inline G4ParticleMomentum GetParticleMomentumDirection()
@@ -67,12 +97,8 @@ class G4ParticleGun:public G4VPrimaryGenerator
{ return particle_position; }
inline G4double GetParticleTime()
{ return particle_time; }
inline void SetParticlePolarization(G4ThreeVector aVal)
{ particle_polarization = aVal; }
inline G4ThreeVector GetParticlePolarization()
{ return particle_polarization; }
inline void SetNumberOfParticles(G4int i)
{ NumberOfParticlesToBeGenerated = i; }
inline G4int GetNumberOfParticles()
{ return NumberOfParticlesToBeGenerated; }