Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -98,7 +98,7 @@ class G4DecayTable
|
||||
inline
|
||||
G4int G4DecayTable::entries() const
|
||||
{
|
||||
return channels->size();
|
||||
return G4int(channels->size());
|
||||
}
|
||||
|
||||
inline
|
||||
|
||||
@@ -115,92 +115,91 @@ class G4DynamicParticle
|
||||
|
||||
//- Set/Get methods
|
||||
|
||||
const G4ThreeVector& GetMomentumDirection() const;
|
||||
inline const G4ThreeVector& GetMomentumDirection() const;
|
||||
// Returns the normalized direction of the momentum
|
||||
void SetMomentumDirection(const G4ThreeVector &aDirection);
|
||||
inline void SetMomentumDirection(const G4ThreeVector &aDirection);
|
||||
// Sets the normalized direction of the momentum
|
||||
void SetMomentumDirection(G4double px, G4double py, G4double pz);
|
||||
inline void SetMomentumDirection(G4double px, G4double py, G4double pz);
|
||||
// Sets the normalized direction of the momentum by coordinates
|
||||
|
||||
G4ThreeVector GetMomentum() const;
|
||||
inline G4ThreeVector GetMomentum() const;
|
||||
// Returns the current particle momentum vector
|
||||
void SetMomentum( const G4ThreeVector &momentum);
|
||||
// set the current particle momentum vector
|
||||
|
||||
G4LorentzVector Get4Momentum() const;
|
||||
inline G4LorentzVector Get4Momentum() const;
|
||||
// Returns the current particle energy-momentum 4vector
|
||||
void Set4Momentum( const G4LorentzVector &momentum);
|
||||
// Set the current particle energy-momentum 4vector
|
||||
|
||||
G4double GetTotalMomentum() const;
|
||||
inline G4double GetTotalMomentum() const;
|
||||
// Returns the module of the momentum vector
|
||||
G4double GetTotalEnergy() const;
|
||||
inline G4double GetTotalEnergy() const;
|
||||
// Returns the total energy of the particle
|
||||
|
||||
G4double GetKineticEnergy() const;
|
||||
inline G4double GetKineticEnergy() const;
|
||||
// Returns the kinetic energy of a particle
|
||||
G4double GetLogKineticEnergy() const;
|
||||
inline G4double GetLogKineticEnergy() const;
|
||||
// Returns:
|
||||
// - natural logarithm of the particle kinetic energy (E_k) if E_k > 0
|
||||
// - LOG_EKIN_MIN otherwise
|
||||
void SetKineticEnergy(G4double aEnergy);
|
||||
inline void SetKineticEnergy(G4double aEnergy);
|
||||
// Sets the kinetic energy of a particle
|
||||
|
||||
G4double GetProperTime() const;
|
||||
inline G4double GetProperTime() const;
|
||||
// Returns the current particle proper time
|
||||
void SetProperTime( G4double );
|
||||
inline void SetProperTime( G4double );
|
||||
// Set the current particle Proper Time
|
||||
|
||||
const G4ThreeVector& GetPolarization() const;
|
||||
void SetPolarization(const G4ThreeVector&);
|
||||
void SetPolarization(G4double polX, G4double polY, G4double polZ);
|
||||
inline const G4ThreeVector& GetPolarization() const;
|
||||
inline void SetPolarization(const G4ThreeVector&);
|
||||
inline void SetPolarization(G4double polX, G4double polY, G4double polZ);
|
||||
// Set/Get polarization vector
|
||||
|
||||
G4double GetMass() const;
|
||||
void SetMass(G4double mass);
|
||||
inline G4double GetMass() const;
|
||||
inline void SetMass(G4double mass);
|
||||
// set/get dynamical mass
|
||||
// the dynamical mass is set to PDG mass in default
|
||||
|
||||
G4double GetCharge() const;
|
||||
void SetCharge(G4double charge);
|
||||
void SetCharge(G4int chargeInUnitOfEplus);
|
||||
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
|
||||
|
||||
G4double GetSpin() const;
|
||||
void SetSpin(G4double spin);
|
||||
void SetSpin(G4int spinInUnitOfHalfInteger);
|
||||
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
|
||||
|
||||
G4double GetMagneticMoment() const;
|
||||
void SetMagneticMoment(G4double magneticMoment);
|
||||
inline G4double GetMagneticMoment() const;
|
||||
inline void SetMagneticMoment(G4double magneticMoment);
|
||||
// set/get dynamical MagneticMoment
|
||||
// the dynamical mass is set to PDG MagneticMoment in default
|
||||
|
||||
const G4ElectronOccupancy* GetElectronOccupancy() const;
|
||||
inline const G4ElectronOccupancy* GetElectronOccupancy() const;
|
||||
// Get electron occupancy
|
||||
// ElectronOccupancy is valid only if the particle is ion
|
||||
G4int GetTotalOccupancy() const;
|
||||
G4int GetOccupancy(G4int orbit) const;
|
||||
void AddElectron(G4int orbit, G4int number = 1);
|
||||
void RemoveElectron(G4int orbit, G4int number = 1);
|
||||
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);
|
||||
|
||||
const G4ParticleDefinition* GetParticleDefinition() const;
|
||||
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
|
||||
G4ParticleDefinition* GetDefinition() const;
|
||||
inline G4ParticleDefinition* GetDefinition() const;
|
||||
|
||||
const G4DecayProducts *GetPreAssignedDecayProducts() const;
|
||||
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts);
|
||||
inline const G4DecayProducts *GetPreAssignedDecayProducts() const;
|
||||
inline void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts);
|
||||
// Set/Get pre-assigned decay channel
|
||||
|
||||
G4double GetPreAssignedDecayProperTime() const;
|
||||
void SetPreAssignedDecayProperTime(G4double);
|
||||
inline G4double GetPreAssignedDecayProperTime() const;
|
||||
inline void SetPreAssignedDecayProperTime(G4double);
|
||||
// Set/Get pre-assigned proper time when the particle will decay
|
||||
|
||||
|
||||
//- print out information
|
||||
void DumpInfo(G4int mode= 0) const;
|
||||
@@ -212,23 +211,23 @@ class G4DynamicParticle
|
||||
G4double GetElectronMass() const;
|
||||
|
||||
public: // With Description
|
||||
void SetVerboseLevel(G4int value);
|
||||
G4int GetVerboseLevel() const;
|
||||
inline void SetVerboseLevel(G4int value);
|
||||
inline G4int GetVerboseLevel() const;
|
||||
// Set/Get controle flag for output message
|
||||
// 0: Silent
|
||||
// 1: Warning message
|
||||
// 2: More
|
||||
|
||||
void SetPrimaryParticle(G4PrimaryParticle* p);
|
||||
void SetPDGcode(G4int c);
|
||||
inline void SetPrimaryParticle(G4PrimaryParticle* p);
|
||||
inline void SetPDGcode(G4int c);
|
||||
|
||||
public: // With Description
|
||||
G4PrimaryParticle* GetPrimaryParticle() const;
|
||||
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.
|
||||
|
||||
G4int GetPDGcode() const;
|
||||
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
|
||||
|
||||
@@ -109,6 +109,10 @@ inline G4double G4DynamicParticle::GetMass() const
|
||||
return theDynamicalMass;
|
||||
}
|
||||
|
||||
inline void G4DynamicParticle::SetMass(G4double newMass)
|
||||
{
|
||||
theDynamicalMass = std::max(newMass, 0.0);
|
||||
}
|
||||
|
||||
inline G4double G4DynamicParticle::GetSpin() const
|
||||
{
|
||||
@@ -201,8 +205,7 @@ inline G4double G4DynamicParticle::GetKineticEnergy() const
|
||||
inline G4double G4DynamicParticle::GetLogKineticEnergy() const
|
||||
{
|
||||
if (theLogKineticEnergy == DBL_MAX) {
|
||||
theLogKineticEnergy = (theKineticEnergy > 0.) ?
|
||||
G4Log(theKineticEnergy) : LOG_EKIN_MIN;
|
||||
theLogKineticEnergy = (theKineticEnergy > 0.) ? G4Log(theKineticEnergy) : LOG_EKIN_MIN;
|
||||
}
|
||||
return theLogKineticEnergy;
|
||||
}
|
||||
@@ -249,7 +252,7 @@ inline const G4DecayProducts* G4DynamicParticle::GetPreAssignedDecayProducts() c
|
||||
|
||||
inline void G4DynamicParticle::SetPreAssignedDecayProducts(G4DecayProducts* aDecayProducts)
|
||||
{
|
||||
thePreAssignedDecayProducts = aDecayProducts;
|
||||
thePreAssignedDecayProducts = aDecayProducts;
|
||||
}
|
||||
|
||||
inline G4double G4DynamicParticle::GetPreAssignedDecayProperTime() const
|
||||
@@ -277,7 +280,7 @@ G4int G4DynamicParticle::GetVerboseLevel() const
|
||||
inline
|
||||
void G4DynamicParticle::SetPrimaryParticle(G4PrimaryParticle* p)
|
||||
{
|
||||
primaryParticle=p;
|
||||
primaryParticle = p;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -289,11 +292,11 @@ G4PrimaryParticle* G4DynamicParticle::GetPrimaryParticle() const
|
||||
inline
|
||||
G4int G4DynamicParticle::GetPDGcode() const
|
||||
{
|
||||
return thePDGcode;
|
||||
G4int code = theParticleDefinition->GetPDGEncoding();
|
||||
return (code == 0) ? thePDGcode : code;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4DynamicParticle::SetPDGcode(G4int c)
|
||||
inline void G4DynamicParticle::SetPDGcode(G4int c)
|
||||
{
|
||||
thePDGcode = c;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefin
|
||||
theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment()),
|
||||
thePreAssignedDecayTime(-1.0),
|
||||
verboseLevel(1),
|
||||
thePDGcode(aParticleDefinition->GetPDGEncoding())
|
||||
thePDGcode(0)
|
||||
{
|
||||
if (std::abs(theDynamicalMass-dynamicalMass)> EnergyMomentumRelationAllowance) {
|
||||
if (dynamicalMass>EnergyMomentumRelationAllowance) theDynamicalMass= dynamicalMass;
|
||||
@@ -168,12 +168,11 @@ G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefin
|
||||
theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment()),
|
||||
thePreAssignedDecayTime(-1.0),
|
||||
verboseLevel(1),
|
||||
thePDGcode(aParticleDefinition->GetPDGEncoding())
|
||||
thePDGcode(0)
|
||||
{
|
||||
SetMomentum(aParticleMomentum); // 3-dim momentum is given
|
||||
}
|
||||
|
||||
|
||||
////////////////////
|
||||
G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
const G4LorentzVector &aParticleMomentum):
|
||||
@@ -191,11 +190,12 @@ G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefin
|
||||
theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment()),
|
||||
thePreAssignedDecayTime(-1.0),
|
||||
verboseLevel(1),
|
||||
thePDGcode(aParticleDefinition->GetPDGEncoding())
|
||||
thePDGcode(0)
|
||||
{
|
||||
Set4Momentum(aParticleMomentum); // 4-momentum vector (Lorentz vector) is given
|
||||
}
|
||||
|
||||
////////////////////
|
||||
G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefinition,
|
||||
G4double totalEnergy,
|
||||
const G4ThreeVector &aParticleMomentum):
|
||||
@@ -213,11 +213,11 @@ G4DynamicParticle::G4DynamicParticle(const G4ParticleDefinition * aParticleDefin
|
||||
theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment()),
|
||||
thePreAssignedDecayTime(-1.0),
|
||||
verboseLevel(1),
|
||||
thePDGcode(aParticleDefinition->GetPDGEncoding())
|
||||
thePDGcode(0)
|
||||
{
|
||||
// total energy and 3-dim momentum are given
|
||||
G4double pModule2 = aParticleMomentum.mag2();
|
||||
if (pModule2>0.0) {
|
||||
if (pModule2 > 0.0) {
|
||||
G4double mass2 = totalEnergy*totalEnergy - pModule2;
|
||||
G4double PDGmass2 = (aParticleDefinition->GetPDGMass())*(aParticleDefinition->GetPDGMass());
|
||||
SetMomentumDirection(aParticleMomentum.unit());
|
||||
@@ -276,7 +276,6 @@ G4DynamicParticle::~G4DynamicParticle()
|
||||
theElectronOccupancy =nullptr;
|
||||
}
|
||||
|
||||
|
||||
////////////////////
|
||||
// -- operators ----
|
||||
////////////////////
|
||||
@@ -341,12 +340,12 @@ void G4DynamicParticle::SetDefinition(const G4ParticleDefinition * aParticleDefi
|
||||
theDynamicalCharge = theParticleDefinition->GetPDGCharge();
|
||||
theDynamicalSpin = theParticleDefinition->GetPDGSpin();
|
||||
theDynamicalMagneticMoment = theParticleDefinition->GetPDGMagneticMoment();
|
||||
thePDGcode = theParticleDefinition->GetPDGEncoding();
|
||||
|
||||
// Set electron orbits
|
||||
if (theElectronOccupancy != nullptr) delete theElectronOccupancy;
|
||||
theElectronOccupancy = nullptr;
|
||||
|
||||
if (theElectronOccupancy != nullptr) {
|
||||
delete theElectronOccupancy;
|
||||
theElectronOccupancy = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
@@ -361,16 +360,12 @@ G4bool G4DynamicParticle::operator!=(const G4DynamicParticle &right) const
|
||||
return (this != (G4DynamicParticle *) &right);
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////
|
||||
// -- AllocateElectronOccupancy --
|
||||
////////////////////
|
||||
void G4DynamicParticle::AllocateElectronOccupancy()
|
||||
{
|
||||
const G4ParticleDefinition* particle = GetDefinition();
|
||||
|
||||
if (G4IonTable::IsIon(particle)) {
|
||||
if (G4IonTable::IsIon(theParticleDefinition)) {
|
||||
// Only ions can have ElectronOccupancy
|
||||
theElectronOccupancy = new G4ElectronOccupancy();
|
||||
|
||||
@@ -454,17 +449,9 @@ void G4DynamicParticle::DumpInfo(G4int) const
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
///////////////////////
|
||||
//
|
||||
void G4DynamicParticle::SetMass(G4double newMass)
|
||||
{
|
||||
if(std::abs(newMass-theParticleDefinition->GetPDGMass())>EnergyMomentumRelationAllowance*0.1) {
|
||||
theDynamicalMass = newMass;
|
||||
}
|
||||
}
|
||||
////////////////////////
|
||||
|
||||
G4double G4DynamicParticle::GetElectronMass() const
|
||||
////////////////////////
|
||||
G4double G4DynamicParticle::GetElectronMass() const
|
||||
{
|
||||
return CLHEP::electron_mass_c2;
|
||||
}
|
||||
|
||||
@@ -67,8 +67,7 @@ G4double G4NucleiProperties::GetNuclearMass(const G4double A, const G4double Z)
|
||||
G4int iA = G4int(A);
|
||||
mass =GetNuclearMass(iA,iZ);
|
||||
}
|
||||
|
||||
return mass;
|
||||
return mass;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +75,6 @@ G4double G4NucleiProperties::GetNuclearMass(const G4int A, const G4int Z)
|
||||
{
|
||||
if (mass_proton <= 0.0 ) {
|
||||
const G4ParticleDefinition * nucleus = nullptr;
|
||||
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
|
||||
if (nucleus!=nullptr) mass_proton = nucleus->GetPDGMass();
|
||||
|
||||
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("neutron"); // neutron
|
||||
if (nucleus!=nullptr) mass_neutron = nucleus->GetPDGMass();
|
||||
|
||||
@@ -94,6 +90,8 @@ G4double G4NucleiProperties::GetNuclearMass(const G4int A, const G4int Z)
|
||||
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("He3"); // He3
|
||||
if (nucleus!=nullptr) mass_He3 = nucleus->GetPDGMass();
|
||||
|
||||
nucleus = G4ParticleTable::GetParticleTable()->FindParticle("proton"); // proton
|
||||
if (nucleus!=nullptr) mass_proton = nucleus->GetPDGMass();
|
||||
}
|
||||
|
||||
if (A < 1 || Z < 0 || Z > A) {
|
||||
@@ -131,6 +129,10 @@ G4double G4NucleiProperties::GetNuclearMass(const G4int A, const G4int Z)
|
||||
} else if (G4NucleiPropertiesTheoreticalTable::IsInTable(Z,A)){
|
||||
// Theoretical table
|
||||
mass = G4NucleiPropertiesTheoreticalTable::GetNuclearMass(Z,A);
|
||||
} else if ( Z == A ) {
|
||||
mass = A*mass_proton;
|
||||
} else if( 0 == Z ) {
|
||||
mass = A*mass_neutron;
|
||||
} else {
|
||||
mass = NuclearMass(G4double(A),G4double(Z));
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ void G4NuclideTable::GenerateNuclide()
|
||||
{
|
||||
if ( threshold_of_half_life < minimum_threshold_of_half_life ) {
|
||||
// Need to update full list
|
||||
char* path = getenv("G4ENSDFSTATEDATA");
|
||||
char* path = std::getenv("G4ENSDFSTATEDATA");
|
||||
|
||||
if ( !path ) {
|
||||
G4Exception("G4NuclideTable", "PART70000",
|
||||
|
||||
Reference in New Issue
Block a user