Import Geant4 10.7.1 source tree
This commit is contained in:
@@ -14,6 +14,32 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
17 December 2020 - Vladimir Ivanchenko (hadr-cross-V10-06-18)
|
||||
- G4GammaNuclearXS - fixed duplicated name of static variable
|
||||
- G4ParticleInelasticXS, G4NeutronCaptureXS, G4NeutronElasticXS,
|
||||
G4NeutronInelasticXS - make MAXZ variable static class member
|
||||
|
||||
16 December 2020 - Guilherme Amadio
|
||||
- Drop cache for per-element G4CrossSectionDataStore::GetCrossSection(),
|
||||
since the cache is never used in practice. This method is always called
|
||||
by G4CrossSectionDataStore::ComputeCrossSection() inside a for loop in
|
||||
which the element changes for each iteration, which ensures the cache
|
||||
is always missed. Note that material, particle, and energy are still
|
||||
cached by G4CrossSectionDataStore::ComputeCrossSection(), and that cache
|
||||
hit rate has been measured to be about 6.9% for a full CMS ttbar event
|
||||
simulation at 14 TeV. The condition to check for the cache in that case
|
||||
has been optimized to minimize unnecessary checks by reordering checked
|
||||
conditions from most to least discriminant.
|
||||
|
||||
11 December 2020 - Vladimir Ivanchenko
|
||||
- G4VCrossSectionRatio - use inheritance from G4VCrossSectionDataSet
|
||||
in order to guarantee deletion of object end of run
|
||||
|
||||
06 December 2020 - Vladimir Ivanchenko
|
||||
- G4ParticleInelasticXS, G4CrossSectionInelastic, G4CrossSectionElastic
|
||||
extended maximum energy range for ion cross sections (QBBC and other
|
||||
Physics Lists has the same high energy limits)
|
||||
|
||||
24 November 2020 - A. Ribon (hadr-cross-V10-06-17)
|
||||
- G4EMDissociationCrossSection : apply fixes suggested by Laurie Nevay and
|
||||
Andrey Abramov (bug report #2254) to avoid numerical crashes for ions
|
||||
|
||||
@@ -122,12 +122,6 @@ private:
|
||||
G4double matKinEnergy;
|
||||
G4double matCrossSection;
|
||||
|
||||
const G4Material* elmMaterial;
|
||||
const G4Element* currentElement;
|
||||
const G4ParticleDefinition* elmParticle;
|
||||
G4double elmKinEnergy;
|
||||
G4double elmCrossSection;
|
||||
|
||||
G4int nDataSetList;
|
||||
G4int verboseLevel;
|
||||
//Fast path: caching
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
#include "G4Threading.hh"
|
||||
#include <vector>
|
||||
|
||||
const G4int MAXZEL = 93;
|
||||
|
||||
class G4DynamicParticle;
|
||||
class G4ParticleDefinition;
|
||||
class G4Element;
|
||||
@@ -101,8 +99,9 @@ private:
|
||||
G4VCrossSectionDataSet* ggXsection;
|
||||
const G4ParticleDefinition* gamma;
|
||||
|
||||
static G4PhysicsVector* data[MAXZEL];
|
||||
static G4double coeff[MAXZEL];
|
||||
static const G4int MAXZGAMMAN = 93;
|
||||
static G4PhysicsVector* data[MAXZGAMMAN];
|
||||
static G4double coeff[MAXZGAMMAN];
|
||||
static G4String gDataDirectory;
|
||||
|
||||
G4bool isMaster;
|
||||
|
||||
@@ -51,8 +51,6 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
const G4int MAXZCAPTURE = 93;
|
||||
|
||||
class G4DynamicParticle;
|
||||
class G4ParticleDefinition;
|
||||
class G4Element;
|
||||
@@ -113,6 +111,7 @@ private:
|
||||
|
||||
G4bool isMaster;
|
||||
|
||||
static const G4int MAXZCAPTURE = 93;
|
||||
static G4ElementData* data;
|
||||
static G4String gDataDirectory;
|
||||
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
#include "G4Threading.hh"
|
||||
#include <vector>
|
||||
|
||||
const G4int MAXZEL = 93;
|
||||
|
||||
class G4DynamicParticle;
|
||||
class G4ParticleDefinition;
|
||||
class G4Element;
|
||||
@@ -102,6 +100,7 @@ private:
|
||||
G4VComponentCrossSection* ggXsection;
|
||||
const G4ParticleDefinition* neutron;
|
||||
|
||||
static const G4int MAXZEL = 93;
|
||||
static G4PhysicsVector* data[MAXZEL];
|
||||
static G4double coeff[MAXZEL];
|
||||
static G4String gDataDirectory;
|
||||
|
||||
@@ -48,8 +48,6 @@
|
||||
#include "G4Threading.hh"
|
||||
#include <vector>
|
||||
|
||||
const G4int MAXZINEL = 93;
|
||||
|
||||
class G4DynamicParticle;
|
||||
class G4ParticleDefinition;
|
||||
class G4Element;
|
||||
@@ -111,6 +109,7 @@ private:
|
||||
|
||||
G4bool isMaster;
|
||||
|
||||
static const G4int MAXZINEL = 93;
|
||||
static G4ElementData* data;
|
||||
static G4double coeff[MAXZINEL];
|
||||
static G4String gDataDirectory;
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
#include "G4Threading.hh"
|
||||
#include <vector>
|
||||
|
||||
const G4int MAXZINELP = 93;
|
||||
|
||||
class G4DynamicParticle;
|
||||
class G4ParticleDefinition;
|
||||
class G4Element;
|
||||
@@ -113,6 +111,7 @@ private:
|
||||
G4int index;
|
||||
G4bool isMaster;
|
||||
|
||||
static const G4int MAXZINELP = 93;
|
||||
static G4ElementData* data[5];
|
||||
static G4double coeff[MAXZINELP][5];
|
||||
static G4String gDataDirectory[5];
|
||||
|
||||
@@ -143,8 +143,6 @@ public: //with description
|
||||
|
||||
virtual void CrossSectionDescription(std::ostream&) const;
|
||||
|
||||
public: // Without Description
|
||||
|
||||
virtual G4int GetVerboseLevel() const;
|
||||
|
||||
virtual void SetVerboseLevel(G4int value);
|
||||
@@ -163,12 +161,14 @@ public: // Without Description
|
||||
|
||||
inline const G4String& GetName() const;
|
||||
|
||||
inline void SetName(const G4String& nam);
|
||||
|
||||
protected:
|
||||
|
||||
inline void SetName(const G4String&);
|
||||
|
||||
G4int verboseLevel;
|
||||
|
||||
G4String name;
|
||||
|
||||
private:
|
||||
|
||||
G4VCrossSectionDataSet & operator=(const G4VCrossSectionDataSet &right);
|
||||
@@ -181,7 +181,6 @@ private:
|
||||
|
||||
G4bool isForAllAtomsAndEnergies;
|
||||
|
||||
G4String name;
|
||||
};
|
||||
|
||||
inline G4double
|
||||
|
||||
@@ -45,60 +45,28 @@
|
||||
#ifndef G4VCrossSectionRatio_h
|
||||
#define G4VCrossSectionRatio_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VCrossSectionDataSet.hh"
|
||||
|
||||
class G4ParticleDefinition;
|
||||
|
||||
class G4VCrossSectionRatio
|
||||
class G4VCrossSectionRatio : G4VCrossSectionDataSet
|
||||
{
|
||||
public:
|
||||
|
||||
G4VCrossSectionRatio(const G4String& nam = "", G4int verb = 0);
|
||||
G4VCrossSectionRatio(const G4String& nam = "XSRatio", G4int verb = 0);
|
||||
|
||||
virtual ~G4VCrossSectionRatio();
|
||||
~G4VCrossSectionRatio() override;
|
||||
|
||||
virtual
|
||||
G4double ComputeRatio(const G4ParticleDefinition*,
|
||||
G4double kinEnergy,
|
||||
G4int /*Z*/, G4int /*A*/) = 0;
|
||||
|
||||
virtual
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
virtual
|
||||
void DumpPhysicsTable(const G4ParticleDefinition&);
|
||||
|
||||
virtual
|
||||
void Description() const;
|
||||
|
||||
inline void SetVerboseLevel(G4int value);
|
||||
|
||||
inline G4int GetVerboseLevel() const;
|
||||
|
||||
inline const G4String& GetName() const;
|
||||
|
||||
private:
|
||||
|
||||
G4VCrossSectionRatio & operator=(const G4VCrossSectionRatio &right);
|
||||
G4VCrossSectionRatio(const G4VCrossSectionRatio&);
|
||||
|
||||
G4int verboseLevel;
|
||||
const G4String name;
|
||||
};
|
||||
|
||||
inline void G4VCrossSectionRatio::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
}
|
||||
|
||||
inline G4int G4VCrossSectionRatio::GetVerboseLevel() const
|
||||
{
|
||||
return verboseLevel;
|
||||
}
|
||||
|
||||
inline const G4String& G4VCrossSectionRatio::GetName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,16 +57,19 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4CrossSectionDataStore::G4CrossSectionDataStore() :
|
||||
nDataSetList(0), verboseLevel(0),fastPathFlags(),fastPathParams(),
|
||||
counters(),fastPathCache()
|
||||
{
|
||||
nist = G4NistManager::Instance();
|
||||
currentMaterial = elmMaterial = nullptr;
|
||||
currentElement = nullptr; //ALB 14-Aug-2012 Coverity fix.
|
||||
matParticle = elmParticle = nullptr;
|
||||
matKinEnergy = elmKinEnergy = matCrossSection = elmCrossSection = 0.0;
|
||||
}
|
||||
G4CrossSectionDataStore::G4CrossSectionDataStore()
|
||||
: nist(G4NistManager::Instance())
|
||||
, currentMaterial(nullptr)
|
||||
, matParticle(nullptr)
|
||||
, matKinEnergy(0.0)
|
||||
, matCrossSection(0.0)
|
||||
, nDataSetList(0)
|
||||
, verboseLevel(0)
|
||||
, fastPathFlags()
|
||||
, fastPathParams()
|
||||
, counters()
|
||||
, fastPathCache()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -268,10 +271,10 @@ G4double
|
||||
G4CrossSectionDataStore::ComputeCrossSection(const G4DynamicParticle* part,
|
||||
const G4Material* mat)
|
||||
{
|
||||
if(mat == currentMaterial && part->GetDefinition() == matParticle
|
||||
&& part->GetKineticEnergy() == matKinEnergy) {
|
||||
if(part->GetKineticEnergy() == matKinEnergy && mat == currentMaterial &&
|
||||
part->GetDefinition() == matParticle)
|
||||
return matCrossSection;
|
||||
}
|
||||
|
||||
currentMaterial = mat;
|
||||
matParticle = part->GetDefinition();
|
||||
matKinEnergy = part->GetKineticEnergy();
|
||||
@@ -292,58 +295,36 @@ G4CrossSectionDataStore::ComputeCrossSection(const G4DynamicParticle* part,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
G4double
|
||||
G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* part,
|
||||
const G4Element* elm,
|
||||
const G4Material* mat)
|
||||
G4double G4CrossSectionDataStore::GetCrossSection(const G4DynamicParticle* part,
|
||||
const G4Element* elm,
|
||||
const G4Material* mat)
|
||||
{
|
||||
if(mat == elmMaterial && elm == currentElement &&
|
||||
part->GetDefinition() == elmParticle &&
|
||||
part->GetKineticEnergy() == elmKinEnergy)
|
||||
{ return elmCrossSection; }
|
||||
|
||||
elmMaterial = mat;
|
||||
currentElement = elm;
|
||||
elmParticle = part->GetDefinition();
|
||||
elmKinEnergy = part->GetKineticEnergy();
|
||||
elmCrossSection = 0.0;
|
||||
|
||||
G4int i = nDataSetList-1;
|
||||
G4int i = nDataSetList - 1;
|
||||
G4int Z = elm->GetZasInt();
|
||||
if (elm->GetNaturalAbundanceFlag() &&
|
||||
dataSetList[i]->IsElementApplicable(part, Z, mat)) {
|
||||
|
||||
if(elm->GetNaturalAbundanceFlag() &&
|
||||
dataSetList[i]->IsElementApplicable(part, Z, mat))
|
||||
{
|
||||
// element wise cross section
|
||||
elmCrossSection = dataSetList[i]->GetElementCrossSection(part, Z, mat);
|
||||
|
||||
//G4cout << "Element wise " << elmParticle->GetParticleName()
|
||||
// << " xsec(barn)= " << elmCrossSection/barn
|
||||
// << " E(MeV)= " << elmKinEnergy/MeV
|
||||
// << " Z= " << Z << " AbundFlag= " << elm->GetNaturalAbandancesFlag()
|
||||
// <<G4endl;
|
||||
|
||||
} else {
|
||||
// isotope wise cross section
|
||||
size_t nIso = elm->GetNumberOfIsotopes();
|
||||
|
||||
// user-defined isotope abundances
|
||||
const G4double* abundVector = elm->GetRelativeAbundanceVector();
|
||||
|
||||
for (size_t j=0; j<nIso; ++j) {
|
||||
if(abundVector[j] > 0.0) {
|
||||
const G4Isotope* iso = elm->GetIsotope(j);
|
||||
elmCrossSection += abundVector[j]*
|
||||
GetIsoCrossSection(part, Z, iso->GetN(), iso, elm, mat, i);
|
||||
//G4cout << "Isotope wise " << elmParticle->GetParticleName()
|
||||
// << " xsec(barn)= " << elmCrossSection/barn
|
||||
// << " E(MeV)= " << elmKinEnergy/MeV
|
||||
// << " Z= " << Z << " A= " << iso->GetN() << " j= " << j << G4endl;
|
||||
}
|
||||
}
|
||||
return dataSetList[i]->GetElementCrossSection(part, Z, mat);
|
||||
}
|
||||
//G4cout << " E(MeV)= " << elmKinEnergy/MeV
|
||||
// << "xsec(barn)= " << elmCrossSection/barn <<G4endl;
|
||||
return elmCrossSection;
|
||||
|
||||
// isotope wise cross section
|
||||
size_t nIso = elm->GetNumberOfIsotopes();
|
||||
|
||||
// user-defined isotope abundances
|
||||
const G4double* abundVector = elm->GetRelativeAbundanceVector();
|
||||
|
||||
G4double sigma = 0.0;
|
||||
|
||||
for(size_t j = 0; j < nIso; ++j)
|
||||
{
|
||||
const G4Isotope* iso = elm->GetIsotope(j);
|
||||
sigma += abundVector[j] *
|
||||
GetIsoCrossSection(part, Z, iso->GetN(), iso, elm, mat, i);
|
||||
}
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
|
||||
|
||||
@@ -91,8 +91,9 @@ void G4CrossSectionElastic::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
// often shared between the different types of ions (d, t, He3, alpha, and
|
||||
// genericIon) therefore we scale by Zmax - which is safely larger than the
|
||||
// number of nucleons of the heaviest nuclides.
|
||||
SetMaxKinEnergy( G4HadronicParameters::Instance()->GetMaxEnergy() *
|
||||
( std::abs( p.GetBaryonNumber() ) > 1 ? Zmax : 1 ) );
|
||||
G4int fact = (std::abs(p.GetBaryonNumber()) > 1 ||
|
||||
p.GetParticleName() == "GenericIon") ? Zmax : 1;
|
||||
SetMaxKinEnergy(G4HadronicParameters::Instance()->GetMaxEnergy() * fact);
|
||||
}
|
||||
|
||||
void G4CrossSectionElastic::DumpPhysicsTable(const G4ParticleDefinition& p)
|
||||
|
||||
@@ -91,8 +91,9 @@ void G4CrossSectionInelastic::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
// often shared between the different types of ions (d, t, He3, alpha, and
|
||||
// genericIon) therefore we scale by Zmax - which is safely larger than the
|
||||
// number of nucleons of the heaviest nuclides.
|
||||
SetMaxKinEnergy( G4HadronicParameters::Instance()->GetMaxEnergy() *
|
||||
( std::abs( p.GetBaryonNumber() ) > 1 ? Zmax : 1 ) );
|
||||
G4int fact = (std::abs(p.GetBaryonNumber()) > 1 ||
|
||||
p.GetParticleName() == "GenericIon") ? Zmax : 1;
|
||||
SetMaxKinEnergy(G4HadronicParameters::Instance()->GetMaxEnergy() * fact);
|
||||
}
|
||||
|
||||
void G4CrossSectionInelastic::DumpPhysicsTable(const G4ParticleDefinition& p)
|
||||
|
||||
@@ -73,7 +73,7 @@ G4GammaNuclearXS::G4GammaNuclearXS()
|
||||
// verboseLevel = 0;
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4GammaNuclearXS::G4GammaNuclearXS Initialise for Z < "
|
||||
<< MAXZEL << G4endl;
|
||||
<< MAXZGAMMAN << G4endl;
|
||||
}
|
||||
ggXsection = G4CrossSectionDataSetRegistry::Instance()->GetCrossSectionDataSet("PhotoNuclearXS");
|
||||
if(ggXsection == nullptr) ggXsection = new G4PhotoNuclearCrossSection();
|
||||
@@ -83,7 +83,7 @@ G4GammaNuclearXS::G4GammaNuclearXS()
|
||||
G4GammaNuclearXS::~G4GammaNuclearXS()
|
||||
{
|
||||
if(isMaster) {
|
||||
for(G4int i=0; i<MAXZEL; ++i) {
|
||||
for(G4int i=0; i<MAXZGAMMAN; ++i) {
|
||||
delete data[i];
|
||||
data[i] = nullptr;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ G4GammaNuclearXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
G4double xs = 0.0;
|
||||
G4double ekin = aParticle->GetKineticEnergy();
|
||||
|
||||
G4int Z = (ZZ >= MAXZEL) ? MAXZEL - 1 : ZZ;
|
||||
G4int Z = (ZZ >= MAXZGAMMAN) ? MAXZGAMMAN - 1 : ZZ;
|
||||
|
||||
auto pv = GetPhysicsVector(Z);
|
||||
if(pv == nullptr) { return xs; }
|
||||
@@ -217,7 +217,7 @@ G4GammaNuclearXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
auto elmVec = mat->GetElementVector();
|
||||
size_t numOfElem = mat->GetNumberOfElements();
|
||||
for (size_t ie = 0; ie < numOfElem; ++ie) {
|
||||
G4int Z = std::max(1,std::min(((*elmVec)[ie])->GetZasInt(), MAXZEL-1));
|
||||
G4int Z = std::max(1,std::min(((*elmVec)[ie])->GetZasInt(), MAXZGAMMAN-1));
|
||||
if(data[Z] == nullptr) { Initialise(Z); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "Randomize.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4IsotopeList.hh"
|
||||
#include "G4HadronicParameters.hh"
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
@@ -297,6 +298,9 @@ G4ParticleInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
return;
|
||||
}
|
||||
|
||||
G4int fact = (p.GetParticleName() == "proton") ? 1 : 256;
|
||||
SetMaxKinEnergy(G4HadronicParameters::Instance()->GetMaxEnergy() * fact);
|
||||
|
||||
if(data[index] == nullptr) {
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&particleInelasticXSMutex);
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
#include "G4HadronicParameters.hh"
|
||||
|
||||
G4VCrossSectionDataSet::G4VCrossSectionDataSet(const G4String& nam) :
|
||||
verboseLevel(0),minKinEnergy(0.0),
|
||||
verboseLevel(0),name(nam),minKinEnergy(0.0),
|
||||
maxKinEnergy(G4HadronicParameters::Instance()->GetMaxEnergy()),
|
||||
isForAllAtomsAndEnergies(false),name(nam)
|
||||
isForAllAtomsAndEnergies(false)
|
||||
{
|
||||
registry = G4CrossSectionDataSetRegistry::Instance();
|
||||
registry->Register(this);
|
||||
|
||||
@@ -37,23 +37,13 @@
|
||||
//
|
||||
|
||||
#include "G4VCrossSectionRatio.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
G4VCrossSectionRatio::G4VCrossSectionRatio(const G4String& nam, G4int verb)
|
||||
: verboseLevel(verb),name(nam)
|
||||
{}
|
||||
: G4VCrossSectionDataSet(nam)
|
||||
{
|
||||
SetVerboseLevel(verb);
|
||||
}
|
||||
|
||||
G4VCrossSectionRatio::~G4VCrossSectionRatio()
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::Description() const
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::BuildPhysicsTable(const G4ParticleDefinition&)
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::DumpPhysicsTable(const G4ParticleDefinition&)
|
||||
{}
|
||||
|
||||
@@ -14,6 +14,11 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
05 January 2021 Vladimir Ivanchenko (hadr-hpp-V10-06-13)
|
||||
--------------------------------------------------------
|
||||
- G4ParticleHPThermalScattering - add final state phi-rotation;
|
||||
fixed problems #2290 and #1856
|
||||
|
||||
05 November 2020 Alberto Ribon (hadr-hpp-V10-06-12)
|
||||
--------------------------------------------------
|
||||
- G4ParticleHPInelastic, G4ParticleHPInelasticData : improved error message
|
||||
|
||||
@@ -65,74 +65,19 @@ G4ParticleHPThermalScattering::G4ParticleHPThermalScattering()
|
||||
SetMaxEnergy( 4*eV );
|
||||
theXSection = new G4ParticleHPThermalScatteringData();
|
||||
|
||||
//sizeOfMaterialTable = G4Material::GetMaterialTable()->size();
|
||||
//buildPhysicsTable();
|
||||
nMaterial = 0;
|
||||
nElement = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
G4ParticleHPThermalScattering::~G4ParticleHPThermalScattering()
|
||||
{
|
||||
|
||||
/*
|
||||
for ( std::map < G4int , std::map < G4double , std::vector < E_isoAng* >* >* >::iterator it = incoherentFSs->begin() ; it != incoherentFSs->end() ; it++ )
|
||||
{
|
||||
std::map < G4double , std::vector < E_isoAng* >* >::iterator itt;
|
||||
for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
|
||||
{
|
||||
std::vector< E_isoAng* >::iterator ittt;
|
||||
for ( ittt = itt->second->begin(); ittt != itt->second->end() ; ittt++ )
|
||||
{
|
||||
delete *ittt;
|
||||
}
|
||||
delete itt->second;
|
||||
}
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
for ( std::map < G4int , std::map < G4double , std::vector < std::pair< G4double , G4double >* >* >* >::iterator it = coherentFSs->begin() ; it != coherentFSs->end() ; it++ )
|
||||
{
|
||||
std::map < G4double , std::vector < std::pair< G4double , G4double >* >* >::iterator itt;
|
||||
for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
|
||||
{
|
||||
std::vector < std::pair< G4double , G4double >* >::iterator ittt;
|
||||
for ( ittt = itt->second->begin(); ittt != itt->second->end() ; ittt++ )
|
||||
{
|
||||
delete *ittt;
|
||||
}
|
||||
delete itt->second;
|
||||
}
|
||||
delete it->second;
|
||||
}
|
||||
|
||||
for ( std::map < G4int , std::map < G4double , std::vector < E_P_E_isoAng* >* >* >::iterator it = inelasticFSs->begin() ; it != inelasticFSs->end() ; it++ )
|
||||
{
|
||||
std::map < G4double , std::vector < E_P_E_isoAng* >* >::iterator itt;
|
||||
for ( itt = it->second->begin() ; itt != it->second->end() ; itt++ )
|
||||
{
|
||||
std::vector < E_P_E_isoAng* >::iterator ittt;
|
||||
for ( ittt = itt->second->begin(); ittt != itt->second->end() ; ittt++ )
|
||||
{
|
||||
std::vector < E_isoAng* >::iterator it4;
|
||||
for ( it4 = (*ittt)->vE_isoAngle.begin() ; it4 != (*ittt)->vE_isoAngle.end() ; it4++ )
|
||||
{
|
||||
delete *it4;
|
||||
}
|
||||
delete *ittt;
|
||||
}
|
||||
delete itt->second;
|
||||
}
|
||||
delete it->second;
|
||||
}
|
||||
*/
|
||||
|
||||
delete theHPElastic;
|
||||
//TKDB 160506
|
||||
//delete theXSection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void G4ParticleHPThermalScattering::clearCurrentFSData() {
|
||||
|
||||
if ( incoherentFSs != NULL ) {
|
||||
@@ -392,20 +337,11 @@ E_isoAng* G4ParticleHPThermalScattering::readAnE_isoAng( std::istream* file )
|
||||
G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& aNucleus )
|
||||
{
|
||||
|
||||
/*
|
||||
//Trick for dynamically generated materials
|
||||
if ( sizeOfMaterialTable != G4Material::GetMaterialTable()->size() ) {
|
||||
sizeOfMaterialTable = G4Material::GetMaterialTable()->size();
|
||||
buildPhysicsTable();
|
||||
theXSection->BuildPhysicsTable( *aTrack.GetDefinition() );
|
||||
}
|
||||
*/
|
||||
// Select Element > Reaction >
|
||||
|
||||
const G4Material * theMaterial = aTrack.GetMaterial();
|
||||
G4double aTemp = theMaterial->GetTemperature();
|
||||
G4int n = theMaterial->GetNumberOfElements();
|
||||
//static const G4ElementTable* theElementTable = G4Element::GetElementTable();
|
||||
|
||||
G4bool findThermalElement = false;
|
||||
G4int ielement;
|
||||
@@ -521,10 +457,11 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
|
||||
|
||||
//set
|
||||
theParticleChange.SetEnergyChange( sE );
|
||||
theParticleChange.SetMomentumChange( 0.0 , std::sqrt ( 1 - mu*mu ) , mu );
|
||||
G4double phi = CLHEP::twopi*G4UniformRand();
|
||||
G4double sint= std::sqrt ( 1 - mu*mu );
|
||||
theParticleChange.SetMomentumChange( sint*std::cos(phi), sint*std::sin(phi), mu );
|
||||
|
||||
}
|
||||
//else if ( random <= ( inelastic + theXSection->GetCoherentCrossSection( dp , (*theElementTable)[ ielement ] , aTemp ) ) / total )
|
||||
else if ( random <= ( inelastic + theXSection->GetCoherentCrossSection( dp , theElement , theMaterial ) ) / total )
|
||||
{
|
||||
// Coherent Elastic
|
||||
@@ -582,7 +519,6 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
|
||||
std::vector< G4double > vp_T;
|
||||
|
||||
G4int n1 = pvE_p_TL->size();
|
||||
//G4int n2 = pvE_p_TH->size();
|
||||
|
||||
//171005 fix bug, contribution from H.N. TRAN@CEA
|
||||
for ( G4int i=0 ; i < n1 ; i++ )
|
||||
@@ -623,7 +559,9 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
|
||||
//G4cout << "E= " << E/eV << ", Ei= " << Ei << ", mu= " << mu << G4endl;
|
||||
|
||||
theParticleChange.SetEnergyChange( E );
|
||||
theParticleChange.SetMomentumChange( 0.0 , std::sqrt ( 1 - mu*mu ) , mu );
|
||||
G4double phi = CLHEP::twopi*G4UniformRand();
|
||||
G4double sint= std::sqrt ( 1 - mu*mu );
|
||||
theParticleChange.SetMomentumChange( sint*std::cos(phi), sint*std::sin(phi), mu );
|
||||
|
||||
}
|
||||
else
|
||||
@@ -693,7 +631,9 @@ G4HadFinalState* G4ParticleHPThermalScattering::ApplyYourself(const G4HadProject
|
||||
|
||||
// Set Final State
|
||||
theParticleChange.SetEnergyChange( aTrack.GetKineticEnergy() ); // No energy change in Elastic
|
||||
theParticleChange.SetMomentumChange( 0.0 , std::sqrt ( 1 - mu*mu ) , mu );
|
||||
G4double phi = CLHEP::twopi*G4UniformRand();
|
||||
G4double sint= std::sqrt ( 1 - mu*mu );
|
||||
theParticleChange.SetMomentumChange( sint*std::cos(phi), sint*std::sin(phi), mu );
|
||||
|
||||
}
|
||||
delete dp;
|
||||
|
||||
@@ -14,6 +14,15 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
29 January 2021 V.Ivanchenko (hadr-stopping-V10-06-03)
|
||||
--------------------------------------------------------------------
|
||||
- G4MuonicAtomDecay - fixed remaining Coverity warning, removed
|
||||
commented code
|
||||
|
||||
05 December 2020 V.Ivanchenko
|
||||
--------------------------------------------------------------------
|
||||
- G4MuonicAtomDecay - fixed Coverity warning, removed commented code
|
||||
|
||||
01 April 2020 V.Ivanchenko (hadr-stopping-V10-06-02)
|
||||
--------------------------------------------------------------------
|
||||
- G4MuonicAtomDecay - fixed Coverity warning
|
||||
|
||||
@@ -84,7 +84,6 @@ G4MuonicAtomDecay::G4MuonicAtomDecay(G4HadronicInteraction* hiptr,
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4MuonicAtomDecay::~G4MuonicAtomDecay()
|
||||
//{delete theTotalResult;}
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -176,7 +175,7 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
G4ForceCondition* condition = nullptr; // it is unused in the following call anyway
|
||||
G4double meanlife = GetMeanLifeTime(aTrack, condition);
|
||||
|
||||
G4HadFinalState* result = nullptr; // result before converting to G4VParticleChange*
|
||||
G4HadFinalState* result = nullptr; // result before converting to G4VParticleChange*
|
||||
// G4int nSecondaries = 0;
|
||||
// save track time and start from zero time
|
||||
// G4double time0 = aTrack.GetGlobalTime(); FillResult does it
|
||||
@@ -220,7 +219,7 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
G4VDecayChannel* decaychannel = nullptr;
|
||||
G4double massParent = aParticle->GetMass();
|
||||
decaychannel = decaytable->SelectADecayChannel(massParent);
|
||||
if ( decaychannel ==0) {
|
||||
if (decaychannel == nullptr) {
|
||||
// decay channel not found
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Can not determine decay channel for "
|
||||
@@ -256,17 +255,18 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
}
|
||||
#endif
|
||||
products = decaychannel->DecayIt(aParticle->GetMass());
|
||||
if(!products) {
|
||||
if(products == nullptr) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "No products are generated for "
|
||||
<< aParticleDef->GetParticleName();
|
||||
G4Exception("G4MuonicAtomDecay::DecayIt","DECAY003",FatalException,ed);
|
||||
return &theTotalResult;
|
||||
}
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
decaychannel->SetVerboseLevel(temp);
|
||||
}
|
||||
if (GetVerboseLevel()>2 && products) {
|
||||
if (GetVerboseLevel()>2) {
|
||||
if (! products->IsChecked() ) products->DumpInfo();
|
||||
}
|
||||
#endif
|
||||
@@ -304,11 +304,11 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
// PostStep case
|
||||
products->Boost( ParentEnergy, ParentDirection);
|
||||
}
|
||||
// G4ParticleChangeForDecay fParticleChangeForDecay; // is it equivalent to G4ParticleChange* theTotalResult;
|
||||
|
||||
//add products in theTotalResult
|
||||
G4int numberOfSecondaries = products->entries();
|
||||
G4int numberOfSecondaries = (nullptr != products) ? products->entries() : 0;
|
||||
theTotalResult.SetNumberOfSecondaries(numberOfSecondaries);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << "G4MuonicAtomDecay::DecayIt : Decay vertex :";
|
||||
@@ -414,7 +414,7 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
FatalException, ed);
|
||||
}
|
||||
// Loop checking, 06-Aug-2015, Vladimir Ivanchenko
|
||||
} while(!result);
|
||||
} while(result == nullptr);
|
||||
|
||||
// add delay time of capture (inter + intra)
|
||||
G4int nsec = result->GetNumberOfSecondaries();
|
||||
@@ -432,8 +432,6 @@ G4VParticleChange* G4MuonicAtomDecay::DecayIt(const G4Track& aTrack,
|
||||
|
||||
FillResult(result,aTrack);
|
||||
|
||||
// delete result;// causes bad free check fixme; move to the class members?
|
||||
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
return &theTotalResult;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user