Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
@@ -65,6 +65,8 @@ namespace G4INCL {
void rotatePosition(const G4double angle, const ThreeVector &axis) const;
void rotateMomentum(const G4double angle, const ThreeVector &axis) const;
void boost(const ThreeVector &b) const;
G4double getParticleListBias() const;
std::vector<G4int> getParticleListBiasVector() const;
};
typedef ParticleList::const_iterator ParticleIter;
@@ -84,6 +86,7 @@ namespace G4INCL {
Particle(const Particle &rhs) :
theZ(rhs.theZ),
theA(rhs.theA),
theS(rhs.theS),
theParticipantType(rhs.theParticipantType),
theType(rhs.theType),
theEnergy(rhs.theEnergy),
@@ -96,6 +99,7 @@ namespace G4INCL {
thePotentialEnergy(rhs.thePotentialEnergy),
rpCorrelated(rhs.rpCorrelated),
uncorrelatedMomentum(rhs.uncorrelatedMomentum),
theParticleBias(rhs.theParticleBias),
theHelicity(rhs.theHelicity),
emissionTime(rhs.emissionTime),
outOfWell(rhs.outOfWell),
@@ -118,6 +122,7 @@ namespace G4INCL {
void swap(Particle &rhs) {
std::swap(theZ, rhs.theZ);
std::swap(theA, rhs.theA);
std::swap(theS, rhs.theS);
std::swap(theParticipantType, rhs.theParticipantType);
std::swap(theType, rhs.theType);
if(rhs.thePropagationEnergy == &(rhs.theFrozenEnergy))
@@ -179,45 +184,104 @@ namespace G4INCL {
case DeltaPlusPlus:
theA = 1;
theZ = 2;
theS = 0;
break;
case Proton:
case DeltaPlus:
theA = 1;
theZ = 1;
theS = 0;
break;
case Neutron:
case DeltaZero:
theA = 1;
theZ = 0;
theS = 0;
break;
case DeltaMinus:
theA = 1;
theZ = -1;
theS = 0;
break;
case PiPlus:
theA = 0;
theZ = 1;
theS = 0;
break;
case PiZero:
case Eta:
case Omega:
case EtaPrime:
case Photon:
case Eta:
case Omega:
case EtaPrime:
case Photon:
theA = 0;
theZ = 0;
theS = 0;
break;
case PiMinus:
theA = 0;
theZ = -1;
theS = 0;
break;
case Lambda:
theA = 1;
theZ = 0;
theS = -1;
break;
case SigmaPlus:
theA = 1;
theZ = 1;
theS = -1;
break;
case SigmaZero:
theA = 1;
theZ = 0;
theS = -1;
break;
case SigmaMinus:
theA = 1;
theZ = -1;
theS = -1;
break;
case KPlus:
theA = 0;
theZ = 1;
theS = 1;
break;
case KZero:
theA = 0;
theZ = 0;
theS = 1;
break;
case KZeroBar:
theA = 0;
theZ = 0;
theS = -1;
break;
case KShort:
theA = 0;
theZ = 0;
theS = -99;
break;
case KLong:
theA = 0;
theZ = 0;
theS = 99;
break;
case KMinus:
theA = 0;
theZ = -1;
theS = -1;
break;
case Composite:
// INCL_ERROR("Trying to set particle type to Composite! Construct a Cluster object instead" << '\n');
theA = 0;
theZ = 0;
theS = 0;
break;
case UnknownParticle:
theA = 0;
theZ = 0;
theS = 0;
INCL_ERROR("Trying to set particle type to Unknown!" << '\n');
break;
}
@@ -231,9 +295,9 @@ namespace G4INCL {
*/
G4bool isNucleon() const {
if(theType == G4INCL::Proton || theType == G4INCL::Neutron)
return true;
return true;
else
return false;
return false;
};
ParticipantType getParticipantType() const {
@@ -271,29 +335,61 @@ namespace G4INCL {
/** \brief Is this a pion? */
G4bool isPion() const { return (theType == PiPlus || theType == PiZero || theType == PiMinus); }
/** \brief Is this a eta? */
/** \brief Is this an eta? */
G4bool isEta() const { return (theType == Eta); }
/** \brief Is this a omega? */
/** \brief Is this an omega? */
G4bool isOmega() const { return (theType == Omega); }
/** \brief Is this a etaprime? */
/** \brief Is this an etaprime? */
G4bool isEtaPrime() const { return (theType == EtaPrime); }
/** \brief Is this a photon? */
G4bool isPhoton() const { return (theType == Photon); }
/** \brief Is it a resonance? */
inline G4bool isResonance() const { return isDelta(); }
/** \brief Is it a Delta? */
inline G4bool isDelta() const {
return (theType==DeltaPlusPlus || theType==DeltaPlus ||
theType==DeltaZero || theType==DeltaMinus);
}
theType==DeltaZero || theType==DeltaMinus); }
/** \brief Is this a Sigma? */
G4bool isSigma() const { return (theType == SigmaPlus || theType == SigmaZero || theType == SigmaMinus); }
/** \brief Is this a Kaon? */
G4bool isKaon() const { return (theType == KPlus || theType == KZero); }
/** \brief Is this an antiKaon? */
G4bool isAntiKaon() const { return (theType == KZeroBar || theType == KMinus); }
/** \brief Is this a Lambda? */
G4bool isLambda() const { return (theType == Lambda); }
/** \brief Is this a Nucleon or a Lambda? */
G4bool isNucleonorLambda() const { return (isNucleon() || isLambda()); }
/** \brief Is this an Hyperon? */
G4bool isHyperon() const { return (isLambda() || isSigma()); }
/** \brief Is this a Meson? */
G4bool isMeson() const { return (isPion() || isKaon() || isAntiKaon() || isEta() || isEtaPrime() || isOmega()); }
/** \brief Is this a Baryon? */
G4bool isBaryon() const { return (isNucleon() || isResonance() || isHyperon()); }
/** \brief Is this an Strange? */
G4bool isStrange() const { return (isKaon() || isAntiKaon() || isHyperon()); }
/** \brief Returns the baryon number. */
G4int getA() const { return theA; }
/** \brief Returns the charge number. */
G4int getZ() const { return theZ; }
/** \brief Returns the strangeness number. */
G4int getS() const { return theS; }
G4double getBeta() const {
const G4double P = theMomentum.mag();
@@ -355,6 +451,16 @@ namespace G4INCL {
case PiPlus:
case PiMinus:
case PiZero:
case Lambda:
case SigmaPlus:
case SigmaZero:
case SigmaMinus:
case KPlus:
case KZero:
case KZeroBar:
case KShort:
case KLong:
case KMinus:
case Eta:
case Omega:
case EtaPrime:
@@ -388,6 +494,16 @@ namespace G4INCL {
case PiPlus:
case PiMinus:
case PiZero:
case Lambda:
case SigmaPlus:
case SigmaZero:
case SigmaMinus:
case KPlus:
case KZero:
case KZeroBar:
case KShort:
case KLong:
case KMinus:
case Eta:
case Omega:
case EtaPrime:
@@ -421,6 +537,16 @@ namespace G4INCL {
case PiPlus:
case PiMinus:
case PiZero:
case Lambda:
case SigmaPlus:
case SigmaZero:
case SigmaMinus:
case KPlus:
case KZero:
case KZeroBar:
case KShort:
case KLong:
case KMinus:
case Eta:
case Omega:
case EtaPrime:
@@ -803,8 +929,55 @@ namespace G4INCL {
return 1.;
}
/// \brief General bias vector function
static G4double getTotalBias();
static void setINCLBiasVector(std::vector<G4double> NewVector);
static void FillINCLBiasVector(G4double newBias);
static G4double getBiasFromVector(std::vector<G4int> VectorBias);
static std::vector<G4int> MergeVectorBias(Particle const * const p1, Particle const * const p2);
static std::vector<G4int> MergeVectorBias(std::vector<G4int> p1, Particle const * const p2);
/// \brief Get the particle bias.
G4double getParticleBias() const { return theParticleBias; };
/// \brief Set the particle bias.
void setParticleBias(G4double ParticleBias) { this->theParticleBias = ParticleBias; }
/// \brief Get the vector list of biased vertices on the particle path.
std::vector<G4int> getBiasCollisionVector() const { return theBiasCollisionVector; }
/// \brief Set the vector list of biased vertices on the particle path.
void setBiasCollisionVector(std::vector<G4int> BiasCollisionVector) {
this->theBiasCollisionVector = BiasCollisionVector;
this->setParticleBias(Particle::getBiasFromVector(BiasCollisionVector));
}
public:
/** \brief Time ordered vector of all bias applied
*
* /!\ Caution /!\
* methods Assotiated to G4VectorCache<T> are:
* Push_back(…),
* operator[],
* Begin(),
* End(),
* Clear(),
* Size() and
* Pop_back()
*
*/
#ifdef INCLXX_IN_GEANT4_MODE
static std::vector<G4double> INCLBiasVector;
//static G4VectorCache<G4double> INCLBiasVector;
#else
static G4ThreadLocal std::vector<G4double> INCLBiasVector;
//static G4VectorCache<G4double> INCLBiasVector;
#endif
static G4ThreadLocal G4int nextBiasedCollisionID;
protected:
G4int theZ, theA;
G4int theZ, theA, theS;
ParticipantType theParticipantType;
G4INCL::ParticleType theType;
G4double theEnergy;
@@ -821,11 +994,16 @@ namespace G4INCL {
G4bool rpCorrelated;
G4double uncorrelatedMomentum;
G4double theParticleBias;
private:
G4double theHelicity;
G4double emissionTime;
G4bool outOfWell;
/// \brief Time ordered vector of all biased vertices on the particle path
std::vector<G4int> theBiasCollisionVector;
G4double theMass;
static G4ThreadLocal long nextID;