Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BGGNucleonElasticXS.cc 78189 2013-12-04 16:34:08Z gcosmo $
|
||||
// $Id: G4BGGNucleonElasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -220,9 +220,8 @@ void G4BGGNucleonElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
fSAIDHighEnergyLimit = 3*GeV;
|
||||
}
|
||||
|
||||
G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(particle);
|
||||
G4ThreeVector mom(0.0,0.0,1.0);
|
||||
G4DynamicParticle dp(part, mom, fGlauberEnergy);
|
||||
G4DynamicParticle dp(particle, mom, fGlauberEnergy);
|
||||
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BGGNucleonInelasticXS.cc 76889 2013-11-18 13:01:55Z gcosmo $
|
||||
// $Id: G4BGGNucleonInelasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -153,7 +153,7 @@ G4BGGNucleonInelasticXS::GetElementCrossSection(const G4DynamicParticle* dp,
|
||||
<< " XS(b)= " << cross/barn
|
||||
<< G4endl;
|
||||
}
|
||||
if(cross <= fLowestXSection) { cross = 0.0; }
|
||||
//AR-18Dec2013 if(cross <= fLowestXSection) { cross = 0.0; }
|
||||
return cross;
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ G4BGGNucleonInelasticXS::GetIsoCrossSection(const G4DynamicParticle* dp,
|
||||
<< " XS(b)= " << cross/barn
|
||||
<< G4endl;
|
||||
}
|
||||
if(cross <= fLowestXSection) { cross = 0.0; }
|
||||
//AR-18Dec2013 if(cross <= fLowestXSection) { cross = 0.0; }
|
||||
return cross;
|
||||
}
|
||||
|
||||
@@ -227,9 +227,8 @@ void G4BGGNucleonInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
fHighEnergy = 2*GeV;
|
||||
}
|
||||
|
||||
G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(particle);
|
||||
G4ThreeVector mom(0.0,0.0,1.0);
|
||||
G4DynamicParticle dp(part, mom, fGlauberEnergy);
|
||||
G4DynamicParticle dp(particle, mom, fGlauberEnergy);
|
||||
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
G4int A;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BGGPionElasticXS.cc 66241 2012-12-13 18:34:42Z gunter $
|
||||
// $Id: G4BGGPionElasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -212,9 +212,8 @@ void G4BGGPionElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
fGlauber->BuildPhysicsTable(*particle);
|
||||
if(particle == G4PionPlus::PionPlus()) { isPiplus = true; }
|
||||
|
||||
G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(particle);
|
||||
G4ThreeVector mom(0.0,0.0,1.0);
|
||||
G4DynamicParticle dp(part, mom, fGlauberEnergy);
|
||||
G4DynamicParticle dp(particle, mom, fGlauberEnergy);
|
||||
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4BGGPionInelasticXS.cc 70848 2013-06-06 12:00:02Z gcosmo $
|
||||
// $Id: G4BGGPionInelasticXS.cc 79981 2014-03-27 15:24:11Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -206,9 +206,8 @@ void G4BGGPionInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
fGlauber->BuildPhysicsTable(*particle);
|
||||
if(particle == G4PionPlus::PionPlus()) { isPiplus = true; }
|
||||
|
||||
G4ParticleDefinition* part = const_cast<G4ParticleDefinition*>(particle);
|
||||
G4ThreeVector mom(0.0,0.0,1.0);
|
||||
G4DynamicParticle dp(part, mom, fGlauberEnergy);
|
||||
G4DynamicParticle dp(particle, mom, fGlauberEnergy);
|
||||
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsAntiBaryonElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsAntiBaryonElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsAntiBaryonElasticXS for pA elastic cross sections
|
||||
@@ -136,7 +136,7 @@ G4bool G4ChipsAntiBaryonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
|
||||
if(particle == G4AntiNeutron::AntiNeutron())
|
||||
{
|
||||
@@ -193,13 +193,6 @@ G4double G4ChipsAntiBaryonElasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsAntiBaryonElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool fCS = false;
|
||||
|
||||
G4double pEn=pMom;
|
||||
@@ -270,9 +263,6 @@ G4double G4ChipsAntiBaryonElasticXS::GetChipsCrossSection(G4double pMom, G4int t
|
||||
G4double G4ChipsAntiBaryonElasticXS::CalculateCrossSection(G4bool CS,G4int F,G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
@@ -405,7 +395,8 @@ G4double G4ChipsAntiBaryonElasticXS::GetPTables(G4double LP, G4double ILP, G4int
|
||||
1.e10,1.1,3.4e6,6.8e6,0.};
|
||||
// -15- -16- -17- -18- -19- -20- -21- -22- -23- -24-
|
||||
// -25- -26- -27- -28- -29-
|
||||
if(PDG>-3334 && PDG<-1111)
|
||||
//AR-24Jun2014 if(PDG>-3334 && PDG<-1111)
|
||||
if(PDG>-3335 && PDG<-1111)
|
||||
{
|
||||
// -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
|
||||
//p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
|
||||
|
||||
@@ -84,7 +84,7 @@ G4bool G4ChipsAntiBaryonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
|
||||
if(particle == G4AntiNeutron::AntiNeutron())
|
||||
{
|
||||
@@ -141,13 +141,6 @@ G4double G4ChipsAntiBaryonInelasticXS::GetIsoCrossSection(const G4DynamicParticl
|
||||
|
||||
G4double G4ChipsAntiBaryonInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int cPDG)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -359,12 +352,12 @@ G4double G4ChipsAntiBaryonInelasticXS::EquLinearFit(G4double X, G4int N, G4doubl
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsHyperonElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsHyperonElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsHyperonElasticXS for pA elastic cross sections
|
||||
@@ -140,7 +140,7 @@ G4bool G4ChipsHyperonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4i
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Lambda::Lambda())
|
||||
{
|
||||
return true;
|
||||
@@ -188,12 +188,6 @@ G4double G4ChipsHyperonElasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt
|
||||
|
||||
G4double G4ChipsHyperonElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool fCS = false;
|
||||
G4double pEn=pMom;
|
||||
@@ -265,9 +259,6 @@ G4double G4ChipsHyperonElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ,
|
||||
G4double G4ChipsHyperonElasticXS::CalculateCrossSection(G4bool CS,G4int F,G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
@@ -401,7 +392,8 @@ G4double G4ChipsHyperonElasticXS::GetPTables(G4double LP, G4double ILP, G4int PD
|
||||
1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
|
||||
// -15--16- -17- -18- -19- -20- -21- -22- -23- -24- -25-
|
||||
// -26- -27- -28- -29- -30- -31- -32-
|
||||
if(PDG!=3222 && PDG>3000 && PDG<3335)
|
||||
//AR-04Jun2014 if(PDG!=3222 && PDG>3000 && PDG<3335)
|
||||
if(PDG>3000 && PDG<3335)
|
||||
{
|
||||
// -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
|
||||
//p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
|
||||
@@ -637,8 +629,9 @@ G4double G4ChipsHyperonElasticXS::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
|
||||
static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
|
||||
static const G4double third=1./3.;
|
||||
static const G4double fifth=1./5.;
|
||||
static const G4double sevth=1./7.;
|
||||
if(PDG==3222 || PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl;
|
||||
static const G4double sevth=1./7.;
|
||||
//AR-04Jun2014 if(PDG==3222 || PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl;
|
||||
if(PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl;
|
||||
if(onlyCS)G4cout<<"*Warning*G4ChipsHyperonElasticXS::GetExchanT: onlyCS=1"<<G4endl;
|
||||
if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
|
||||
G4double q2=0.;
|
||||
@@ -745,7 +738,8 @@ G4double G4ChipsHyperonElasticXS::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
|
||||
static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
|
||||
if(onlyCS)G4cout<<"*Warning*G4ChipsHyperonElasticXS::GetSlope: onlCS=true"<<G4endl;
|
||||
if(lastLP<-4.3) return 0.; // S-wave for p<14 MeV/c (kinE<.1MeV)
|
||||
if(PDG==3222 || PDG<3000 || PDG>3334)
|
||||
//AR-04Jun2014 if(PDG==3222 || PDG<3000 || PDG>3334)
|
||||
if(PDG<3000 || PDG>3334)
|
||||
{
|
||||
// G4cout<<"*Error*G4ChipsHyperonElasticXS::GetSlope: PDG="<<PDG<<", Z="<<tgZ
|
||||
// <<", N="<<tgN<<", while it is defined only for Hyperons"<<G4endl;
|
||||
@@ -772,7 +766,8 @@ G4double G4ChipsHyperonElasticXS::GetHMaxT()
|
||||
G4double G4ChipsHyperonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
|
||||
G4int tgN)
|
||||
{
|
||||
if(PDG==3222 || PDG<3000 || PDG>3334) G4cout<<"*Warning*G4QHypElCS::GTV:P="<<PDG<<G4endl;
|
||||
//AR-04Jun2014 if(PDG==3222 || PDG<3000 || PDG>3334) G4cout<<"*Warning*G4QHypElCS::GTV:P="<<PDG<<G4endl;
|
||||
if(PDG<3000 || PDG>3334) G4cout<<"*Warning*G4QHypElCS::GTV:P="<<PDG<<G4endl;
|
||||
if(tgZ<0 || tgZ>92)
|
||||
{
|
||||
G4cout<<"*Warning*G4QHyperonElastCS::GetTabValue:(1-92) NoIsotopesFor Z="<<tgZ<<G4endl;
|
||||
|
||||
@@ -79,7 +79,7 @@ G4bool G4ChipsHyperonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Lambda::Lambda())
|
||||
{
|
||||
return true;
|
||||
@@ -127,13 +127,6 @@ G4double G4ChipsHyperonInelasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsHyperonInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int PDG)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -364,12 +357,12 @@ G4double G4ChipsHyperonInelasticXS::EquLinearFit(G4double X, G4int N, G4double X
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsKaonMinusElasticXS.cc 76889 2013-11-18 13:01:55Z gcosmo $
|
||||
// $Id: G4ChipsKaonMinusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsKaonMinusElasticXS for pA elastic cross sections
|
||||
@@ -159,7 +159,7 @@ G4bool G4ChipsKaonMinusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4KaonMinus::KaonMinus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -179,12 +179,6 @@ G4double G4ChipsKaonMinusElasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsKaonMinusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool fCS = false;
|
||||
|
||||
@@ -256,9 +250,6 @@ G4double G4ChipsKaonMinusElasticXS::GetChipsCrossSection(G4double pMom, G4int tg
|
||||
G4double G4ChipsKaonMinusElasticXS::CalculateCrossSection(G4bool CS, G4int F,
|
||||
G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
|
||||
@@ -92,7 +92,7 @@ G4bool G4ChipsKaonMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4KaonMinus::KaonMinus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -113,14 +113,6 @@ G4double G4ChipsKaonMinusInelasticXS::GetIsoCrossSection(const G4DynamicParticle
|
||||
|
||||
G4double G4ChipsKaonMinusInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
{
|
||||
@@ -334,12 +326,12 @@ G4double G4ChipsKaonMinusInelasticXS::EquLinearFit(G4double X, G4int N, G4double
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsKaonPlusElasticXS.cc 76889 2013-11-18 13:01:55Z gcosmo $
|
||||
// $Id: G4ChipsKaonPlusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsKaonPlusElasticXS for pA elastic cross sections
|
||||
@@ -161,7 +161,7 @@ G4bool G4ChipsKaonPlusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4KaonPlus::KaonPlus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -181,12 +181,6 @@ G4double G4ChipsKaonPlusElasticXS::GetIsoCrossSection(const G4DynamicParticle* P
|
||||
|
||||
G4double G4ChipsKaonPlusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool fCS = false;
|
||||
G4double pEn=pMom;
|
||||
@@ -257,9 +251,6 @@ G4double G4ChipsKaonPlusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ
|
||||
G4double G4ChipsKaonPlusElasticXS::CalculateCrossSection(G4bool CS, G4int F,
|
||||
G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
|
||||
@@ -109,7 +109,7 @@ G4bool G4ChipsKaonPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4KaonPlus::KaonPlus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -130,13 +130,6 @@ G4double G4ChipsKaonPlusInelasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsKaonPlusInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int )
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -382,12 +375,12 @@ G4double G4ChipsKaonPlusInelasticXS::EquLinearFit(G4double X, G4int N, G4double
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ G4bool G4ChipsKaonZeroElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
|
||||
if(particle == G4KaonZeroLong::KaonZeroLong() ||
|
||||
particle == G4KaonZeroShort::KaonZeroShort() ||
|
||||
|
||||
@@ -75,7 +75,7 @@ G4bool G4ChipsKaonZeroInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
|
||||
if(particle == G4KaonZeroLong::KaonZeroLong() ||
|
||||
particle == G4KaonZeroShort::KaonZeroShort() ||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsNeutronElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsNeutronElasticXS.cc 84714 2014-10-20 07:37:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsNeutronElasticXS for nA elastic cross sections
|
||||
@@ -52,6 +52,13 @@
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4ChipsNeutronElasticXS);
|
||||
|
||||
namespace {
|
||||
G4double mNeut;
|
||||
G4double mProt;
|
||||
G4double mNeut2;
|
||||
|
||||
}
|
||||
|
||||
G4ChipsNeutronElasticXS::G4ChipsNeutronElasticXS():G4VCrossSectionDataSet(Default_Name()), nPoints(128), nLast(nPoints-1)
|
||||
{
|
||||
lPMin=-8.; // Min tabulated log Momentum (D)
|
||||
@@ -90,6 +97,10 @@ G4ChipsNeutronElasticXS::G4ChipsNeutronElasticXS():G4VCrossSectionDataSet(Defaul
|
||||
lastTH=0.; // Last threshold momentum
|
||||
lastCS=0.; // Last value of the Cross Section
|
||||
lastI=0; // The last position in the DAMDB
|
||||
|
||||
mNeut= G4Neutron::Neutron()->GetPDGMass()*.001;// MeV to GeV
|
||||
mProt= G4Proton::Proton()->GetPDGMass()*.001;// MeV to GeV
|
||||
mNeut2= mNeut*mNeut;
|
||||
}
|
||||
|
||||
G4ChipsNeutronElasticXS::~G4ChipsNeutronElasticXS()
|
||||
@@ -134,7 +145,7 @@ G4bool G4ChipsNeutronElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4i
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Proton::Proton() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -154,12 +165,6 @@ G4double G4ChipsNeutronElasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4ChipsNeutronElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4double pEn=pMom;
|
||||
onlyCS=false;
|
||||
@@ -229,9 +234,7 @@ G4double G4ChipsNeutronElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ,
|
||||
G4double G4ChipsNeutronElasticXS::CalculateCrossSection(G4bool CS, G4int F,G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
@@ -2031,11 +2034,12 @@ G4double G4ChipsNeutronElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
|
||||
G4double p16=p8*p8;
|
||||
G4double dl=lp-5.;
|
||||
G4double a=tgZ+tgN;
|
||||
if(a<6.5)
|
||||
{
|
||||
G4double pah=std::pow(p,a/2);
|
||||
G4double pa=pah*pah;
|
||||
G4double pa2=pa*pa;
|
||||
if(a<6.5)
|
||||
{
|
||||
|
||||
theS1=lastPAR[15]/(1.+lastPAR[16]*p4*pa)+lastPAR[17]/(p4+lastPAR[18]*p4/pa2)+
|
||||
(lastPAR[19]*dl*dl+lastPAR[20])/(1.+lastPAR[21]/p2);
|
||||
theB1=(lastPAR[22]+lastPAR[23]*p2)/(p4+lastPAR[24]/pah)+lastPAR[25];
|
||||
@@ -2078,10 +2082,6 @@ G4double G4ChipsNeutronElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ
|
||||
G4double G4ChipsNeutronElasticXS::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
|
||||
G4double pP)
|
||||
{
|
||||
static const G4double mNeut= G4Neutron::Neutron()->GetPDGMass()*.001; // MeV to GeV
|
||||
static const G4double mProt= G4Proton::Proton()->GetPDGMass()*.001; // MeV to GeV
|
||||
|
||||
static const G4double mNeut2= mNeut*mNeut;
|
||||
|
||||
G4double pP2=pP*pP; // squared momentum of the projectile
|
||||
if(tgZ==0 && tgN==1)
|
||||
|
||||
@@ -79,7 +79,7 @@ G4bool G4ChipsNeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Neutron::Neutron() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -100,14 +100,6 @@ G4double G4ChipsNeutronInelasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4ChipsNeutronInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -1345,12 +1337,12 @@ G4double G4ChipsNeutronInelasticXS::EquLinearFit(G4double X, G4int N, G4double X
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsPionMinusElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsPionMinusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsPionMinusElasticXS for pA elastic cross sections
|
||||
@@ -135,7 +135,7 @@ G4bool G4ChipsPionMinusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4PionMinus::PionMinus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -155,12 +155,6 @@ G4double G4ChipsPionMinusElasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsPionMinusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4double pEn=pMom;
|
||||
G4bool fCS = false;
|
||||
@@ -231,9 +225,6 @@ G4double G4ChipsPionMinusElasticXS::GetChipsCrossSection(G4double pMom, G4int tg
|
||||
G4double G4ChipsPionMinusElasticXS::CalculateCrossSection(G4bool CS, G4int F,G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
|
||||
@@ -79,7 +79,7 @@ G4bool G4ChipsPionMinusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4PionMinus::PionMinus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -99,13 +99,6 @@ G4double G4ChipsPionMinusInelasticXS::GetIsoCrossSection(const G4DynamicParticle
|
||||
|
||||
G4double G4ChipsPionMinusInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -332,12 +325,12 @@ G4double G4ChipsPionMinusInelasticXS::EquLinearFit(G4double X, G4int N, G4double
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsPionPlusElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsPionPlusElasticXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsPionPlusElasticXS for pA elastic cross sections
|
||||
@@ -134,7 +134,7 @@ G4bool G4ChipsPionPlusElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4PionPlus::PionPlus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -155,13 +155,6 @@ G4double G4ChipsPionPlusElasticXS::GetIsoCrossSection(const G4DynamicParticle* P
|
||||
|
||||
G4double G4ChipsPionPlusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4double pEn=pMom;
|
||||
G4bool fCS = false;
|
||||
onlyCS=fCS;
|
||||
@@ -231,9 +224,6 @@ G4double G4ChipsPionPlusElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ
|
||||
G4double G4ChipsPionPlusElasticXS::CalculateCrossSection(G4bool CS, G4int F, G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
|
||||
@@ -78,7 +78,7 @@ G4bool G4ChipsPionPlusInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4PionPlus::PionPlus() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -99,13 +99,6 @@ G4double G4ChipsPionPlusInelasticXS::GetIsoCrossSection(const G4DynamicParticle*
|
||||
|
||||
G4double G4ChipsPionPlusInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -344,12 +337,12 @@ G4double G4ChipsPionPlusInelasticXS::EquLinearFit(G4double X, G4int N, G4double
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChipsProtonElasticXS.cc 70680 2013-06-04 07:51:03Z gcosmo $
|
||||
// $Id: G4ChipsProtonElasticXS.cc 84714 2014-10-20 07:37:24Z gcosmo $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4ChipsProtonElasticXS for pA elastic cross sections
|
||||
@@ -52,6 +52,10 @@
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4ChipsProtonElasticXS);
|
||||
|
||||
namespace {
|
||||
G4double mProt;
|
||||
G4double mProt2;
|
||||
}
|
||||
|
||||
G4ChipsProtonElasticXS::G4ChipsProtonElasticXS():G4VCrossSectionDataSet(Default_Name()), nPoints(128), nLast(nPoints-1)
|
||||
{
|
||||
@@ -92,6 +96,11 @@ G4ChipsProtonElasticXS::G4ChipsProtonElasticXS():G4VCrossSectionDataSet(Default_
|
||||
lastTH=0.; // Last threshold momentum
|
||||
lastCS=0.; // Last value of the Cross Section
|
||||
lastI=0; // The last position in the DAMDB
|
||||
|
||||
mProt= G4Proton::Proton()->GetPDGMass()*.001; // MeV to GeV
|
||||
mProt2= mProt*mProt;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +147,7 @@ G4bool G4ChipsProtonElasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4in
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Proton::Proton() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -160,12 +169,6 @@ G4double G4ChipsProtonElasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt,
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4ChipsProtonElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4double pEn=pMom;
|
||||
onlyCS=false;
|
||||
@@ -234,9 +237,6 @@ G4double G4ChipsProtonElasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ,
|
||||
G4double G4ChipsProtonElasticXS::CalculateCrossSection(G4bool CS, G4int F, G4int I,
|
||||
G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
|
||||
{
|
||||
// *** Begin of Associative Memory DB for acceleration of the cross section calculations
|
||||
static G4ThreadLocal std::vector <G4double> *PIN_G4MT_TLS_ = 0 ; if (!PIN_G4MT_TLS_) PIN_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &PIN = *PIN_G4MT_TLS_; // Vector of max initialized log(P) in the table
|
||||
// *** End of Static Definitions (Associative Memory Data Base) ***
|
||||
G4double pMom=pIU/GeV; // All calculations are in GeV
|
||||
onlyCS=CS; // Flag to calculate only CS (not Si/Bi)
|
||||
lastLP=std::log(pMom); // Make a logarithm of the momentum for calculation
|
||||
@@ -800,11 +800,12 @@ G4double G4ChipsProtonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
|
||||
//G4double p24=p16*p8;
|
||||
G4double dl=lp-5.;
|
||||
G4double a=tgZ+tgN;
|
||||
if(a<6.5)
|
||||
{
|
||||
G4double pah=std::pow(p,a/2);
|
||||
G4double pa=pah*pah;
|
||||
G4double pa2=pa*pa;
|
||||
if(a<6.5)
|
||||
{
|
||||
|
||||
theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
|
||||
(lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
|
||||
theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
|
||||
@@ -846,8 +847,6 @@ G4double G4ChipsProtonElasticXS::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
|
||||
G4double G4ChipsProtonElasticXS::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
|
||||
G4double pP)
|
||||
{
|
||||
static const G4double mProt= G4Proton::Proton()->GetPDGMass()*.001; // MeV to GeV
|
||||
static const G4double mProt2= mProt*mProt;
|
||||
|
||||
G4double pP2=pP*pP; // squared momentum of the projectile
|
||||
if(tgZ==1 && tgN==0)
|
||||
|
||||
@@ -68,21 +68,19 @@ G4ChipsProtonInelasticXS::G4ChipsProtonInelasticXS():G4VCrossSectionDataSet(Defa
|
||||
|
||||
G4ChipsProtonInelasticXS::~G4ChipsProtonInelasticXS()
|
||||
{
|
||||
/*
|
||||
G4int lens=LEN->size();
|
||||
for(G4int i=0; i<lens; ++i) delete[] (*LEN)[i];
|
||||
delete LEN;
|
||||
G4int hens=HEN->size();
|
||||
for(G4int i=0; i<hens; ++i) delete[] (*HEN)[i];
|
||||
delete HEN;
|
||||
*/
|
||||
}
|
||||
|
||||
G4bool G4ChipsProtonInelasticXS::IsIsoApplicable(const G4DynamicParticle* Pt, G4int, G4int,
|
||||
const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
const G4ParticleDefinition* particle = Pt->GetDefinition();
|
||||
if (particle == G4Proton::Proton() ) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -103,13 +101,6 @@ G4double G4ChipsProtonInelasticXS::GetIsoCrossSection(const G4DynamicParticle* P
|
||||
|
||||
G4double G4ChipsProtonInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int)
|
||||
{
|
||||
static G4ThreadLocal G4int j; // A#0f Z/N-records already tested in AMDB
|
||||
static G4ThreadLocal std::vector <G4int> *colN_G4MT_TLS_ = 0 ; if (!colN_G4MT_TLS_) colN_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colN = *colN_G4MT_TLS_; // Vector of N for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4int> *colZ_G4MT_TLS_ = 0 ; if (!colZ_G4MT_TLS_) colZ_G4MT_TLS_ = new std::vector <G4int> ; std::vector <G4int> &colZ = *colZ_G4MT_TLS_; // Vector of Z for calculated nuclei (isotops)
|
||||
static G4ThreadLocal std::vector <G4double> *colP_G4MT_TLS_ = 0 ; if (!colP_G4MT_TLS_) colP_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colP = *colP_G4MT_TLS_; // Vector of last momenta for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colTH_G4MT_TLS_ = 0 ; if (!colTH_G4MT_TLS_) colTH_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colTH = *colTH_G4MT_TLS_; // Vector of energy thresholds for the reaction
|
||||
static G4ThreadLocal std::vector <G4double> *colCS_G4MT_TLS_ = 0 ; if (!colCS_G4MT_TLS_) colCS_G4MT_TLS_ = new std::vector <G4double> ; std::vector <G4double> &colCS = *colCS_G4MT_TLS_; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ) // The nucleus was not the last used isotope
|
||||
@@ -440,12 +431,12 @@ G4double G4ChipsProtonInelasticXS::EquLinearFit(G4double X, G4int N, G4double X0
|
||||
|
||||
G4int N2=N-2;
|
||||
G4double d=(X-X0)/DX;
|
||||
G4int j=static_cast<int>(d);
|
||||
if (j<0) j=0;
|
||||
else if(j>N2) j=N2;
|
||||
d-=j; // excess
|
||||
G4double yi=Y[j];
|
||||
G4double sigma=yi+(Y[j+1]-yi)*d;
|
||||
G4int jj=static_cast<int>(d);
|
||||
if (jj<0) jj=0;
|
||||
else if(jj>N2) jj=N2;
|
||||
d-=jj; // excess
|
||||
G4double yi=Y[jj];
|
||||
G4double sigma=yi+(Y[jj+1]-yi)*d;
|
||||
|
||||
return sigma;
|
||||
}
|
||||
|
||||
@@ -1113,7 +1113,7 @@ G4double
|
||||
G4ComponentGGHadronNucleusXsc::GetHNinelasticXsc(const G4DynamicParticle* aParticle,
|
||||
G4int At, G4int Zt)
|
||||
{
|
||||
G4ParticleDefinition* hadron = aParticle->GetDefinition();
|
||||
const G4ParticleDefinition* hadron = aParticle->GetDefinition();
|
||||
G4double sumInelastic;
|
||||
G4int Nt = At - Zt;
|
||||
if(Nt < 0) Nt = 0;
|
||||
|
||||
@@ -474,9 +474,9 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXsc(const G4DynamicParticle* aParticle
|
||||
// At = number of nucleons, Zt = number of protons
|
||||
|
||||
G4double
|
||||
G4ComponentGGNuclNuclXsc::GetHadronNucleonXscPDG(G4ParticleDefinition* pParticle,
|
||||
G4ComponentGGNuclNuclXsc::GetHadronNucleonXscPDG(const G4ParticleDefinition* pParticle,
|
||||
G4double sMand,
|
||||
G4ParticleDefinition* tParticle)
|
||||
const G4ParticleDefinition* tParticle)
|
||||
{
|
||||
G4double xsection = 0.;
|
||||
// G4bool pORn = (tParticle == theProton || nucleon == theNeutron );
|
||||
@@ -531,9 +531,9 @@ G4ComponentGGNuclNuclXsc::GetHadronNucleonXscPDG(G4ParticleDefinition* pParticle
|
||||
// projectile nucleon is pParticle with pTkin shooting target nucleon tParticle
|
||||
|
||||
G4double
|
||||
G4ComponentGGNuclNuclXsc::GetHadronNucleonXscNS(G4ParticleDefinition* pParticle,
|
||||
G4ComponentGGNuclNuclXsc::GetHadronNucleonXscNS(const G4ParticleDefinition* pParticle,
|
||||
G4double pTkin,
|
||||
G4ParticleDefinition* tParticle)
|
||||
const G4ParticleDefinition* tParticle)
|
||||
{
|
||||
G4double xsection(0);
|
||||
// G4double Delta; DHW 19 May 2011: variable set but not used
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ComponentSAIDTotalXS.cc 76889 2013-11-18 13:01:55Z gcosmo $
|
||||
// $Id: G4ComponentSAIDTotalXS.cc 83409 2014-08-21 15:16:07Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -58,7 +58,6 @@ G4ComponentSAIDTotalXS::G4ComponentSAIDTotalXS()
|
||||
|
||||
G4ComponentSAIDTotalXS::~G4ComponentSAIDTotalXS()
|
||||
{
|
||||
/*
|
||||
for(G4int i=0; i<numberOfSaidXS; ++i) {
|
||||
if(elastdata[i]) {
|
||||
delete elastdata[i];
|
||||
@@ -69,7 +68,6 @@ G4ComponentSAIDTotalXS::~G4ComponentSAIDTotalXS()
|
||||
inelastdata[i] = 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
G4double
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4CrossSectionDataSetRegistry.cc 73791 2013-09-12 07:55:48Z gcosmo $
|
||||
// $Id: G4CrossSectionDataSetRegistry.cc 83697 2014-09-10 07:15:29Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -70,6 +70,10 @@ G4_REFERENCE_XS_FACTORY(G4GlauberGribovCrossSection);
|
||||
G4_REFERENCE_XS_FACTORY(G4GGNuclNuclCrossSection);
|
||||
G4_REFERENCE_XS_FACTORY(G4ElectroNuclearCrossSection);
|
||||
G4_REFERENCE_XS_FACTORY(G4PhotoNuclearCrossSection);
|
||||
G4_REFERENCE_XS_FACTORY(G4PiNuclearCrossSection);
|
||||
G4_REFERENCE_XS_FACTORY(G4NeutronInelasticXS);
|
||||
G4_REFERENCE_XS_FACTORY(G4NeutronElasticXS);
|
||||
G4_REFERENCE_XS_FACTORY(G4NeutronCaptureXS);
|
||||
|
||||
|
||||
G4ThreadLocal G4CrossSectionDataSetRegistry* G4CrossSectionDataSetRegistry::theInstance = 0;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4CrossSectionDataStore.cc 68720 2013-04-05 09:18:58Z gcosmo $
|
||||
// $Id: G4CrossSectionDataStore.cc 78442 2013-12-18 15:04:33Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -241,9 +241,6 @@ G4CrossSectionDataStore::SampleZandA(const G4DynamicParticle* part,
|
||||
|
||||
G4double cross = GetCrossSection(part, mat);
|
||||
|
||||
// zero cross section case
|
||||
if(0.0 >= cross) { return anElement; }
|
||||
|
||||
// select element from a compound
|
||||
if(1 < nElements) {
|
||||
cross *= G4UniformRand();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4CrossSectionPairGG.cc 66241 2012-12-13 18:34:42Z gunter $
|
||||
// $Id: G4CrossSectionPairGG.cc 79981 2014-03-27 15:24:11Z gcosmo $
|
||||
// $ GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// Class G4CrossSectionPairGG
|
||||
@@ -96,7 +96,7 @@ G4double G4CrossSectionPairGG::GetElementCrossSection(
|
||||
} else {
|
||||
|
||||
std::vector<ParticleXScale>::iterator iter = scale_factors.begin();
|
||||
G4ParticleDefinition * pDef = aParticle->GetDefinition();
|
||||
const G4ParticleDefinition * pDef = aParticle->GetDefinition();
|
||||
while (iter != scale_factors.end() && (*iter).first != pDef)
|
||||
{
|
||||
++iter;
|
||||
@@ -133,7 +133,7 @@ void G4CrossSectionPairGG::BuildPhysicsTable(const G4ParticleDefinition& pDef) {
|
||||
<< theLowX->GetName() << " " << theHighX->GetName() << G4endl;
|
||||
}
|
||||
|
||||
G4ParticleDefinition * myDef = const_cast<G4ParticleDefinition*>(&pDef);
|
||||
const G4ParticleDefinition * myDef = &pDef;
|
||||
std::vector<ParticleXScale>::iterator iter;
|
||||
iter = scale_factors.begin();
|
||||
while (iter != scale_factors.end() && (*iter).first != myDef) {
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DiffElasticRatio.cc 66241 2012-12-13 18:34:42Z gunter $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
//
|
||||
// File name: G4DiffElasticRatio
|
||||
//
|
||||
// Author: V.Grichine 07.10.2014
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
|
||||
#include "G4DiffElasticRatio.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4DiffElasticRatio.hh"
|
||||
#include "G4ComponentGGHadronNucleusXsc.hh"
|
||||
|
||||
G4DiffElasticRatio::G4DiffElasticRatio(const G4String& nam, G4int verb)
|
||||
: G4VCrossSectionRatio( nam, verb)
|
||||
{
|
||||
fGGXsc = new G4ComponentGGHadronNucleusXsc();
|
||||
}
|
||||
|
||||
G4DiffElasticRatio::~G4DiffElasticRatio()
|
||||
{
|
||||
if(fGGXsc) delete fGGXsc;
|
||||
}
|
||||
|
||||
|
||||
G4double G4DiffElasticRatio::ComputeRatio(const G4ParticleDefinition* theParticleDefinition,
|
||||
G4double kinEnergy,
|
||||
G4int Z, G4int A)
|
||||
{
|
||||
G4double ratio=0.;
|
||||
G4double ggElXsc = fGGXsc->GetElasticElementCrossSection(theParticleDefinition,kinEnergy,
|
||||
Z,A);
|
||||
G4double ggsdXsc = fGGXsc->GetDiffractionGlauberGribovXsc();
|
||||
|
||||
if( ggElXsc > 0.) ratio = ggsdXsc/ggElXsc;
|
||||
else ratio = 0;
|
||||
|
||||
return ratio;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ G4double G4EMDissociationCrossSection::GetElementCrossSection
|
||||
// Get relevant information about the projectile and target (A, Z) and
|
||||
// velocity of the projectile.
|
||||
//
|
||||
G4ParticleDefinition *definitionP = theDynamicParticle->GetDefinition();
|
||||
const G4ParticleDefinition *definitionP = theDynamicParticle->GetDefinition();
|
||||
G4double AP = definitionP->GetBaryonNumber();
|
||||
G4double ZP = definitionP->GetPDGCharge();
|
||||
G4double b = theDynamicParticle->Get4Momentum().beta();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4ElectroNuclearCrossSection.cc 73758 2013-09-10 12:47:00Z gcosmo $
|
||||
// $Id: G4ElectroNuclearCrossSection.cc 81105 2014-05-21 08:03:54Z gcosmo $
|
||||
//
|
||||
// G4 Physics class: G4ElectroNuclearCrossSection for gamma+A cross sections
|
||||
// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
|
||||
@@ -2197,39 +2197,39 @@ G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection()
|
||||
std::vector<cacheEl_t*>::iterator it = cache.begin();
|
||||
while ( it != cache.end() )
|
||||
{
|
||||
delete[] (*it)->J1; (*it)->J1 = 0;
|
||||
delete[] (*it)->J2; (*it)->J2 = 0;
|
||||
delete[] (*it)->J3; (*it)->J3 = 0;
|
||||
if ( *it ) {
|
||||
delete[] (*it)->J1; (*it)->J1 = 0;
|
||||
delete[] (*it)->J2; (*it)->J2 = 0;
|
||||
delete[] (*it)->J3; (*it)->J3 = 0;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lE)
|
||||
G4double G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lE)
|
||||
{
|
||||
return ha*(lE*lE-lEMa2)-ab*(lE-lEMa)-cd*(std::exp(-reg*lE)-ele);
|
||||
}
|
||||
|
||||
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lE, G4double E)
|
||||
G4double G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lE, G4double E)
|
||||
{
|
||||
return poc*((lE-1.)*E-le1)-ab*(E-EMa)+cd1*(std::exp(d1*lE)-ele1);
|
||||
}
|
||||
|
||||
inline G4double G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lE, G4double E2)
|
||||
G4double G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lE, G4double E2)
|
||||
{
|
||||
return ha*((lE-.5)*E2-leh)-hab*(E2-EMa2)+cd2*(std::exp(d2*lE)-ele2);
|
||||
}
|
||||
|
||||
inline G4double
|
||||
G4ElectroNuclearCrossSection::DFun(G4double x)
|
||||
G4double G4ElectroNuclearCrossSection::DFun(G4double x)
|
||||
{
|
||||
G4double y=std::exp(x-lastG-lmel); // y for the x
|
||||
G4double flux=lastG*(2.-y*(2.-y))-1.; // flux factor
|
||||
return (poc*(x-pos)+shd*std::exp(-reg*x))*flux;
|
||||
}
|
||||
|
||||
inline G4double
|
||||
G4ElectroNuclearCrossSection::Fun(G4double x)
|
||||
G4double G4ElectroNuclearCrossSection::Fun(G4double x)
|
||||
{
|
||||
// Integrated PhoNuc cross section
|
||||
G4double dlg1=lastG+lastG-1.;
|
||||
|
||||
@@ -391,9 +391,9 @@ G4GGNuclNuclCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle
|
||||
// At = number of nucleons, Zt = number of protons
|
||||
|
||||
G4double
|
||||
G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(G4ParticleDefinition* pParticle,
|
||||
G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(const G4ParticleDefinition* pParticle,
|
||||
G4double sMand,
|
||||
G4ParticleDefinition* tParticle)
|
||||
const G4ParticleDefinition* tParticle)
|
||||
{
|
||||
G4double xsection = 0.;
|
||||
// G4bool pORn = (tParticle == theProton || nucleon == theNeutron );
|
||||
@@ -448,9 +448,9 @@ G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(G4ParticleDefinition* pParticle
|
||||
// projectile nucleon is pParticle with pTkin shooting target nucleon tParticle
|
||||
|
||||
G4double
|
||||
G4GGNuclNuclCrossSection::GetHadronNucleonXscNS(G4ParticleDefinition* pParticle,
|
||||
G4GGNuclNuclCrossSection::GetHadronNucleonXscNS(const G4ParticleDefinition* pParticle,
|
||||
G4double pTkin,
|
||||
G4ParticleDefinition* tParticle)
|
||||
const G4ParticleDefinition* tParticle)
|
||||
{
|
||||
G4double xsection(0);
|
||||
// G4double Delta; DHW 19 May 2011: variable set but not used
|
||||
|
||||
@@ -1153,7 +1153,7 @@ G4double
|
||||
G4GlauberGribovCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle,
|
||||
G4int At, G4int Zt)
|
||||
{
|
||||
G4ParticleDefinition* hadron = aParticle->GetDefinition();
|
||||
const G4ParticleDefinition* hadron = aParticle->GetDefinition();
|
||||
G4double sumInelastic;
|
||||
G4int Nt = At - Zt;
|
||||
if(Nt < 0) Nt = 0;
|
||||
|
||||
@@ -40,23 +40,30 @@
|
||||
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4MuonMinus.hh"
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4NucleiProperties.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4Log.hh"
|
||||
#include "G4Exp.hh"
|
||||
|
||||
G4PhysicsVector* G4KokoulinMuonNuclearXS::theCrossSection[] = {0};
|
||||
|
||||
G4KokoulinMuonNuclearXS::G4KokoulinMuonNuclearXS()
|
||||
:G4VCrossSectionDataSet("KokoulinMuonNuclearXS"), theCrossSectionTable(0),
|
||||
:G4VCrossSectionDataSet("KokoulinMuonNuclearXS"),
|
||||
LowestKineticEnergy(1*GeV), HighestKineticEnergy(1*PeV),
|
||||
TotBin(60), CutFixed(0.2*GeV)
|
||||
{
|
||||
BuildCrossSectionTable();
|
||||
}
|
||||
TotBin(60), CutFixed(0.2*GeV), isInitialized(false), isMaster(false)
|
||||
{}
|
||||
|
||||
G4KokoulinMuonNuclearXS::~G4KokoulinMuonNuclearXS()
|
||||
{
|
||||
if (theCrossSectionTable) {
|
||||
theCrossSectionTable->clearAndDestroy();
|
||||
delete theCrossSectionTable;
|
||||
if (isMaster) {
|
||||
for(G4int i=0; i<MAXZMUN; ++i) {
|
||||
delete theCrossSection[i];
|
||||
theCrossSection[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,93 +74,89 @@ G4KokoulinMuonNuclearXS::IsElementApplicable(const G4DynamicParticle*,
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
G4KokoulinMuonNuclearXS::BuildPhysicsTable(const G4ParticleDefinition&)
|
||||
{
|
||||
if(!isInitialized) {
|
||||
isMaster = true;
|
||||
isInitialized = true;
|
||||
}
|
||||
if(isMaster) { BuildCrossSectionTable(); }
|
||||
}
|
||||
|
||||
void G4KokoulinMuonNuclearXS::BuildCrossSectionTable()
|
||||
{
|
||||
G4double lowEdgeEnergy;
|
||||
G4PhysicsLogVector* ptrVector;
|
||||
G4double energy, A, Value;
|
||||
G4int Z;
|
||||
|
||||
G4int nEl = G4Element::GetNumberOfElements();
|
||||
const G4ElementTable* theElementTable = G4Element::GetElementTable();
|
||||
|
||||
theCrossSectionTable = new G4PhysicsTable(nEl);
|
||||
|
||||
G4double AtomicNumber;
|
||||
G4double AtomicWeight;
|
||||
G4double Value;
|
||||
G4NistManager* nistManager = G4NistManager::Instance();
|
||||
|
||||
for (G4int j = 0; j < nEl; j++) {
|
||||
ptrVector = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy, TotBin);
|
||||
AtomicNumber = (*theElementTable)[j]->GetZ();
|
||||
AtomicWeight = (*theElementTable)[j]->GetA();
|
||||
|
||||
for (G4int i = 0; i <= TotBin; ++i) {
|
||||
lowEdgeEnergy = ptrVector->Energy(i);
|
||||
Value = ComputeMicroscopicCrossSection(lowEdgeEnergy,
|
||||
AtomicNumber, AtomicWeight);
|
||||
ptrVector->PutValue(i,Value);
|
||||
Z = G4lrint((*theElementTable)[j]->GetZ());
|
||||
A = nistManager->GetAtomicMassAmu(Z);
|
||||
if(Z < MAXZMUN && !theCrossSection[Z]) {
|
||||
theCrossSection[Z] = new G4PhysicsLogVector(LowestKineticEnergy,
|
||||
HighestKineticEnergy,
|
||||
TotBin);
|
||||
for (G4int i = 0; i <= TotBin; ++i) {
|
||||
energy = theCrossSection[Z]->Energy(i);
|
||||
Value = ComputeMicroscopicCrossSection(energy, A);
|
||||
theCrossSection[Z]->PutValue(i,Value);
|
||||
}
|
||||
}
|
||||
|
||||
theCrossSectionTable->insertAt(j, ptrVector);
|
||||
}
|
||||
|
||||
// Build (Z,element) look-up table (for use in GetZandACrossSection)
|
||||
for (G4int j = 0; j < nEl; j++) {
|
||||
G4int ZZ = G4int((*theElementTable)[j]->GetZ());
|
||||
zelMap[ZZ] = j;
|
||||
}
|
||||
}
|
||||
|
||||
G4double G4KokoulinMuonNuclearXS::
|
||||
ComputeMicroscopicCrossSection(G4double KineticEnergy,
|
||||
G4double AtomicNumber, G4double AtomicWeight)
|
||||
ComputeMicroscopicCrossSection(G4double KineticEnergy, G4double A)
|
||||
{
|
||||
// Calculate cross section (differential in muon incident kinetic energy) by
|
||||
// integrating the double differential cross section over the energy loss
|
||||
|
||||
static const G4double xgi[] = {0.0199,0.1017,0.2372,0.4083,0.5917,0.7628,0.8983,0.9801};
|
||||
static const G4double wgi[] = {0.0506,0.1112,0.1569,0.1813,0.1813,0.1569,0.1112,0.0506};
|
||||
static const G4double xgi[] =
|
||||
{0.0199,0.1017,0.2372,0.4083,0.5917,0.7628,0.8983,0.9801};
|
||||
static const G4double wgi[] =
|
||||
{0.0506,0.1112,0.1569,0.1813,0.1813,0.1569,0.1112,0.0506};
|
||||
static const G4double ak1 = 6.9;
|
||||
static const G4double ak2 = 1.0;
|
||||
|
||||
G4double Mass = G4MuonMinus::MuonMinus()->GetPDGMass();
|
||||
|
||||
G4double CrossSection = 0.0;
|
||||
if (AtomicNumber < 1.) return CrossSection;
|
||||
if (KineticEnergy <= CutFixed) return CrossSection;
|
||||
|
||||
G4double epmin = CutFixed;
|
||||
G4double epmax = KineticEnergy + Mass - 0.5*proton_mass_c2;
|
||||
if (epmax <= epmin) return CrossSection; // NaN bug correction
|
||||
|
||||
G4double aaa = std::log(epmin) ;
|
||||
G4double bbb = std::log(epmax) ;
|
||||
G4int kkk = G4int((bbb-aaa)/ak1 +ak2) ;
|
||||
G4double aaa = G4Log(epmin);
|
||||
G4double bbb = G4Log(epmax);
|
||||
G4int kkk = std::max(1,G4int((bbb-aaa)/ak1 +ak2));
|
||||
G4double hhh = (bbb-aaa)/kkk ;
|
||||
G4double epln;
|
||||
G4double ep;
|
||||
G4double x;
|
||||
|
||||
for (G4int l = 0; l < kkk; l++) {
|
||||
for (G4int l = 0; l < kkk; ++l) {
|
||||
x = aaa + hhh*l;
|
||||
for (G4int ll = 0; ll < 8; ll++) {
|
||||
for (G4int ll = 0; ll < 8; ++ll) {
|
||||
epln=x+xgi[ll]*hhh;
|
||||
ep = std::exp(epln);
|
||||
CrossSection += ep*wgi[ll]*ComputeDDMicroscopicCrossSection(KineticEnergy,
|
||||
AtomicNumber, AtomicWeight, ep);
|
||||
ep = G4Exp(epln);
|
||||
CrossSection +=
|
||||
ep*wgi[ll]*ComputeDDMicroscopicCrossSection(KineticEnergy, 0, A, ep);
|
||||
}
|
||||
}
|
||||
|
||||
CrossSection *= hhh ;
|
||||
if (CrossSection < 0.) CrossSection = 0.;
|
||||
if (CrossSection < 0.) { CrossSection = 0.; }
|
||||
return CrossSection;
|
||||
}
|
||||
|
||||
G4double G4KokoulinMuonNuclearXS::
|
||||
ComputeDDMicroscopicCrossSection(G4double KineticEnergy,
|
||||
G4double, G4double AtomicWeight,
|
||||
G4double epsilon)
|
||||
ComputeDDMicroscopicCrossSection(G4double KineticEnergy, G4double,
|
||||
G4double A, G4double epsilon)
|
||||
{
|
||||
// Calculate the double-differential microscopic cross section (in muon
|
||||
// incident kinetic energy and energy loss) using the cross section formula
|
||||
@@ -169,12 +172,11 @@ ComputeDDMicroscopicCrossSection(G4double KineticEnergy,
|
||||
G4double DCrossSection = 0.;
|
||||
|
||||
if ((epsilon >= TotalEnergy - 0.5*proton_mass_c2) ||
|
||||
(epsilon <= CutFixed) ) return DCrossSection;
|
||||
(epsilon <= CutFixed) ) { return DCrossSection; }
|
||||
|
||||
G4double ep = epsilon/GeV;
|
||||
G4double a = AtomicWeight/(g/mole);
|
||||
G4double aeff = 0.22*a+0.78*std::exp(0.89*std::log(a)); //shadowing
|
||||
G4double sigph = (49.2+11.1*std::log(ep)+151.8/std::sqrt(ep))*microbarn;
|
||||
G4double aeff = 0.22*A+0.78*G4Exp(0.89*G4Log(A)); //shadowing
|
||||
G4double sigph = (49.2+11.1*G4Log(ep)+151.8/std::sqrt(ep))*microbarn;
|
||||
|
||||
G4double v = epsilon/TotalEnergy;
|
||||
G4double v1 = 1.-v;
|
||||
@@ -185,17 +187,16 @@ ComputeDDMicroscopicCrossSection(G4double KineticEnergy,
|
||||
G4double down = 1.+epsilon/alam*(1.+alam/(2.*proton_mass_c2)+epsilon/alam);
|
||||
|
||||
DCrossSection = coeffn*aeff*sigph/epsilon*
|
||||
(-v1+(v1+0.5*v2*(1.+2.*mass2/alam2))*std::log(up/down));
|
||||
(-v1+(v1+0.5*v2*(1.+2.*mass2/alam2))*G4Log(up/down));
|
||||
|
||||
if (DCrossSection < 0.) DCrossSection = 0.;
|
||||
if (DCrossSection < 0.) { DCrossSection = 0.; }
|
||||
return DCrossSection;
|
||||
}
|
||||
|
||||
G4double G4KokoulinMuonNuclearXS::
|
||||
GetElementCrossSection(const G4DynamicParticle* aPart,
|
||||
G4int ZZ, const G4Material*)
|
||||
G4int Z, const G4Material*)
|
||||
{
|
||||
G4int j = zelMap[ZZ];
|
||||
return (*theCrossSectionTable)[j]->Value(aPart->GetKineticEnergy());
|
||||
return theCrossSection[Z]->Value(aPart->GetKineticEnergy());
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NeutronCaptureXS.cc 71324 2013-06-13 16:58:55Z gcosmo $
|
||||
// $Id: G4NeutronCaptureXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -49,33 +49,42 @@
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
// factory
|
||||
#include "G4CrossSectionFactory.hh"
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4NeutronCaptureXS);
|
||||
|
||||
using namespace std;
|
||||
|
||||
const G4int G4NeutronCaptureXS::amin[] = {0,
|
||||
0, 0, 6, 0,10,12,14,16, 0, 0, //1-10
|
||||
0, 0, 0,28, 0, 0, 0,36, 0,40, //11-20
|
||||
0, 0, 0, 0, 0,54, 0,58,63,64, //21-30
|
||||
0,70, 0, 0, 0, 0, 0, 0, 0,90, //31-40
|
||||
0, 0, 0, 0, 0, 0,107,106, 0,112, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,180, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,204, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,235};
|
||||
const G4int G4NeutronCaptureXS::amax[] = {0,
|
||||
0, 0, 7, 0,11,13,15,18, 0, 0, //1-10
|
||||
0, 0, 0,30, 0, 0, 0,40, 0,48, //11-20
|
||||
0, 0, 0, 0, 0,58, 0,64,65,70, //21-30
|
||||
0,76, 0, 0, 0, 0, 0, 0, 0,96, //31-40
|
||||
0, 0, 0, 0, 0, 0,109,116, 0,124, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,186, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,208, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,238};
|
||||
const G4int G4NeutronCaptureXS::amin[] = {
|
||||
0,
|
||||
0, 0, 6, 0,10,12,14,16, 0, 0, //1-10
|
||||
0, 0, 0,28, 0, 0, 0,36, 0,40, //11-20
|
||||
0, 0, 0, 0, 0,54, 0,58,63,64, //21-30
|
||||
0,70, 0, 0, 0, 0, 0, 0, 0,90, //31-40
|
||||
0, 0, 0, 0, 0, 0,107,106, 0,112, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,180, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,204, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,235};
|
||||
const G4int G4NeutronCaptureXS::amax[] = {
|
||||
0,
|
||||
0, 0, 7, 0,11,13,15,18, 0, 0, //1-10
|
||||
0, 0, 0,30, 0, 0, 0,40, 0,48, //11-20
|
||||
0, 0, 0, 0, 0,58, 0,64,65,70, //21-30
|
||||
0,76, 0, 0, 0, 0, 0, 0, 0,96, //31-40
|
||||
0, 0, 0, 0, 0, 0,109,116, 0,124, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,186, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,208, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,238};
|
||||
|
||||
G4ElementData* G4NeutronCaptureXS::data = 0;
|
||||
|
||||
G4NeutronCaptureXS::G4NeutronCaptureXS()
|
||||
: G4VCrossSectionDataSet("G4NeutronCaptureXS"),
|
||||
: G4VCrossSectionDataSet(Default_Name()),
|
||||
emax(20*MeV),elimit(1.0e-10*eV)
|
||||
{
|
||||
// verboseLevel = 0;
|
||||
@@ -83,14 +92,13 @@ G4NeutronCaptureXS::G4NeutronCaptureXS()
|
||||
G4cout << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
|
||||
<< MAXZCAPTURE << G4endl;
|
||||
}
|
||||
data.SetName("NeutronCapture");
|
||||
work.resize(13,0);
|
||||
temp.resize(13,0.0);
|
||||
isInitialized = false;
|
||||
isMaster = false;
|
||||
}
|
||||
|
||||
G4NeutronCaptureXS::~G4NeutronCaptureXS()
|
||||
{}
|
||||
{
|
||||
if(isMaster) { delete data; data = 0; }
|
||||
}
|
||||
|
||||
void G4NeutronCaptureXS::CrossSectionDescription(std::ostream& outFile) const
|
||||
{
|
||||
@@ -125,12 +133,12 @@ G4NeutronCaptureXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
if(ekin > emax || Z < 1 || Z >= MAXZCAPTURE) { return xs; }
|
||||
if(ekin < elimit) { ekin = elimit; }
|
||||
|
||||
G4PhysicsVector* pv = data.GetElementData(Z);
|
||||
G4PhysicsVector* pv = data->GetElementData(Z);
|
||||
|
||||
// element was not initialised
|
||||
if(!pv) {
|
||||
Initialise(Z);
|
||||
pv = data.GetElementData(Z);
|
||||
pv = data->GetElementData(Z);
|
||||
if(!pv) { return xs; }
|
||||
}
|
||||
|
||||
@@ -163,15 +171,15 @@ G4double G4NeutronCaptureXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
|
||||
G4double xs = 0.0;
|
||||
if(ekin < elimit) { ekin = elimit; }
|
||||
|
||||
G4PhysicsVector* pv = data.GetElementData(Z);
|
||||
G4PhysicsVector* pv = data->GetElementData(Z);
|
||||
|
||||
// element was not initialised
|
||||
if(!pv) {
|
||||
Initialise(Z);
|
||||
pv = data.GetElementData(Z);
|
||||
pv = data->GetElementData(Z);
|
||||
if(!pv) { return xs; }
|
||||
}
|
||||
G4PhysicsVector* pviso = data.GetComponentDataByID(Z, A);
|
||||
G4PhysicsVector* pviso = data->GetComponentDataByID(Z, A);
|
||||
if(pviso) { pv = pviso; }
|
||||
|
||||
G4double e1 = pv->Energy(1);
|
||||
@@ -212,7 +220,7 @@ G4Isotope* G4NeutronCaptureXS::SelectIsotope(const G4Element* anElement,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
size_t nmax = data.GetNumberOfComponents(Z);
|
||||
size_t nmax = data->GetNumberOfComponents(Z);
|
||||
if(temp.size() < nmax) { temp.resize(nmax,0.0); }
|
||||
for (size_t i=0; i<nmax; ++i) {
|
||||
G4int A = (*isoVector)[i]->GetN();
|
||||
@@ -234,7 +242,6 @@ G4Isotope* G4NeutronCaptureXS::SelectIsotope(const G4Element* anElement,
|
||||
void
|
||||
G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
{
|
||||
if(isInitialized) { return; }
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for "
|
||||
<< p.GetParticleName() << G4endl;
|
||||
@@ -247,23 +254,34 @@ G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
FatalException, ed, "");
|
||||
return;
|
||||
}
|
||||
isInitialized = true;
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
if(!data) {
|
||||
isMaster = true;
|
||||
data = new G4ElementData();
|
||||
data->SetName("NeutronCapture");
|
||||
work.resize(13,0);
|
||||
temp.resize(13,0.0);
|
||||
}
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4int(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z >= MAXZCAPTURE) { Z = MAXZCAPTURE-1; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!data.GetElementData(Z)) { Initialise(Z, path); }
|
||||
// it is possible re-initialisation for the second run
|
||||
if(isMaster) {
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4int(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z >= MAXZCAPTURE) { Z = MAXZCAPTURE-1; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!data->GetElementData(Z)) { Initialise(Z, path); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +289,7 @@ G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
void
|
||||
G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
|
||||
{
|
||||
if(data.GetElementData(Z)) { return; }
|
||||
if(data->GetElementData(Z)) { return; }
|
||||
const char* path = p;
|
||||
|
||||
// check environment variable
|
||||
@@ -288,7 +306,7 @@ G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
|
||||
std::ostringstream ost;
|
||||
ost << path << "/cap" << Z ;
|
||||
G4PhysicsVector* v = RetrieveVector(ost, true);
|
||||
data.InitialiseForElement(Z, v);
|
||||
data->InitialiseForElement(Z, v);
|
||||
|
||||
// upload isotope data
|
||||
if(amin[Z] > 0) {
|
||||
@@ -304,9 +322,9 @@ G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
|
||||
work[i] = v;
|
||||
++i;
|
||||
}
|
||||
data.InitialiseForComponent(Z, n);
|
||||
data->InitialiseForComponent(Z, n);
|
||||
for(size_t j=0; j<i; ++j) {
|
||||
if(work[j]) { data.AddComponent(Z, amin[Z]+j, work[j]); }
|
||||
if(work[j]) { data->AddComponent(Z, amin[Z]+j, work[j]); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NeutronElasticXS.cc 76889 2013-11-18 13:01:55Z gcosmo $
|
||||
// $Id: G4NeutronElasticXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -53,32 +53,42 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
// factory
|
||||
#include "G4CrossSectionFactory.hh"
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4NeutronElasticXS);
|
||||
|
||||
using namespace std;
|
||||
|
||||
std::vector<G4PhysicsVector*>* G4NeutronElasticXS::data = 0;
|
||||
G4double G4NeutronElasticXS::coeff[] = {0.0};
|
||||
|
||||
G4NeutronElasticXS::G4NeutronElasticXS()
|
||||
: G4VCrossSectionDataSet("G4NeutronElasticXS"),
|
||||
proton(G4Proton::Proton()), maxZ(92)
|
||||
: G4VCrossSectionDataSet(Default_Name()),
|
||||
proton(G4Proton::Proton())
|
||||
{
|
||||
// verboseLevel = 0;
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
|
||||
<< maxZ + 1 << G4endl;
|
||||
<< MAXZEL << G4endl;
|
||||
}
|
||||
data.resize(maxZ+1, 0);
|
||||
coeff.resize(maxZ+1, 1.0);
|
||||
ggXsection = new G4GlauberGribovCrossSection();
|
||||
fNucleon = new G4HadronNucleonXsc();
|
||||
isInitialized = false;
|
||||
isMaster = false;
|
||||
}
|
||||
|
||||
G4NeutronElasticXS::~G4NeutronElasticXS()
|
||||
{
|
||||
delete fNucleon;
|
||||
/*
|
||||
for(G4int i=0; i<=maxZ; ++i) {
|
||||
delete data[i];
|
||||
delete ggXsection;
|
||||
if(isMaster) {
|
||||
for(G4int i=0; i<MAXZEL; ++i) {
|
||||
delete (*data)[i];
|
||||
(*data)[i] = 0;
|
||||
}
|
||||
delete data;
|
||||
data = 0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void G4NeutronElasticXS::CrossSectionDescription(std::ostream& outFile) const
|
||||
@@ -105,17 +115,17 @@ G4NeutronElasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
G4double xs = 0.0;
|
||||
G4double ekin = aParticle->GetKineticEnergy();
|
||||
|
||||
if(Z < 1 || Z > maxZ) { return xs; }
|
||||
if(Z < 1 || Z >=MAXZEL) { return xs; }
|
||||
|
||||
G4int Amean = G4lrint(G4NistManager::Instance()->GetAtomicMassAmu(Z));
|
||||
G4PhysicsVector* pv = data[Z];
|
||||
G4PhysicsVector* pv = (*data)[Z];
|
||||
// G4cout << "G4NeutronElasticXS::GetCrossSection e= " << ekin
|
||||
// << " Z= " << Z << G4endl;
|
||||
|
||||
// element was not initialised
|
||||
if(!pv) {
|
||||
Initialise(Z);
|
||||
pv = data[Z];
|
||||
pv = (*data)[Z];
|
||||
if(!pv) { return xs; }
|
||||
}
|
||||
|
||||
@@ -144,7 +154,6 @@ G4NeutronElasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
void
|
||||
G4NeutronElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
{
|
||||
if(isInitialized) { return; }
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4NeutronElasticXS::BuildPhysicsTable for "
|
||||
<< p.GetParticleName() << G4endl;
|
||||
@@ -157,36 +166,46 @@ G4NeutronElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
FatalException, ed, "");
|
||||
return;
|
||||
}
|
||||
isInitialized = true;
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
|
||||
G4DynamicParticle* dynParticle =
|
||||
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4int(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z > maxZ) { Z = maxZ; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!data[Z]) { Initialise(Z, dynParticle, path); }
|
||||
}
|
||||
if(0 == coeff[0]) {
|
||||
isMaster = true;
|
||||
for(G4int i=0; i<MAXZEL; ++i) { coeff[i] = 1.0; }
|
||||
data = new std::vector<G4PhysicsVector*>;
|
||||
data->resize(MAXZEL, 0);
|
||||
}
|
||||
|
||||
// it is possible re-initialisation for the second run
|
||||
if(isMaster) {
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
|
||||
G4DynamicParticle* dynParticle =
|
||||
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4int(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z >= MAXZEL) { Z = MAXZEL-1; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!(*data)[Z]) { Initialise(Z, dynParticle, path); }
|
||||
}
|
||||
}
|
||||
delete dynParticle;
|
||||
}
|
||||
delete dynParticle;
|
||||
}
|
||||
|
||||
void
|
||||
G4NeutronElasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
const char* p)
|
||||
{
|
||||
if(data[Z]) { return; }
|
||||
if((*data)[Z]) { return; }
|
||||
const char* path = p;
|
||||
if(!p) {
|
||||
// check environment variable
|
||||
@@ -208,7 +227,7 @@ G4NeutronElasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
G4int Amean = G4lrint(G4NistManager::Instance()->GetAtomicMassAmu(Z));
|
||||
|
||||
// upload data from file
|
||||
data[Z] = new G4PhysicsLogVector();
|
||||
(*data)[Z] = new G4PhysicsLogVector();
|
||||
|
||||
std::ostringstream ost;
|
||||
ost << path << "/elast" << Z ;
|
||||
@@ -227,7 +246,7 @@ G4NeutronElasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
}
|
||||
|
||||
// retrieve data from DB
|
||||
if(!data[Z]->Retrieve(filein, true)) {
|
||||
if(!((*data)[Z]->Retrieve(filein, true))) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Data file <" << ost.str().c_str()
|
||||
<< "> is not retrieved!";
|
||||
@@ -237,9 +256,9 @@ G4NeutronElasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
}
|
||||
|
||||
// smooth transition
|
||||
size_t n = data[Z]->GetVectorLength() - 1;
|
||||
G4double emax = data[Z]->Energy(n);
|
||||
G4double sig1 = (*data[Z])[n];
|
||||
size_t n = (*data)[Z]->GetVectorLength() - 1;
|
||||
G4double emax = (*data)[Z]->Energy(n);
|
||||
G4double sig1 = (*(*data)[Z])[n];
|
||||
dynParticle->SetKineticEnergy(emax);
|
||||
G4double sig2 = 0.0;
|
||||
if(1 == Z) {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NeutronInelasticXS.cc 71324 2013-06-13 16:58:55Z gcosmo $
|
||||
// $Id: G4NeutronInelasticXS.cc 83697 2014-09-10 07:15:29Z gcosmo $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -54,52 +54,63 @@
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
// factory
|
||||
#include "G4CrossSectionFactory.hh"
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4NeutronInelasticXS);
|
||||
|
||||
using namespace std;
|
||||
|
||||
const G4int G4NeutronInelasticXS::amin[] = {0,
|
||||
0, 0, 6, 0,10,12,14,16, 0, 0, //1-10
|
||||
0, 0, 0,28, 0, 0, 0,36, 0,40, //11-20
|
||||
0, 0, 0, 0, 0,54, 0,58,63,64, //21-30
|
||||
0,70, 0, 0, 0, 0, 0, 0, 0,90, //31-40
|
||||
0, 0, 0, 0, 0, 0,107,106, 0,112, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,180, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,204, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,235};
|
||||
const G4int G4NeutronInelasticXS::amax[] = {0,
|
||||
0, 0, 7, 0,11,13,15,18, 0, 0, //1-10
|
||||
0, 0, 0,30, 0, 0, 0,40, 0,48, //11-20
|
||||
0, 0, 0, 0, 0,58, 0,64,65,70, //21-30
|
||||
0,76, 0, 0, 0, 0, 0, 0, 0,96, //31-40
|
||||
0, 0, 0, 0, 0, 0,109,116, 0,124, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,186, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,208, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,238};
|
||||
const G4int G4NeutronInelasticXS::amin[] = {
|
||||
0,
|
||||
0, 0, 6, 0,10,12,14,16, 0, 0, //1-10
|
||||
0, 0, 0,28, 0, 0, 0,36, 0,40, //11-20
|
||||
0, 0, 0, 0, 0,54, 0,58,63,64, //21-30
|
||||
0,70, 0, 0, 0, 0, 0, 0, 0,90, //31-40
|
||||
0, 0, 0, 0, 0, 0,107,106, 0,112, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,180, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,204, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,235};
|
||||
const G4int G4NeutronInelasticXS::amax[] = {
|
||||
0,
|
||||
0, 0, 7, 0,11,13,15,18, 0, 0, //1-10
|
||||
0, 0, 0,30, 0, 0, 0,40, 0,48, //11-20
|
||||
0, 0, 0, 0, 0,58, 0,64,65,70, //21-30
|
||||
0,76, 0, 0, 0, 0, 0, 0, 0,96, //31-40
|
||||
0, 0, 0, 0, 0, 0,109,116, 0,124, //41-50
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //51-60
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //61-70
|
||||
0, 0, 0,186, 0, 0, 0, 0, 0, 0, //71-80
|
||||
0,208, 0, 0, 0, 0, 0, 0, 0, 0, //81-90
|
||||
0,238};
|
||||
|
||||
G4double G4NeutronInelasticXS::coeff[] = {1.0};
|
||||
|
||||
G4ElementData* G4NeutronInelasticXS::data = 0;
|
||||
|
||||
G4NeutronInelasticXS::G4NeutronInelasticXS()
|
||||
: G4VCrossSectionDataSet("G4NeutronInelasticXS"),
|
||||
: G4VCrossSectionDataSet(Default_Name()),
|
||||
proton(G4Proton::Proton())
|
||||
{
|
||||
// verboseLevel = 0;
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
|
||||
G4cout << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
|
||||
<< MAXZINEL << G4endl;
|
||||
}
|
||||
data.SetName("NeutronInelastic");
|
||||
work.resize(13,0);
|
||||
temp.resize(13,0.0);
|
||||
coeff.resize(MAXZINEL, 1.0);
|
||||
ggXsection = new G4GlauberGribovCrossSection();
|
||||
fNucleon = new G4HadronNucleonXsc();
|
||||
isInitialized = false;
|
||||
isMaster = false;
|
||||
}
|
||||
|
||||
G4NeutronInelasticXS::~G4NeutronInelasticXS()
|
||||
{
|
||||
//G4cout << "G4NeutronInelasticXS::~G4NeutronInelasticXS() "
|
||||
// << " isMaster= " << isMaster << " data: " << data << G4endl;
|
||||
delete fNucleon;
|
||||
delete ggXsection;
|
||||
if(isMaster) { delete data; data = 0; }
|
||||
}
|
||||
|
||||
void G4NeutronInelasticXS::CrossSectionDescription(std::ostream& outFile) const
|
||||
@@ -127,9 +138,9 @@ G4NeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle*,
|
||||
return true;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4NeutronInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
G4int Z, const G4Material*)
|
||||
G4double G4NeutronInelasticXS::GetElementCrossSection(
|
||||
const G4DynamicParticle* aParticle,
|
||||
G4int Z, const G4Material*)
|
||||
{
|
||||
G4double xs = 0.0;
|
||||
G4double ekin = aParticle->GetKineticEnergy();
|
||||
@@ -137,14 +148,14 @@ G4NeutronInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
if(Z < 1 || Z >= MAXZINEL) { return xs; }
|
||||
G4int Amean = G4lrint(G4NistManager::Instance()->GetAtomicMassAmu(Z));
|
||||
|
||||
G4PhysicsVector* pv = data.GetElementData(Z);
|
||||
// G4cout << "G4NeutronInelasticXS::GetCrossSection e= " << ekin << " Z= "
|
||||
// << Z << G4endl;
|
||||
G4PhysicsVector* pv = data->GetElementData(Z);
|
||||
// G4cout << "G4NeutronInelasticXS::GetCrossSection e= " << ekin
|
||||
// << " Z= " << Z << G4endl;
|
||||
|
||||
// element was not initialised
|
||||
if(!pv) {
|
||||
Initialise(Z);
|
||||
pv = data.GetElementData(Z);
|
||||
pv = data->GetElementData(Z);
|
||||
if(!pv) { return xs; }
|
||||
}
|
||||
|
||||
@@ -169,11 +180,11 @@ G4NeutronInelasticXS::GetElementCrossSection(const G4DynamicParticle* aParticle,
|
||||
return xs;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4NeutronInelasticXS::GetIsoCrossSection(const G4DynamicParticle* aParticle,
|
||||
G4int Z, G4int A,
|
||||
const G4Isotope*, const G4Element*,
|
||||
const G4Material*)
|
||||
G4double G4NeutronInelasticXS::GetIsoCrossSection(
|
||||
const G4DynamicParticle* aParticle,
|
||||
G4int Z, G4int A,
|
||||
const G4Isotope*, const G4Element*,
|
||||
const G4Material*)
|
||||
{
|
||||
G4double xs = 0.0;
|
||||
G4double ekin = aParticle->GetKineticEnergy();
|
||||
@@ -186,15 +197,15 @@ G4NeutronInelasticXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
|
||||
{
|
||||
G4double xs = 0.0;
|
||||
|
||||
G4PhysicsVector* pv = data.GetElementData(Z);
|
||||
G4PhysicsVector* pv = data->GetElementData(Z);
|
||||
|
||||
// element was not initialised
|
||||
if(!pv) {
|
||||
Initialise(Z);
|
||||
pv = data.GetElementData(Z);
|
||||
pv = data->GetElementData(Z);
|
||||
if(!pv) { return xs; }
|
||||
}
|
||||
G4PhysicsVector* pviso = data.GetComponentDataByID(Z, A);
|
||||
G4PhysicsVector* pviso = data->GetComponentDataByID(Z, A);
|
||||
if(pviso) { pv = pviso; }
|
||||
|
||||
xs = pv->Value(ekin);
|
||||
@@ -205,8 +216,8 @@ G4NeutronInelasticXS::IsoCrossSection(G4double ekin, G4int Z, G4int A)
|
||||
return xs;
|
||||
}
|
||||
|
||||
G4Isotope* G4NeutronInelasticXS::SelectIsotope(const G4Element* anElement,
|
||||
G4double kinEnergy)
|
||||
G4Isotope* G4NeutronInelasticXS::SelectIsotope(
|
||||
const G4Element* anElement, G4double kinEnergy)
|
||||
{
|
||||
G4int nIso = anElement->GetNumberOfIsotopes();
|
||||
G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
|
||||
@@ -230,7 +241,7 @@ G4Isotope* G4NeutronInelasticXS::SelectIsotope(const G4Element* anElement,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
size_t nmax = data.GetNumberOfComponents(Z);
|
||||
size_t nmax = data->GetNumberOfComponents(Z);
|
||||
if(temp.size() < nmax) { temp.resize(nmax,0.0); }
|
||||
for (size_t i=0; i<nmax; ++i) {
|
||||
G4int A = (*isoVector)[i]->GetN();
|
||||
@@ -252,9 +263,8 @@ G4Isotope* G4NeutronInelasticXS::SelectIsotope(const G4Element* anElement,
|
||||
void
|
||||
G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
{
|
||||
if(isInitialized) { return; }
|
||||
if(verboseLevel > 0){
|
||||
G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for "
|
||||
G4cout << "G4NeutronInelasticXS::BuildPhysicsTable for "
|
||||
<< p.GetParticleName() << G4endl;
|
||||
}
|
||||
if(p.GetParticleName() != "neutron") {
|
||||
@@ -265,40 +275,53 @@ G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
FatalException, ed, "");
|
||||
return;
|
||||
}
|
||||
isInitialized = true;
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
|
||||
G4DynamicParticle* dynParticle =
|
||||
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4lrint(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z >= MAXZINEL) { Z = MAXZINEL-1; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!data.GetElementData(Z)) { Initialise(Z, dynParticle, path); }
|
||||
}
|
||||
if(!data) {
|
||||
isMaster = true;
|
||||
data = new G4ElementData();
|
||||
data->SetName("NeutronInelastic");
|
||||
work.resize(13,0);
|
||||
temp.resize(13,0.0);
|
||||
}
|
||||
|
||||
// it is possible re-initialisation for the new run
|
||||
if(isMaster) {
|
||||
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
char* path = getenv("G4NEUTRONXSDATA");
|
||||
|
||||
G4DynamicParticle* dynParticle =
|
||||
new G4DynamicParticle(G4Neutron::Neutron(),G4ThreeVector(1,0,0),1);
|
||||
|
||||
// Access to elements
|
||||
const G4ElementTable* theElmTable = G4Element::GetElementTable();
|
||||
size_t numOfElm = G4Element::GetNumberOfElements();
|
||||
if(numOfElm > 0) {
|
||||
for(size_t i=0; i<numOfElm; ++i) {
|
||||
G4int Z = G4lrint(((*theElmTable)[i])->GetZ());
|
||||
if(Z < 1) { Z = 1; }
|
||||
else if(Z >= MAXZINEL) { Z = MAXZINEL-1; }
|
||||
//G4cout << "Z= " << Z << G4endl;
|
||||
// Initialisation
|
||||
if(!(data->GetElementData(Z))) {
|
||||
Initialise(Z, dynParticle, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
delete dynParticle;
|
||||
}
|
||||
delete dynParticle;
|
||||
}
|
||||
|
||||
void
|
||||
G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
const char* p)
|
||||
{
|
||||
if(data.GetElementData(Z)) { return; }
|
||||
if(data->GetElementData(Z)) { return; }
|
||||
const char* path = p;
|
||||
if(!p) {
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
// check environment variable
|
||||
// Build the complete string identifying the file with the data set
|
||||
path = getenv("G4NEUTRONXSDATA");
|
||||
if (!path) {
|
||||
G4Exception("G4NeutronInelasticXS::Initialise(..)","had013",
|
||||
@@ -319,8 +342,12 @@ G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
std::ostringstream ost;
|
||||
ost << path << "/inelast" << Z ;
|
||||
G4PhysicsVector* v = RetrieveVector(ost, true);
|
||||
data.InitialiseForElement(Z, v);
|
||||
|
||||
data->InitialiseForElement(Z, v);
|
||||
/*
|
||||
G4cout << "G4NeutronInelasticXS::Initialise for Z= " << Z
|
||||
<< " A= " << Amean << " Amin= " << amin[Z]
|
||||
<< " Amax= " << amax[Z] << G4endl;
|
||||
*/
|
||||
// upload isotope data
|
||||
if(amin[Z] > 0) {
|
||||
size_t n = 0;
|
||||
@@ -329,15 +356,18 @@ G4NeutronInelasticXS::Initialise(G4int Z, G4DynamicParticle* dp,
|
||||
if(work.size() < nmax) { work.resize(nmax,0); }
|
||||
for(G4int A=amin[Z]; A<=amax[Z]; ++A) {
|
||||
std::ostringstream ost1;
|
||||
ost1 << path << "/cap" << Z << "_" << A;
|
||||
ost1 << path << "/inelast" << Z << "_" << A;
|
||||
G4PhysicsVector* v1 = RetrieveVector(ost1, false);
|
||||
if(v1) { ++n; }
|
||||
work[i] = v1;
|
||||
++i;
|
||||
}
|
||||
data.InitialiseForComponent(Z, n);
|
||||
|
||||
//G4cout << " n= " << n << G4endl;
|
||||
|
||||
data->InitialiseForComponent(Z, n);
|
||||
for(size_t j=0; j<i; ++j) {
|
||||
if(work[j]) { data.AddComponent(Z, amin[Z]+j, work[j]); }
|
||||
if(work[j]) { data->AddComponent(Z, amin[Z]+j, work[j]); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,12 +397,12 @@ G4NeutronInelasticXS::RetrieveVector(std::ostringstream& ost, G4bool warn)
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Data file <" << ost.str().c_str()
|
||||
<< "> is not opened!";
|
||||
G4Exception("G4NeutronElasticXS::RetrieveVector(..)","had014",
|
||||
G4Exception("G4NeutronInelasticXS::RetrieveVector(..)","had014",
|
||||
FatalException, ed, "Check G4NEUTRONXSDATA");
|
||||
}else{
|
||||
if(verboseLevel > 1) {
|
||||
G4cout << "File " << ost.str()
|
||||
<< " is opened by G4NeutronCaptureXS" << G4endl;
|
||||
<< " is opened by G4NeutronInelasticXS" << G4endl;
|
||||
}
|
||||
// retrieve data from DB
|
||||
v = new G4PhysicsLogVector();
|
||||
|
||||
@@ -30,6 +30,12 @@
|
||||
#include "G4HadronicException.hh"
|
||||
#include "G4HadTmpUtil.hh"
|
||||
|
||||
// factory
|
||||
#include "G4CrossSectionFactory.hh"
|
||||
//
|
||||
G4_DECLARE_XS_FACTORY(G4PiNuclearCrossSection);
|
||||
|
||||
|
||||
// by J.P Wellisch, Sun Sep 15 2002.
|
||||
// corrected G.Folger 17-8-2006: inel. Ca pim was missing two number,
|
||||
// + formatting
|
||||
@@ -379,7 +385,7 @@
|
||||
|
||||
|
||||
G4PiNuclearCrossSection::G4PiNuclearCrossSection()
|
||||
: G4VCrossSectionDataSet("G4PiNuclearCrossSection"),
|
||||
: G4VCrossSectionDataSet(Default_Name()),
|
||||
fTotalXsc(0.0), fElasticXsc(0.0)
|
||||
{
|
||||
SetMinKinEnergy(0.0);
|
||||
|
||||
@@ -64,6 +64,10 @@ G4UPiNuclearCrossSection::G4UPiNuclearCrossSection()
|
||||
|
||||
G4UPiNuclearCrossSection::~G4UPiNuclearCrossSection()
|
||||
{
|
||||
piPlusElastic->clearAndDestroy();
|
||||
piPlusInelastic->clearAndDestroy();
|
||||
piMinusElastic->clearAndDestroy();
|
||||
piMinusInelastic->clearAndDestroy();
|
||||
delete piPlusElastic;
|
||||
delete piPlusInelastic;
|
||||
delete piMinusElastic;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VCrossSectionRatio.cc 66241 2012-12-13 18:34:42Z gunter $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
//
|
||||
// File name: G4VCrossSectionRatio
|
||||
//
|
||||
// Author: V.Ivanchenko 30.10.2014
|
||||
//
|
||||
// Modifications:
|
||||
//
|
||||
|
||||
#include "G4VCrossSectionRatio.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
|
||||
G4VCrossSectionRatio::G4VCrossSectionRatio(const G4String& nam, G4int verb)
|
||||
: verboseLevel(verb),name(nam)
|
||||
{}
|
||||
|
||||
G4VCrossSectionRatio::~G4VCrossSectionRatio()
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::Description() const
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::BuildPhysicsTable(const G4ParticleDefinition&)
|
||||
{}
|
||||
|
||||
void
|
||||
G4VCrossSectionRatio::DumpPhysicsTable(const G4ParticleDefinition&)
|
||||
{}
|
||||
Reference in New Issue
Block a user