Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -23,31 +23,24 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4DynamicParticle
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ---------------- G4DynamicParticle ----------------
|
||||
// first implementation by Makoto Asai, 29 January 1996
|
||||
// revised by G.Cosmo, 29 February 1996
|
||||
// revised by Hisaya Kurashige, 24 July 1996
|
||||
// revised by Hisaya Kurashige, 19 Oct 1996
|
||||
// revised by Hisaya Kurashige, 19 Feb 1997
|
||||
// ------------------------
|
||||
// Add theDynamicCharge and theElectronOccupancy
|
||||
// 17 AUg. 1999 H.Kurashige
|
||||
// Add thePreAssignedDecayTime 18 Jan. 2001 H.Kurashige
|
||||
// Added MagneticMoment Mar. 2007
|
||||
// Added GetLogKineticEnergy: the log-kinetic energy value is computed only
|
||||
// on demand if its stored value is not up-to-date. 15 March 2019 M. Novak
|
||||
// ------------------------------------------------------------
|
||||
// A G4DynamicParticle aggregates the information to describe the dynamics
|
||||
// of a G4Particle, such as energy, momentum, polarization and proper time,
|
||||
// as well as the "particle definition", holding all the static information.
|
||||
// It contains the purely dynamic aspects of a moving particle.
|
||||
|
||||
#ifndef G4DynamicParticle_h
|
||||
#define G4DynamicParticle_h 1
|
||||
// History:
|
||||
// - 2 December 1995, G.Cosmo - first design, based on object model.
|
||||
// - 29 January 1996, M.Asai - first implementation.
|
||||
// - 1996 - 2007, H.Kurashige - revisions.
|
||||
// - 15 March 2019, M.Novak - log-kinetic energy value is computed only
|
||||
// on demand if its stored value is not up-to-date.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4DynamicParticle_hh
|
||||
#define G4DynamicParticle_hh 1
|
||||
|
||||
#include <cmath>
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
@@ -61,11 +54,8 @@
|
||||
#include "G4LorentzVector.hh"
|
||||
#include "G4Log.hh"
|
||||
|
||||
#include "G4ParticleMomentum.hh"
|
||||
// G4ParticleMomentum is "momentum direction" not "momentum vector"
|
||||
// The name is miss-leading so you should not use G4ParticleMomentum
|
||||
// and you are recommended to use G4ThreeVector instead
|
||||
|
||||
#include "G4ParticleMomentum.hh" // NOTE: means "momentum direction" not
|
||||
// "momentum vector". It is a G4ThreeVector
|
||||
#include "G4ElectronOccupancy.hh"
|
||||
|
||||
class G4PrimaryParticle;
|
||||
@@ -73,205 +63,209 @@ class G4DecayProducts;
|
||||
|
||||
class G4DynamicParticle
|
||||
{
|
||||
// Class Description
|
||||
// The dynamic particle is a class which contains the purely
|
||||
// dynamic aspects of a moving particle. It also has a
|
||||
// pointer to a G4ParticleDefinition object, which holds
|
||||
// all the static information.
|
||||
//
|
||||
public:
|
||||
|
||||
public: // With Description
|
||||
//- constructors
|
||||
G4DynamicParticle();
|
||||
|
||||
G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
const G4ThreeVector& aMomentumDirection,
|
||||
G4double aKineticEnergy);
|
||||
G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
const G4ThreeVector& aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
const G4LorentzVector &aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
G4double aTotalEnergy,
|
||||
const G4ThreeVector &aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
const G4ThreeVector& aMomentumDirection,
|
||||
G4double aKineticEnergy,
|
||||
const G4double dynamicalMass);
|
||||
G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
|
||||
const G4ThreeVector& aMomentumDirection,
|
||||
G4double aKineticEnergy);
|
||||
G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
|
||||
const G4ThreeVector& aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
|
||||
const G4LorentzVector& aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
|
||||
G4double aTotalEnergy,
|
||||
const G4ThreeVector& aParticleMomentum);
|
||||
G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
|
||||
const G4ThreeVector& aMomentumDirection,
|
||||
G4double aKineticEnergy,
|
||||
const G4double dynamicalMass);
|
||||
|
||||
G4DynamicParticle(const G4DynamicParticle &right);
|
||||
G4DynamicParticle(const G4DynamicParticle& right);
|
||||
|
||||
//- destructor
|
||||
~G4DynamicParticle();
|
||||
|
||||
//- operators
|
||||
G4DynamicParticle & operator=(const G4DynamicParticle &right);
|
||||
G4bool operator==(const G4DynamicParticle &right) const;
|
||||
G4bool operator!=(const G4DynamicParticle &right) const;
|
||||
G4DynamicParticle& operator=(const G4DynamicParticle &right);
|
||||
G4bool operator==(const G4DynamicParticle& right) const;
|
||||
G4bool operator!=(const G4DynamicParticle& right) const;
|
||||
|
||||
// new/delete operators are oberloded to use G4Allocator
|
||||
inline void *operator new(size_t);
|
||||
inline void operator delete(void *aDynamicParticle);
|
||||
//- Move constructor & operator
|
||||
G4DynamicParticle(G4DynamicParticle&& from);
|
||||
G4DynamicParticle& operator=(G4DynamicParticle&& from);
|
||||
|
||||
//- new/delete operators are oberloded to use G4Allocator
|
||||
inline void* operator new(size_t);
|
||||
inline void operator delete(void* aDynamicParticle);
|
||||
|
||||
//- Set/Get methods
|
||||
|
||||
inline const G4ThreeVector& GetMomentumDirection() const;
|
||||
// Returns the normalized direction of the momentum
|
||||
inline void SetMomentumDirection(const G4ThreeVector &aDirection);
|
||||
// Sets the normalized direction of the momentum
|
||||
// Returns the normalized direction of the momentum
|
||||
inline void SetMomentumDirection(const G4ThreeVector& aDirection);
|
||||
// Sets the normalized direction of the momentum
|
||||
inline void SetMomentumDirection(G4double px, G4double py, G4double pz);
|
||||
// Sets the normalized direction of the momentum by coordinates
|
||||
// Sets the normalized direction of the momentum by coordinates
|
||||
|
||||
inline G4ThreeVector GetMomentum() const;
|
||||
// Returns the current particle momentum vector
|
||||
void SetMomentum( const G4ThreeVector &momentum);
|
||||
// set the current particle momentum vector
|
||||
// Returns the current particle momentum vector
|
||||
void SetMomentum( const G4ThreeVector& momentum);
|
||||
// set the current particle momentum vector
|
||||
|
||||
inline G4LorentzVector Get4Momentum() const;
|
||||
// Returns the current particle energy-momentum 4vector
|
||||
void Set4Momentum( const G4LorentzVector &momentum);
|
||||
// Set the current particle energy-momentum 4vector
|
||||
// Returns the current particle energy-momentum 4vector
|
||||
void Set4Momentum( const G4LorentzVector& momentum);
|
||||
// Set the current particle energy-momentum 4vector
|
||||
|
||||
inline G4double GetTotalMomentum() const;
|
||||
// Returns the module of the momentum vector
|
||||
// Returns the module of the momentum vector
|
||||
inline G4double GetTotalEnergy() const;
|
||||
// Returns the total energy of the particle
|
||||
// Returns the total energy of the particle
|
||||
|
||||
inline G4double GetKineticEnergy() const;
|
||||
// Returns the kinetic energy of a particle
|
||||
// Returns the kinetic energy of a particle
|
||||
inline G4double GetLogKineticEnergy() const;
|
||||
// Returns:
|
||||
// - natural logarithm of the particle kinetic energy (E_k) if E_k > 0
|
||||
// - LOG_EKIN_MIN otherwise
|
||||
// Returns:
|
||||
// - natural logarithm of the particle kinetic energy (E_k) if E_k > 0
|
||||
// - LOG_EKIN_MIN otherwise
|
||||
inline void SetKineticEnergy(G4double aEnergy);
|
||||
// Sets the kinetic energy of a particle
|
||||
// Sets the kinetic energy of a particle
|
||||
inline G4double GetBeta() const;
|
||||
// Access Lorentz beta
|
||||
|
||||
inline G4double GetProperTime() const;
|
||||
// Returns the current particle proper time
|
||||
// Returns the current particle proper time
|
||||
inline void SetProperTime( G4double );
|
||||
// Set the current particle Proper Time
|
||||
// Set the current particle Proper Time
|
||||
|
||||
inline const G4ThreeVector& GetPolarization() const;
|
||||
inline void SetPolarization(const G4ThreeVector&);
|
||||
inline void SetPolarization(G4double polX, G4double polY, G4double polZ);
|
||||
// Set/Get polarization vector
|
||||
// Set/Get polarization vector
|
||||
|
||||
inline G4double GetMass() const;
|
||||
inline void SetMass(G4double mass);
|
||||
// set/get dynamical mass
|
||||
// the dynamical mass is set to PDG mass in default
|
||||
// Set/Get dynamical mass
|
||||
// The dynamical mass is set to PDG mass in default
|
||||
|
||||
inline G4double GetCharge() const;
|
||||
inline void SetCharge(G4double charge);
|
||||
inline void SetCharge(G4int chargeInUnitOfEplus);
|
||||
// set/get dynamical charge
|
||||
// the dynamical mass is set to PDG charge in default
|
||||
// Set/Get dynamical charge
|
||||
// The dynamical mass is set to PDG charge in default
|
||||
|
||||
inline G4double GetSpin() const;
|
||||
inline void SetSpin(G4double spin);
|
||||
inline void SetSpin(G4int spinInUnitOfHalfInteger);
|
||||
// set/get dynamical spin
|
||||
// the dynamical spin is set to PDG spin in default
|
||||
// Set/Get dynamical spin
|
||||
// The dynamical spin is set to PDG spin in default
|
||||
|
||||
inline G4double GetMagneticMoment() const;
|
||||
inline void SetMagneticMoment(G4double magneticMoment);
|
||||
// set/get dynamical MagneticMoment
|
||||
// the dynamical mass is set to PDG MagneticMoment in default
|
||||
// Set/Get dynamical MagneticMoment
|
||||
// The dynamical mass is set to PDG MagneticMoment in default
|
||||
|
||||
inline const G4ElectronOccupancy* GetElectronOccupancy() const;
|
||||
// Get electron occupancy
|
||||
// ElectronOccupancy is valid only if the particle is ion
|
||||
// Get electron occupancy
|
||||
// ElectronOccupancy is valid only if the particle is ion
|
||||
inline G4int GetTotalOccupancy() const;
|
||||
inline G4int GetOccupancy(G4int orbit) const;
|
||||
inline void AddElectron(G4int orbit, G4int number = 1);
|
||||
inline void RemoveElectron(G4int orbit, G4int number = 1);
|
||||
|
||||
inline const G4ParticleDefinition* GetParticleDefinition() const;
|
||||
void SetDefinition(const G4ParticleDefinition * aParticleDefinition);
|
||||
// Set/Get particle definition
|
||||
// following method of GetDefinition remains
|
||||
// because of backward compatiblity. It will be removed in future
|
||||
void SetDefinition(const G4ParticleDefinition* aParticleDefinition);
|
||||
// Set/Get particle definition
|
||||
// Following method of GetDefinition() remains
|
||||
// because of backward compatiblity. May be removed in future
|
||||
inline G4ParticleDefinition* GetDefinition() const;
|
||||
|
||||
inline const G4DecayProducts *GetPreAssignedDecayProducts() const;
|
||||
inline void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts);
|
||||
// Set/Get pre-assigned decay channel
|
||||
inline const G4DecayProducts* GetPreAssignedDecayProducts() const;
|
||||
inline void SetPreAssignedDecayProducts(G4DecayProducts* aDecayProducts);
|
||||
// Set/Get pre-assigned decay channel
|
||||
|
||||
inline G4double GetPreAssignedDecayProperTime() const;
|
||||
inline void SetPreAssignedDecayProperTime(G4double);
|
||||
// Set/Get pre-assigned proper time when the particle will decay
|
||||
// Set/Get pre-assigned proper time when the particle will decay
|
||||
|
||||
//- print out information
|
||||
void DumpInfo(G4int mode= 0) const;
|
||||
// mode 0 : default )(minimum)
|
||||
// mode 1 : 0 + electron occupancy
|
||||
void DumpInfo(G4int mode = 0) const;
|
||||
// Print out information
|
||||
// - mode 0 : default )(minimum)
|
||||
// - mode 1 : 0 + electron occupancy
|
||||
|
||||
inline void SetVerboseLevel(G4int value);
|
||||
inline G4int GetVerboseLevel() const;
|
||||
// Set/Get controle flag for output message
|
||||
// - 0: Silent
|
||||
// - 1: Warning message
|
||||
// - 2: More
|
||||
|
||||
inline void SetPrimaryParticle(G4PrimaryParticle* p);
|
||||
inline void SetPDGcode(G4int c);
|
||||
|
||||
inline G4PrimaryParticle* GetPrimaryParticle() const;
|
||||
// Return the pointer to the corresponding G4PrimaryParticle object
|
||||
// if this particle is a primary particle OR is defined as a
|
||||
// pre-assigned decay product. Otherwise return nullptr.
|
||||
|
||||
inline G4int GetPDGcode() const;
|
||||
// Return the PDG code of this particle. If the particle is known to
|
||||
// Geant4, its PDG code defined in G4ParticleDefinition is returned.
|
||||
// If it is unknown (i.e. PDG code in G4ParticleDefinition is 0), the
|
||||
// PDG code defined in the corresponding primary particle or
|
||||
// pre-assigned decay product will be returned if available.
|
||||
// Otherwise (e.g. for geantino) returns 0.
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
void AllocateElectronOccupancy();
|
||||
G4double GetElectronMass() const;
|
||||
|
||||
public: // With Description
|
||||
inline void SetVerboseLevel(G4int value);
|
||||
inline G4int GetVerboseLevel() const;
|
||||
// Set/Get controle flag for output message
|
||||
// 0: Silent
|
||||
// 1: Warning message
|
||||
// 2: More
|
||||
private:
|
||||
|
||||
inline void SetPrimaryParticle(G4PrimaryParticle* p);
|
||||
inline void SetPDGcode(G4int c);
|
||||
inline void ComputeBeta() const;
|
||||
|
||||
public: // With Description
|
||||
inline G4PrimaryParticle* GetPrimaryParticle() const;
|
||||
// Return the pointer to the corresponding G4PrimaryParticle object
|
||||
// if this particle is a primary particle OR is defined as a pre-assigned
|
||||
// decay product. Otherwise return null.
|
||||
G4ThreeVector theMomentumDirection;
|
||||
// The normalized momentum vector
|
||||
|
||||
inline G4int GetPDGcode() const;
|
||||
// Return the PDG code of this particle. If the particle is known to Geant4
|
||||
// its PDG code defined in G4ParticleDefinition is returned. If it is unknown
|
||||
// (i.e. PDG code in G4ParticleDefinition is 0), PDG code defined in the
|
||||
// corresponding primary particle or pre-assigned decay product will be
|
||||
// returned if available. Otherwise (e.g. for geantino) returns 0.
|
||||
G4ThreeVector thePolarization;
|
||||
|
||||
private:
|
||||
const G4ParticleDefinition* theParticleDefinition = nullptr;
|
||||
// Contains the static information of this particle
|
||||
|
||||
G4ThreeVector theMomentumDirection;
|
||||
// The normalized momentum vector
|
||||
|
||||
G4ThreeVector thePolarization;
|
||||
|
||||
const G4ParticleDefinition *theParticleDefinition;
|
||||
// Contains the static information of this particle.
|
||||
|
||||
G4ElectronOccupancy* theElectronOccupancy;
|
||||
G4ElectronOccupancy* theElectronOccupancy = nullptr;
|
||||
|
||||
G4DecayProducts *thePreAssignedDecayProducts;
|
||||
G4DecayProducts* thePreAssignedDecayProducts = nullptr;
|
||||
|
||||
G4PrimaryParticle* primaryParticle;
|
||||
// This void pointer is used by G4EventManager to maintain the
|
||||
// link between pre-assigned decay products and corresponding
|
||||
// primary particle.
|
||||
G4PrimaryParticle* primaryParticle = nullptr;
|
||||
// This void pointer is used by G4EventManager to maintain the
|
||||
// link between pre-assigned decay products and corresponding
|
||||
// primary particle
|
||||
|
||||
G4double theKineticEnergy;
|
||||
G4double theKineticEnergy = 0.0;
|
||||
|
||||
mutable G4double theLogKineticEnergy;
|
||||
mutable G4double theLogKineticEnergy = DBL_MAX;
|
||||
|
||||
G4double theProperTime;
|
||||
mutable G4double theBeta = -1.0;
|
||||
|
||||
G4double theDynamicalMass;
|
||||
G4double theProperTime = 0.0;
|
||||
|
||||
G4double theDynamicalCharge;
|
||||
G4double theDynamicalMass = 0.0;
|
||||
|
||||
G4double theDynamicalSpin;
|
||||
G4double theDynamicalCharge = 0.0;
|
||||
|
||||
G4double theDynamicalMagneticMoment;
|
||||
G4double theDynamicalSpin = 0.0;
|
||||
|
||||
G4double thePreAssignedDecayTime;
|
||||
G4double theDynamicalMagneticMoment = 0.0;
|
||||
|
||||
G4int verboseLevel;
|
||||
G4double thePreAssignedDecayTime = -1.0;
|
||||
|
||||
G4int thePDGcode;
|
||||
G4int verboseLevel = 1;
|
||||
|
||||
G4int thePDGcode = 0;
|
||||
};
|
||||
|
||||
#include "G4DynamicParticle.icc"
|
||||
|
||||
Reference in New Issue
Block a user