Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -43,7 +43,7 @@
emax = result->GetEnergyChange();
}
//G4cout << "max energy "<<G4endl;
for(i=0;i<result->GetNumberOfSecondaries();i++)
for(i=0;i<static_cast<G4int>(result->GetNumberOfSecondaries());i++)
{
if(result->GetSecondary(i)->GetParticle()->GetKineticEnergy()>emax)
{
@@ -52,7 +52,7 @@
}
}
//G4cout <<"loop1"<<G4endl;
for(i=0; i<result->GetNumberOfSecondaries(); i++)
for(i=0; i<static_cast<G4int>(result->GetNumberOfSecondaries()); i++)
{
const G4DynamicParticle* aSecTrack = result->GetSecondary(i)->GetParticle();
if(i==maxE)
@@ -94,7 +94,7 @@
std::vector<G4HadSecondary> buffer;
G4int cMeson(0), cBaryon(0), cpi0(0), cgamma(0), cLepton(0);
for(i=0; i<result->GetNumberOfSecondaries(); i++)
for(i=0; i<static_cast<G4int>(result->GetNumberOfSecondaries()); i++)
{
G4bool aCatch = false;
G4double weight = 1;
@@ -116,7 +116,7 @@ void G4HadronicProcess::InitialiseLocal() {
aScaleFactor = 1.0;
fWeight = 1.0;
xBiasOn = false;
nMatWarn = 0;
nMatWarn = nKaonWarn = 0;
useIntegralXS = true;
theLastCrossSection = 0.0;
nICelectrons = 0;
@@ -141,16 +141,7 @@ void G4HadronicProcess::GetEnergyMomentumCheckEnvvars() {
void G4HadronicProcess::RegisterMe( G4HadronicInteraction *a )
{
if(!a) { return; }
try{ theEnergyRangeManager.RegisterMe( a ); }
catch(G4HadronicException & aE)
{
G4ExceptionDescription ed;
aE.Report(ed);
ed << "Unrecoverable error in " << GetProcessName()
<< " to register " << a->GetModelName() << G4endl;
G4Exception("G4HadronicProcess::RegisterMe", "had001", FatalException,
ed);
}
theEnergyRangeManager.RegisterMe( a );
G4HadronicProcessStore::Instance()->RegisterInteraction(this, a);
}
@@ -161,9 +152,9 @@ G4HadronicProcess::GetElementCrossSection(const G4DynamicParticle * part,
{
if(!mat)
{
++nMatWarn;
static const G4int nmax = 5;
if(nMatWarn < nmax) {
++nMatWarn;
G4ExceptionDescription ed;
ed << "Cannot compute Element x-section for " << GetProcessName()
<< " because no material defined \n"
@@ -335,14 +326,17 @@ G4HadronicProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&)
if ( particleDefinition == G4KaonZero::Definition() ||
particleDefinition == G4AntiKaonZero::Definition() ) {
G4ParticleDefinition* newPart;
if( G4UniformRand() > 0.5 ) { newPart = G4KaonZeroShort::Definition(); }
else { newPart = G4KaonZeroLong::Definition(); }
if( G4UniformRand() > 0.5 ) { newPart = G4KaonZeroShort::Definition(); }
else { newPart = G4KaonZeroLong::Definition(); }
dynamicParticle->SetDefinition( newPart );
G4ExceptionDescription ed;
ed << " Hadronic model " << theInteraction->GetModelName() << G4endl;
ed << " created " << particleDefinition->GetParticleName() << G4endl;
ed << " -> forced to be " << newPart->GetParticleName() << G4endl;
G4Exception( "G4HadronicProcess::PostStepDoIt", "had007", JustWarning, ed );
if(nKaonWarn < 5) {
++nKaonWarn;
G4ExceptionDescription ed;
ed << " Hadronic model " << theInteraction->GetModelName() << G4endl;
ed << " created " << particleDefinition->GetParticleName() << G4endl;
ed << " -> forced to be " << newPart->GetParticleName() << G4endl;
G4Exception( "G4HadronicProcess::PostStepDoIt", "had007", JustWarning, ed );
}
}
}
}
@@ -628,14 +622,14 @@ G4HadronicProcess::CheckEnergyMomentumConservation(const G4Track& aTrack,
final4mom = initial4mom;
final_A = initial_A;
final_Z = initial_Z;
if (nSec > 0 && aTrack.GetDynamicParticle()) {
if (nSec > 0) {
// The primary remains in final state (e.g. electro-nucleus )
G4Track temp(aTrack);
// Use the final energy / momentum
temp.SetMomentumDirection(*theTotalResult->GetMomentumDirection());
temp.SetKineticEnergy(theTotalResult->GetEnergy());
final4mom = temp.GetDynamicParticle()->Get4Momentum();
const G4ThreeVector& v = *theTotalResult->GetMomentumDirection();
G4double ekin = theTotalResult->GetEnergy();
G4double mass = aTrack.GetDefinition()->GetPDGMass();
G4double ptot = std::sqrt(ekin*(ekin + 2*mass));
final4mom.set(ptot*v.x(), ptot*v.y(), ptot*v.z(), mass + ekin);
final_A = track_A;
final_Z = track_Z;
// Expect that the target nucleus will have interacted,
@@ -37,6 +37,7 @@
//
// Modifications:
// 23.01.2009 V.Ivanchenko add destruction of processes
// 12.05.2020 A.Ribon introduced general verbose level in hadronics
//
// Class Description:
// Singleton to store hadronic processes, to provide access to processes
@@ -58,6 +59,7 @@
#include "G4HadronicInteractionRegistry.hh"
#include "G4CrossSectionDataSetRegistry.hh"
#include "G4HadronicEPTestMessenger.hh"
#include "G4HadronicParameters.hh"
#include <algorithm>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -744,17 +746,12 @@ G4HadronicProcessStore::PrintModelHtml(const G4HadronicInteraction * mod) const
G4String G4HadronicProcessStore::HtmlFileName(const G4String & in) const
{
G4String str(in);
// replace blanks by _ C++11 version:
#ifdef G4USE_STD11
std::transform(str.begin(), str.end(), str.begin(), [](char ch) {
// replace blanks:
std::transform(str.begin(), str.end(), str.begin(), [](char ch)
{
return ch == ' ' ? '_' : ch;
});
#else
// and now in ancient language
for(std::string::iterator it = str.begin(); it != str.end(); ++it) {
if(*it == ' ') *it = '_';
}
#endif
str=str + ".html";
return str;
}
@@ -763,7 +760,7 @@ G4String G4HadronicProcessStore::HtmlFileName(const G4String & in) const
void G4HadronicProcessStore::Dump(G4int level)
{
if (level == 0) return;
if (G4HadronicParameters::Instance()->GetVerboseLevel() == 0 || level == 0) return;
G4cout
<< "\n====================================================================\n"
@@ -791,6 +788,9 @@ void G4HadronicProcessStore::Dump(G4int level)
pname == "kaon+" ||
pname == "kaon-" ||
pname == "lambda" ||
pname == "sigma-" ||
pname == "D-" ||
pname == "B-" ||
pname == "GenericIon" ||
pname == "anti_neutron" ||
pname == "anti_proton" ||