Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -30,28 +30,29 @@
// Sylvie Leray, CEA
// Joseph Cugnon, University of Liege
//
// INCL++ revision: v5.0_rc3
// INCL++ revision: v5.1.8
//
#define INCLXX_IN_GEANT4_MODE 1
#include "globals.hh"
/** \file G4INCLINuclearPotential.hh
* \brief Abstract G4interface to the nuclear potential.
* \brief Abstract interface to the nuclear potential.
*
* NuclearPotential-like classes should provide access to the value of the
* potential of a particle in a particular context. For example, an instance of
* a NuclearPotential class should be associated to every nucleus.
*
* Created on: 17 January 2011
* Author: Davide Mancusi
* \date 17 January 2011
* \author Davide Mancusi
*/
#ifndef G4INCLINUCLEARPOTENTIAL_HH
#define G4INCLINUCLEARPOTENTIAL_HH 1
#include "G4INCLParticle.hh"
#include "G4INCLNuclearDensity.hh"
#include "G4INCLRandom.hh"
#include "G4INCLDeuteronDensity.hh"
#include <map>
// #include <cassert>
@@ -61,16 +62,18 @@ namespace G4INCL {
class INuclearPotential {
public:
INuclearPotential(NuclearDensity * const nuclearDensity, G4bool pionPot)
: theDensity(nuclearDensity), pionPotential(pionPot)
INuclearPotential(const G4int A, const G4int Z, const G4bool pionPot) :
theA(A),
theZ(Z),
pionPotential(pionPot)
{
if(pionPotential) {
const G4double ZOverA = ((G4double) theDensity->getZ()) / ((G4double) theDensity->getA());
const G4double ZOverA = ((G4double) theZ) / ((G4double) theA);
// As in INCL4.6, use the r0*A^(1/3) formula to estimate vc
const G4double r = 1.12*Math::pow13((G4double)theDensity->getA());
const G4double r = 1.12*Math::pow13((G4double)theA);
const G4double xsi = 1. - 2.*ZOverA;
const G4double vc = 1.8*theDensity->getZ()/r; // 1.8 = 1.44*1.25
const G4double vc = 1.25*PhysicalConstants::eSquared*theZ/r;
vPiPlus = vPionDefault + 71.*xsi - vc;
vPiZero = vPionDefault;
vPiMinus = vPionDefault - 71.*xsi + vc;
@@ -79,19 +82,10 @@ namespace G4INCL {
vPiZero = 0.0;
vPiMinus = 0.0;
}
}
virtual ~INuclearPotential() {}
inline NuclearDensity *getDensity() const {
return theDensity;
}
void setDensity(NuclearDensity * const nuclearDensity) {
theDensity = nuclearDensity;
}
/// \brief Do we have a pion potential?
G4bool hasPionPotential() { return pionPotential; }
@@ -99,29 +93,62 @@ namespace G4INCL {
/** \brief Return the Fermi energy for a particle.
*
* \param p poG4inter to a Particle
* \param p pointer to a Particle
* \return Fermi energy for that particle type
**/
inline G4double getFermiEnergy(const Particle * const p) const { return fermiEnergy.find(p->getType())->second; }
inline G4double getFermiEnergy(const Particle * const p) const {
std::map<ParticleType, G4double>::const_iterator i = fermiEnergy.find(p->getType());
// assert(i!=fermiEnergy.end());
return i->second;
}
/** \brief Return the Fermi energy for a particle type.
*
* \param t particle type
* \return Fermi energy for that particle type
**/
inline G4double getFermiEnergy(const ParticleType t) const { return fermiEnergy.find(t)->second; }
inline G4double getFermiEnergy(const ParticleType t) const {
std::map<ParticleType, G4double>::const_iterator i = fermiEnergy.find(t);
// assert(i!=fermiEnergy.end());
return i->second;
}
/** \brief Return the separation energy for a particle.
*
* \param p pointer to a Particle
* \return separation energy for that particle type
**/
inline G4double getSeparationEnergy(const Particle * const p) const {
std::map<ParticleType, G4double>::const_iterator i = separationEnergy.find(p->getType());
// assert(i!=separationEnergy.end());
return i->second;
}
/** \brief Return the separation energy for a particle type.
*
* \param t particle type
* \return separation energy for that particle type
**/
inline G4double getSeparationEnergy(const ParticleType t) const {
std::map<ParticleType, G4double>::const_iterator i = separationEnergy.find(t);
// assert(i!=separationEnergy.end());
return i->second;
}
/** \brief Return the Fermi momentum for a particle.
*
* \param p poG4inter to a Particle
* \param p pointer to a Particle
* \return Fermi momentum for that particle type
**/
inline G4double getFermiMomentum(const Particle * const p) const {
if(p->isDelta()) {
const G4double Tf = getFermiEnergy(p), m = p->getMass();
return std::sqrt(Tf*(Tf+2.*m));
} else
return fermiMomentum.find(p->getType())->second;
} else {
std::map<ParticleType, G4double>::const_iterator i = fermiMomentum.find(p->getType());
// assert(i!=fermiMomentum.end());
return i->second;
}
}
/** \brief Return the Fermi momentum for a particle type.
@@ -130,14 +157,15 @@ namespace G4INCL {
* \return Fermi momentum for that particle type
**/
inline G4double getFermiMomentum(const ParticleType t) const {
// assert(t!=DeltaPlusPlus && t!=DeltaPlus && t!=DeltaZero && t!=DeltaMinus);
return fermiMomentum.find(t)->second;
// assert(t!=DeltaPlusPlus && t!=DeltaPlus && t!=DeltaZero && t!=DeltaMinus);
std::map<ParticleType, G4double>::const_iterator i = fermiMomentum.find(t);
return i->second;
}
protected:
/// \brief Compute the potential energy for the given pion.
G4double computePionPotentialEnergy(const Particle * const p) const {
// assert(p->getType()==PiPlus || p->getType()==PiZero || p->getType()==PiMinus);
// assert(p->getType()==PiPlus || p->getType()==PiZero || p->getType()==PiMinus);
if(pionPotential && !p->isOutOfWell()) {
switch( p->getType() ) {
case PiPlus:
@@ -149,26 +177,31 @@ namespace G4INCL {
case PiMinus:
return vPiMinus;
break;
default: // Pion potential is defined and non-zero only for pions
return 0.0;
break;
default: // Pion potential is defined and non-zero only for pions
return 0.0;
break;
}
}
else
return 0.0;
}
NuclearDensity *theDensity;
protected:
/// \brief The mass number of the nucleus
const G4int theA;
/// \brief The charge number of the nucleus
const G4int theZ;
private:
const G4bool pionPotential;
G4double vPiPlus, vPiZero, vPiMinus;
static const G4double vPionDefault;
protected:
/* \brief map of Fermi energies per particle type */
std::map<ParticleType,G4double> fermiEnergy;
/* \brief map of Fermi momenta per particle type */
std::map<ParticleType,G4double> fermiMomentum;
private:
G4bool pionPotential;
G4double vPiPlus, vPiZero, vPiMinus;
static const G4double vPionDefault;
/* \brief map of separation energies per particle type */
std::map<ParticleType,G4double> separationEnergy;
};