Import Geant4 11.0.0 source tree
This commit is contained in:
committed by
Ben Morgan
parent
6399a014b6
commit
80e2389dd8
@@ -75,6 +75,7 @@ namespace G4INCL {
|
||||
Ep((Float_t)0.0),
|
||||
nShots(0),
|
||||
geometricCrossSection((Float_t)0.0),
|
||||
biasFactor((Float_t)0.0),
|
||||
nTransparents(0),
|
||||
reactionCrossSection((Float_t)0.0),
|
||||
errorReactionCrossSection((Float_t)0.0),
|
||||
@@ -123,6 +124,8 @@ namespace G4INCL {
|
||||
Int_t nShots;
|
||||
/** \brief Geometric cross section */
|
||||
Float_t geometricCrossSection;
|
||||
/** \brief Bias factor */
|
||||
Float_t biasFactor;
|
||||
/** \brief Number of transparent shots */
|
||||
Int_t nTransparents;
|
||||
/** \brief Calculated reaction cross section */
|
||||
|
||||
@@ -103,6 +103,7 @@ namespace G4INCL {
|
||||
|
||||
/// \brief Get the native INCL name of the ion
|
||||
std::string getName(const G4int A, const G4int Z);
|
||||
std::string getName(const G4int A, const G4int Z, const G4int S);
|
||||
|
||||
/// \brief Get the short INCL name of the ion
|
||||
std::string getShortName(const G4int A, const G4int Z);
|
||||
|
||||
@@ -177,8 +177,11 @@ namespace G4INCL {
|
||||
}
|
||||
|
||||
result_type operator()() const {
|
||||
// return shootInteger(max());
|
||||
return G4RandFlat::shootInt(INT_MAX);
|
||||
#ifdef INCLXX_IN_GEANT4_MODE
|
||||
return G4RandFlat::shootInt(INT_MAX);
|
||||
#else
|
||||
return shootInteger(max());
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -52,10 +52,17 @@
|
||||
namespace G4INCL {
|
||||
|
||||
namespace {
|
||||
G4ThreadLocal G4double radiusP[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double radiusN[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double diffusenessP[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double diffusenessN[TableZSize][TableASize];
|
||||
#ifdef INCLXX_IN_GEANT4_MODE
|
||||
G4ThreadLocal G4double radiusP[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double radiusN[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double diffusenessP[TableZSize][TableASize];
|
||||
G4ThreadLocal G4double diffusenessN[TableZSize][TableASize];
|
||||
#else
|
||||
G4double radiusP[TableZSize][TableASize];
|
||||
G4double radiusN[TableZSize][TableASize];
|
||||
G4double diffusenessP[TableZSize][TableASize];
|
||||
G4double diffusenessN[TableZSize][TableASize];
|
||||
#endif
|
||||
|
||||
void cleanTable(){
|
||||
for(G4int i=0;i<TableZSize;++i)
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace G4INCL {
|
||||
return mL+ParticleTable::getRealMass(Neutron);
|
||||
}
|
||||
else if( Z == 0) { // No stable hypernuclei with Z=0
|
||||
return ParticleTable::getRealMass(Neutron)-mL*S;
|
||||
return (A+S)*ParticleTable::getRealMass(Neutron)-mL*S;
|
||||
}
|
||||
else if( A==2 && Z == 1) {
|
||||
return mL+ParticleTable::getRealMass(Proton);
|
||||
|
||||
@@ -278,14 +278,30 @@ namespace G4INCL {
|
||||
endFirstSection = beginSecondSection;
|
||||
|
||||
} else {
|
||||
// One separator, Fe-56 or 56-Fe style
|
||||
// One separator, Fe-56 or 56-Fe style or hypercluster style: Fe56-1 (iron 56 including 1 lambda)
|
||||
endFirstSection = firstSeparator;
|
||||
beginSecondSection = firstSeparator+1;
|
||||
}
|
||||
|
||||
|
||||
std::string firstSection(pS.substr(0,endFirstSection));
|
||||
std::string secondSection(pS.substr(beginSecondSection,std::string::npos));
|
||||
std::stringstream parsingStream;
|
||||
|
||||
if(std::isalpha(firstSection.at(0)) && std::isdigit(firstSection.at(endFirstSection-1))) { // Hypernucleus, must be Fe56-1 style
|
||||
std::stringstream parseStrangeness;
|
||||
parseStrangeness.str(secondSection);
|
||||
parseStrangeness >> theS;
|
||||
if(parsingStream.fail()) {
|
||||
// Couldn't parse the strange charge section
|
||||
// Setting unknown particle species
|
||||
(*this) = ParticleSpecies(UnknownParticle);
|
||||
return;
|
||||
}
|
||||
theS *= (-1);
|
||||
beginSecondSection = std::find_if(pS.begin()+1, pS.end(), predicate) - pS.begin(); // predicate == std::isdigit(G4int) in this case
|
||||
firstSection = pS.substr(0, beginSecondSection);
|
||||
secondSection = pS.substr(beginSecondSection, endFirstSection);
|
||||
}
|
||||
|
||||
// Parse the sections
|
||||
G4bool success;
|
||||
@@ -348,86 +364,86 @@ namespace G4INCL {
|
||||
|
||||
G4int ParticleSpecies::getPDGCode() const {
|
||||
switch (theType) {
|
||||
case Proton:
|
||||
return 2212;
|
||||
break;
|
||||
case Neutron:
|
||||
return 2112;
|
||||
break;
|
||||
case DeltaPlusPlus:
|
||||
return 2224;
|
||||
break;
|
||||
case DeltaPlus:
|
||||
return 2214;
|
||||
break;
|
||||
case DeltaZero:
|
||||
return 2114;
|
||||
break;
|
||||
case DeltaMinus:
|
||||
return 1114;
|
||||
break;
|
||||
case PiPlus:
|
||||
return 211;
|
||||
break;
|
||||
case PiZero:
|
||||
return 111;
|
||||
break;
|
||||
case PiMinus:
|
||||
return -211;
|
||||
break;
|
||||
case Eta:
|
||||
return 221;
|
||||
break;
|
||||
case Omega:
|
||||
return 223;
|
||||
break;
|
||||
case EtaPrime:
|
||||
return 331;
|
||||
break;
|
||||
case Photon:
|
||||
return 22;
|
||||
break;
|
||||
case Lambda:
|
||||
return 3122;
|
||||
break;
|
||||
case SigmaPlus:
|
||||
return 3222;
|
||||
break;
|
||||
case SigmaZero:
|
||||
return 3212;
|
||||
break;
|
||||
case SigmaMinus:
|
||||
return 3112;
|
||||
break;
|
||||
case KPlus:
|
||||
return 321;
|
||||
break;
|
||||
case KZero:
|
||||
return 311;
|
||||
break;
|
||||
case KZeroBar:
|
||||
return -311;
|
||||
break;
|
||||
case KShort:
|
||||
return 310;
|
||||
break;
|
||||
case KLong:
|
||||
return 130;
|
||||
break;
|
||||
case KMinus:
|
||||
return -321;
|
||||
break;
|
||||
case Composite:
|
||||
if(theA == 1 && theZ == 1 && theS == 0) return 2212;
|
||||
else if(theA == 1 && theZ == 0 && theS == 0) return 2112;
|
||||
else if(theA == 1 && theZ == 0 && theS == -1) return 3122;
|
||||
else return theA+theZ*1000-theS*1e6; // Here -theS because hyper-nucleus -> theS < 0
|
||||
break;
|
||||
default:
|
||||
INCL_ERROR("ParticleSpecies::getPDGCode: Unknown particle type." << '\n');
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
case Proton:
|
||||
return 2212;
|
||||
break;
|
||||
case Neutron:
|
||||
return 2112;
|
||||
break;
|
||||
case DeltaPlusPlus:
|
||||
return 2224;
|
||||
break;
|
||||
case DeltaPlus:
|
||||
return 2214;
|
||||
break;
|
||||
case DeltaZero:
|
||||
return 2114;
|
||||
break;
|
||||
case DeltaMinus:
|
||||
return 1114;
|
||||
break;
|
||||
case PiPlus:
|
||||
return 211;
|
||||
break;
|
||||
case PiZero:
|
||||
return 111;
|
||||
break;
|
||||
case PiMinus:
|
||||
return -211;
|
||||
break;
|
||||
case Eta:
|
||||
return 221;
|
||||
break;
|
||||
case Omega:
|
||||
return 223;
|
||||
break;
|
||||
case EtaPrime:
|
||||
return 331;
|
||||
break;
|
||||
case Photon:
|
||||
return 22;
|
||||
break;
|
||||
case Lambda:
|
||||
return 3122;
|
||||
break;
|
||||
case SigmaPlus:
|
||||
return 3222;
|
||||
break;
|
||||
case SigmaZero:
|
||||
return 3212;
|
||||
break;
|
||||
case SigmaMinus:
|
||||
return 3112;
|
||||
break;
|
||||
case KPlus:
|
||||
return 321;
|
||||
break;
|
||||
case KZero:
|
||||
return 311;
|
||||
break;
|
||||
case KZeroBar:
|
||||
return -311;
|
||||
break;
|
||||
case KShort:
|
||||
return 310;
|
||||
break;
|
||||
case KLong:
|
||||
return 130;
|
||||
break;
|
||||
case KMinus:
|
||||
return -321;
|
||||
break;
|
||||
case Composite:
|
||||
if(theA == 1 && theZ == 1 && theS == 0) return 2212;
|
||||
else if(theA == 1 && theZ == 0 && theS == 0) return 2112;
|
||||
else if(theA == 1 && theZ == 0 && theS == -1) return 3122;
|
||||
else return theA+theZ*1000-theS*1e6; // Here -theS because hyper-nucleus -> theS < 0
|
||||
break;
|
||||
default:
|
||||
INCL_ERROR("ParticleSpecies::getPDGCode: Unknown particle type." << '\n');
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -529,15 +529,19 @@ namespace G4INCL {
|
||||
}
|
||||
|
||||
std::string getShortName(const ParticleSpecies &s) {
|
||||
if(s.theType==Composite)
|
||||
if(s.theType==Composite && s.theS == 0)
|
||||
return getShortName(s.theA,s.theZ);
|
||||
else if(s.theType==Composite)
|
||||
return getName(s.theA,s.theZ,s.theS);
|
||||
else
|
||||
return getShortName(s.theType);
|
||||
}
|
||||
|
||||
std::string getName(const ParticleSpecies &s) {
|
||||
if(s.theType==Composite)
|
||||
if(s.theType==Composite && s.theS == 0)
|
||||
return getName(s.theA,s.theZ);
|
||||
else if(s.theType==Composite)
|
||||
return getName(s.theA,s.theZ,s.theS);
|
||||
else
|
||||
return getName(s.theType);
|
||||
}
|
||||
@@ -548,6 +552,17 @@ namespace G4INCL {
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
std::string getName(const G4int A, const G4int Z, const G4int S) {
|
||||
std::stringstream stream;
|
||||
if(S >= 0) // S < 0 for hypernuclei
|
||||
return getName(A, Z);
|
||||
else if(S == -1)
|
||||
stream << getElementName(Z) << "-" << A << "_" << "Lambda";
|
||||
else
|
||||
stream << getElementName(Z) << "-" << A << "_" << S << "-Lambda";
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
std::string getShortName(const G4int A, const G4int Z) {
|
||||
std::stringstream stream;
|
||||
stream << getElementName(Z);
|
||||
@@ -1206,7 +1221,7 @@ namespace G4INCL {
|
||||
}
|
||||
|
||||
G4double getRPCorrelationCoefficient(const ParticleType t) {
|
||||
// assert(t==Proton || t==Neutron);
|
||||
// assert(t==Proton || t==Neutron || t==Lambda);
|
||||
return rpCorrelationCoefficient[t];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user