Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -106,8 +106,14 @@ namespace G4INCL {
randomNumberGenerator = "Ranecu";
rngType = RanecuType;
autosaveFrequency = 10000;
maxNumberMultipions = -1;
crossSectionsString = "multipions";
crossSectionsType = MultiPionsCrossSections;
hadronizationTime = 0.;
#ifdef INCL_ROOT_USE
conciseROOTTree = false;
#endif
inverseKinematics = false;
}
std::string Config::summary() {
@@ -53,7 +53,6 @@ namespace G4INCL {
G4ThreadLocal Int_t EventInfo::eventNumber = 0;
#ifdef INCL_INVERSE_KINEMATICS
void EventInfo::fillInverseKinematics(const Double_t gamma) {
const Double_t beta = std::sqrt(1.-1./(gamma*gamma));
for(Int_t i=0; i<nParticles; ++i) {
@@ -86,7 +85,6 @@ namespace G4INCL {
thetaPrime[i] = Math::toDegrees(Math::arcCos(cosThetaPrime));
}
}
#endif // INCL_INVERSE_KINEMATICS
void EventInfo::remnantToParticle(const G4int remnantIndex) {
A[nParticles] = ARem[remnantIndex];
@@ -118,7 +118,7 @@ namespace G4INCL {
void wrap(std::string &str, const size_t lineLength, const std::string &separators) {
const size_t len = str.size();
size_t startPos = 0;
while(len-startPos > lineLength) {
while(len-startPos > lineLength) { /* Loop checking, 10.07.2015, D.Mancusi */
const size_t nextNewline = str.find('\n', startPos);
if(nextNewline!=std::string::npos && nextNewline-startPos<=lineLength)
startPos = nextNewline+1;
@@ -138,7 +138,7 @@ namespace G4INCL {
size_t cur_max_pos = maxPosition;
const size_t from_len = from.length();
const size_t to_len = to.length();
while((start_pos = str.find(from, start_pos)) != std::string::npos
while((start_pos = str.find(from, start_pos)) != std::string::npos /* Loop checking, 10.07.2015, D.Mancusi */
&& (cur_max_pos==std::string::npos || start_pos<cur_max_pos)) {
str.replace(start_pos, from_len, to);
start_pos += to_len; // In case 'to' contains 'from', like replacing 'x' with 'yx'
@@ -155,7 +155,7 @@ namespace G4INCL {
std::string token = str.substr(startPos, endPos-startPos);
tokens.push_back(token);
startPos = str.find_first_not_of(delimiters, endPos);
} while(endPos!=std::string::npos);
} while(endPos!=std::string::npos); /* Loop checking, 10.07.2015, D.Mancusi */
return tokens;
}
@@ -138,7 +138,7 @@ namespace G4INCL {
// read the file
std::vector<MassRecord> records;
MassRecord record;
while(massTableIn.good()) {
while(massTableIn.good()) { /* Loop checking, 10.07.2015, D.Mancusi */
massTableIn >> record;
records.push_back(record);
}
@@ -53,58 +53,56 @@ namespace G4INCL {
ParticleSpecies::ParticleSpecies(std::string const &pS) {
// Normalise the string to lower case
std::string pSNorm = pS;
std::transform(pSNorm.begin(), pSNorm.end(), pSNorm.begin(), ::tolower);
if(pSNorm=="p" || pSNorm=="proton") {
if(pS=="p" || pS=="proton") {
theA = 1;
theZ = 1;
theType = G4INCL::Proton;
} else if(pSNorm=="n" || pSNorm=="neutron") {
} else if(pS=="n" || pS=="neutron") {
theA = 1;
theZ = 0;
theType = G4INCL::Neutron;
} else if(pSNorm=="delta++" || pSNorm=="deltaplusplus") {
} else if(pS=="delta++" || pS=="deltaplusplus") {
theA = 1;
theZ = 2;
theType = G4INCL::DeltaPlusPlus;
} else if(pSNorm=="delta+" || pSNorm=="deltaplus") {
} else if(pS=="delta+" || pS=="deltaplus") {
theA = 1;
theZ = 1;
theType = G4INCL::DeltaPlus;
} else if(pSNorm=="delta0" || pSNorm=="deltazero") {
} else if(pS=="delta0" || pS=="deltazero") {
theA = 1;
theZ = 0;
theType = G4INCL::DeltaZero;
} else if(pSNorm=="delta-" || pSNorm=="deltaminus") {
} else if(pS=="delta-" || pS=="deltaminus") {
theA = 1;
theZ = -1;
theType = G4INCL::DeltaMinus;
} else if(pSNorm=="pi+" || pSNorm=="pion+" || pSNorm=="piplus" || pSNorm=="pionplus") {
} else if(pS=="pi+" || pS=="pion+" || pS=="piplus" || pS=="pionplus") {
theA = 0;
theZ = 1;
theType = G4INCL::PiPlus;
} else if(pSNorm=="pi0" || pSNorm=="pion0" || pSNorm=="pizero" || pSNorm=="pionzero") {
} else if(pS=="pi0" || pS=="pion0" || pS=="pizero" || pS=="pionzero") {
theA = 0;
theZ = 0;
theType = G4INCL::PiZero;
} else if(pSNorm=="pi-" || pSNorm=="pion-" || pSNorm=="piminus" || pSNorm=="pionminus") {
} else if(pS=="pi-" || pS=="pion-" || pS=="piminus" || pS=="pionminus") {
theA = 0;
theZ = -1;
theType = G4INCL::PiMinus;
} else if(pSNorm=="d" || pSNorm=="deuteron") {
} else if(pS=="d" || pS=="deuteron") {
theA = 2;
theZ = 1;
theType = G4INCL::Composite;
} else if(pSNorm=="t" || pSNorm=="triton") {
} else if(pS=="t" || pS=="triton") {
theA = 3;
theZ = 1;
theType = G4INCL::Composite;
} else if(pSNorm=="a" || pSNorm=="alpha") {
} else if(pS=="a" || pS=="alpha") {
theA = 4;
theZ = 2;
theType = G4INCL::Composite;
} else
parseNuclide(pSNorm);
parseNuclide(pS);
}
ParticleSpecies::ParticleSpecies(ParticleType const t) :
@@ -124,7 +122,7 @@ namespace G4INCL {
// Allowed characters
const std::string separators("-_");
std::string allowed("0123456789abcdefghijklmnopqrstuvwxyz");
std::string allowed("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
allowed += separators;
// There must be at least one character
@@ -99,14 +99,14 @@ namespace G4INCL {
G4double shoot0() {
G4double r;
while( (r=shoot()) <= 0. )
while( (r=shoot()) <= 0. ) /* Loop checking, 10.07.2015, D.Mancusi */
;
return r;
}
G4double shoot1() {
G4double r;
while( (r=shoot()) >= 1. )
while( (r=shoot()) >= 1. ) /* Loop checking, 10.07.2015, D.Mancusi */
;
return r;
}
@@ -105,7 +105,7 @@ namespace G4INCL {
y0 = (*f)(x0);
y1 = (*f)(x1);
iterations++;
} while(Math::sign(y0)==Math::sign(y1));
} while(Math::sign(y0)==Math::sign(y1)); /* Loop checking, 10.07.2015, D.Mancusi */
if(Math::sign(y1)==Math::sign(oldy1))
return std::make_pair(x0,oldx0);