Import Geant4 11.2.2 source tree

This commit is contained in:
Gabriele Cosmo
2024-06-21 15:46:33 +02:00
parent dda54bbdcf
commit f7b23877ed
411 changed files with 22817 additions and 21317 deletions
@@ -85,6 +85,8 @@ class G4CrossSectionHP : public G4VCrossSectionDataSet
inline G4double GetMaxHPEnergy() const;
inline void SetBinSearch(G4int n);
private:
void Initialise(const G4int Z);
@@ -102,6 +104,7 @@ class G4CrossSectionHP : public G4VCrossSectionDataSet
inline G4bool CheckCache(const G4int Z);
const G4ParticleDefinition* fParticle;
const G4ParticleDefinition* fNeutron;
G4ParticleHPManager* fManagerHP;
const G4double emax;
@@ -113,6 +116,8 @@ class G4CrossSectionHP : public G4VCrossSectionDataSet
const G4int minZ;
const G4int maxZ;
G4int binSearch{2};
std::size_t index{0};
G4bool fPrinted{false};
@@ -157,4 +162,9 @@ inline G4double G4CrossSectionHP::GetMaxHPEnergy() const
return emax;
}
inline void G4CrossSectionHP::SetBinSearch(G4int n)
{
if (n > 0) { binSearch = n; }
}
#endif
@@ -55,13 +55,14 @@ class G4ParticleHPArbitaryTab : public G4VParticleHPEDis
inline void Init(std::istream& theData) override
{
G4int i;
std::size_t i;
theFractionalProb.Init(theData, CLHEP::eV);
theData >> nDistFunc; // = number of incoming n energy points
theDistFunc = new G4ParticleHPVector[nDistFunc];
const std::size_t dsize = nDistFunc > 0 ? nDistFunc : 1;
theDistFunc = new G4ParticleHPVector[dsize];
theManager.Init(theData);
G4double currentEnergy;
for (i = 0; i < nDistFunc; i++) {
for (i = 0; i < dsize; ++i) {
theData >> currentEnergy;
theDistFunc[i].SetLabel(currentEnergy * CLHEP::eV);
theDistFunc[i].Init(theData, CLHEP::eV);
@@ -76,17 +77,17 @@ class G4ParticleHPArbitaryTab : public G4VParticleHPEDis
//************************************************************************
// EMendoza:
// Here we calculate the thresholds for the 2D sampling:
for (i = 0; i < nDistFunc; i++) {
for (i = 0; i < dsize; ++i) {
G4int np = theDistFunc[i].GetVectorLength();
theLowThreshold[i] = theDistFunc[i].GetEnergy(0);
theHighThreshold[i] = theDistFunc[i].GetEnergy(np - 1);
for (G4int j = 0; j < np - 1; j++) {
for (G4int j = 0; j < np - 1; ++j) {
if (theDistFunc[i].GetXsec(j + 1) > 1.e-20) {
theLowThreshold[i] = theDistFunc[i].GetEnergy(j);
break;
}
}
for (G4int j = 1; j < np; j++) {
for (G4int j = 1; j < np; ++j) {
if (theDistFunc[i].GetXsec(j - 1) > 1.e-20) {
theHighThreshold[i] = theDistFunc[i].GetEnergy(j);
}
@@ -33,6 +33,7 @@
#include "G4ParticleHPLegendreTable.hh"
#include "G4ios.hh"
#include <vector>
#include <fstream>
class G4ParticleHPLegendreStore
@@ -40,11 +41,11 @@ class G4ParticleHPLegendreStore
public:
G4ParticleHPLegendreStore(G4int n)
{
theCoeff = new G4ParticleHPLegendreTable[n];
theCoeff.resize(n);
nEnergy = n;
}
~G4ParticleHPLegendreStore() { delete[] theCoeff; }
~G4ParticleHPLegendreStore() {}
inline void Init(G4int i, G4double e, G4int n) { theCoeff[i].Init(e, n); }
inline void SetNPoints(G4int n) { nEnergy = n; }
@@ -77,7 +78,7 @@ class G4ParticleHPLegendreStore
private:
G4int nEnergy;
G4ParticleHPLegendreTable* theCoeff;
std::vector<G4ParticleHPLegendreTable> theCoeff;
G4InterpolationManager theManager; // interpolate between different Tables
};
#endif